A bunch more null check \o/
This commit is contained in:
parent
97e5fcc032
commit
5dff31d937
19 changed files with 33 additions and 29 deletions
|
@ -116,7 +116,7 @@ public class TileIronFurnace extends TileLegacyMachineBase implements IInventory
|
|||
|
||||
public ItemStack getResultFor(ItemStack stack) {
|
||||
ItemStack result = FurnaceRecipes.instance().getSmeltingResult(stack);
|
||||
if (result != null) {
|
||||
if (result != ItemStack.EMPTY) {
|
||||
return result.copy();
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -130,7 +130,7 @@ public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, II
|
|||
if (tank.getFluidType() != null && getStackInSlot(2) == ItemStack.EMPTY) {
|
||||
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != ItemStack.EMPTY) {
|
||||
setInventorySlotContents(2, null);
|
||||
setInventorySlotContents(2, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchab
|
|||
// inventory.setInventorySlotContents(2, new ItemStack(tank
|
||||
// .getFluidType().getBlock()));
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != ItemStack.EMPTY) {
|
||||
setInventorySlotContents(2, null);
|
||||
setInventorySlotContents(2, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
|
|||
if (getStackInSlot(input1).getCount() > 1) {
|
||||
this.decrStackSize(input1, 1);
|
||||
} else {
|
||||
setInventorySlotContents(input1, null);
|
||||
setInventorySlotContents(input1, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
|
|||
return false;
|
||||
} else {
|
||||
ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1));
|
||||
if (itemstack == null)
|
||||
if (itemstack == ItemStack.EMPTY)
|
||||
return false;
|
||||
if (getStackInSlot(output) == ItemStack.EMPTY)
|
||||
return true;
|
||||
|
|
|
@ -88,7 +88,7 @@ public class TileRecycler extends TilePowerAcceptor implements IWrenchable, IInv
|
|||
this.decrStackSize(input1, 1);
|
||||
} else {
|
||||
useEnergy(cost);
|
||||
setInventorySlotContents(input1, null);
|
||||
setInventorySlotContents(input1, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue