Massive network performance inprovement.

This commit is contained in:
modmuss50 2015-05-16 17:33:50 +01:00
parent d32b39d8c6
commit 3e5fc0bbec

View file

@ -90,6 +90,7 @@ public class RecipeCrafter {
for (IBaseRecipeType recipe : RecipeHanderer.getRecipeClassFromName(recipeName)) { for (IBaseRecipeType recipe : RecipeHanderer.getRecipeClassFromName(recipeName)) {
if(hasAllInputs(recipe)){ if(hasAllInputs(recipe)){
currentRecipe = recipe; currentRecipe = recipe;
parentTile.syncWithAll();
return; return;
} }
} }
@ -97,6 +98,7 @@ public class RecipeCrafter {
if(!hasAllInputs()){ if(!hasAllInputs()){
currentRecipe = null; currentRecipe = null;
currentTickTime = 0; currentTickTime = 0;
parentTile.syncWithAll();
return; return;
} }
if (currentTickTime >= currentRecipe.tickTime()) { if (currentTickTime >= currentRecipe.tickTime()) {
@ -124,9 +126,11 @@ public class RecipeCrafter {
parentTile.syncWithAll(); parentTile.syncWithAll();
} }
} else if (currentTickTime < currentRecipe.tickTime()) { } else if (currentTickTime < currentRecipe.tickTime()) {
if (energy.useEnergy(currentRecipe.euPerTick())) { if (energy.canUseEnergy(currentRecipe.euPerTick())) {
if(!parentTile.getWorldObj().isRemote){
this.energy.setEnergyStored(this.energy.getEnergyStored() - currentRecipe.euPerTick());
}
currentTickTime++; currentTickTime++;
parentTile.syncWithAll();
} }
} }
} }