Fix incorrect usage of item stack checking
I have no idea how they worked without issue for this long :D
This commit is contained in:
parent
96d78c11a8
commit
d4a43d24a1
10 changed files with 21 additions and 21 deletions
|
@ -71,7 +71,7 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
if (canSmelt()) {
|
||||
final ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1));
|
||||
|
||||
if (getStackInSlot(output) == ItemStack.EMPTY) {
|
||||
if (getStackInSlot(output).isEmpty()) {
|
||||
setInventorySlotContents(output, itemstack.copy());
|
||||
} else if (getStackInSlot(output).isItemEqual(itemstack)) {
|
||||
getStackInSlot(output).grow(itemstack.getCount());
|
||||
|
@ -85,14 +85,14 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
public boolean canSmelt() {
|
||||
if (getStackInSlot(input1) == ItemStack.EMPTY) {
|
||||
if (getStackInSlot(input1).isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
final ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1));
|
||||
if (itemstack.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (getStackInSlot(output) == ItemStack.EMPTY) {
|
||||
if (getStackInSlot(output).isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
if (!getStackInSlot(output).isItemEqual(itemstack)) {
|
||||
|
|
|
@ -90,11 +90,11 @@ public class TileRecycler extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
public boolean canRecycle() {
|
||||
return getStackInSlot(0) != ItemStack.EMPTY && hasSlotGotSpace(1);
|
||||
return !getStackInSlot(0) .isEmpty() && hasSlotGotSpace(1);
|
||||
}
|
||||
|
||||
public boolean hasSlotGotSpace(int slot) {
|
||||
if (getStackInSlot(slot) == ItemStack.EMPTY) {
|
||||
if (getStackInSlot(slot).isEmpty()) {
|
||||
return true;
|
||||
} else if (getStackInSlot(slot).getCount() < getStackInSlot(slot).getMaxStackSize()) {
|
||||
return true;
|
||||
|
|
|
@ -136,7 +136,7 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
currentRecipeOutput = RollingMachineRecipe.instance.findMatchingRecipeOutput(craftMatrix, world);
|
||||
if (!currentRecipeOutput.isEmpty()) {
|
||||
boolean hasCrafted = false;
|
||||
if (inventory.getStackInSlot(outputSlot) == ItemStack.EMPTY) {
|
||||
if (inventory.getStackInSlot(outputSlot).isEmpty()) {
|
||||
inventory.setInventorySlotContents(outputSlot, currentRecipeOutput);
|
||||
tickTime = 0;
|
||||
hasCrafted = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue