Fix electric furnace energy usage. Closes #1920
This commit is contained in:
parent
99b2342a1c
commit
a37a6e29a5
1 changed files with 7 additions and 17 deletions
|
@ -57,7 +57,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
|
||||||
private int cookTime;
|
private int cookTime;
|
||||||
private int cookTimeTotal;
|
private int cookTimeTotal;
|
||||||
// Energy cost per tick of cooking
|
// Energy cost per tick of cooking
|
||||||
final int EnergyPerTick = 4;
|
final int EnergyPerTick = 1;
|
||||||
|
|
||||||
public ElectricFurnaceBlockEntity() {
|
public ElectricFurnaceBlockEntity() {
|
||||||
super(TRBlockEntities.ELECTRIC_FURNACE );
|
super(TRBlockEntities.ELECTRIC_FURNACE );
|
||||||
|
@ -99,9 +99,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (ItemUtils.isItemEqual(inventory.getInvStack(slot), recipeOutput, true, true)) {
|
if (ItemUtils.isItemEqual(inventory.getInvStack(slot), recipeOutput, true, true)) {
|
||||||
if (recipeOutput.getCount() + inventory.getInvStack(slot).getCount() <= recipeOutput.getMaxCount()) {
|
return recipeOutput.getCount() + inventory.getInvStack(slot).getCount() <= recipeOutput.getMaxCount();
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -116,11 +114,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
|
||||||
if (!canAcceptOutput(currentRecipe, outputSlot)) {
|
if (!canAcceptOutput(currentRecipe, outputSlot)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getEnergy() < currentRecipe.getCookTime() * getEuPerTick(EnergyPerTick)) {
|
return !(getEnergy() < currentRecipe.getCookTime() * getEuPerTick(EnergyPerTick));
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetCrafter() {
|
private void resetCrafter() {
|
||||||
|
@ -149,11 +143,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!recipe.matches(inventory, world)) {
|
return recipe.matches(inventory, world);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void craftRecipe(SmeltingRecipe recipe) {
|
private void craftRecipe(SmeltingRecipe recipe) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue