Fix a load of null issues, and get it to sort of work.

This commit is contained in:
modmuss50 2016-11-19 16:36:13 +00:00
parent 65e651f402
commit 528fecc2b5
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
35 changed files with 101 additions and 87 deletions

View file

@ -97,11 +97,11 @@ public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchabl
if (!world.isRemote) {
FluidUtils.drainContainers(tank, inventory, 0, 1);
FluidUtils.fillContainers(tank, inventory, 0, 1, tank.getFluidType());
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
if (tank.getFluidType() != null && getStackInSlot(2) == ItemStack.EMPTY) {
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
syncWithAll();
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
setInventorySlotContents(2, null);
} else if (tank.getFluidType() == null && getStackInSlot(2) != ItemStack.EMPTY) {
setInventorySlotContents(2, ItemStack.EMPTY);
syncWithAll();
}

View file

@ -128,9 +128,9 @@ public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, II
tank.drain(currentWithdraw, true);
addEnergy(euTick);
}
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
if (tank.getFluidType() != null && getStackInSlot(2) == ItemStack.EMPTY) {
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
} else if (tank.getFluidType() == null && getStackInSlot(2) != ItemStack.EMPTY) {
setInventorySlotContents(2, null);
}
}

View file

@ -61,7 +61,7 @@ public class TileGenerator extends TilePowerAcceptor implements IWrenchable, IIn
if(getStackInSlot(fuelSlot).getItem() == Items.LAVA_BUCKET || getStackInSlot(fuelSlot).getItem() == ForgeModContainer.getInstance().universalBucket){
setInventorySlotContents(fuelSlot, new ItemStack(Items.BUCKET));
} else {
setInventorySlotContents(fuelSlot, null);
setInventorySlotContents(fuelSlot, ItemStack.EMPTY);
}
} else {

View file

@ -132,10 +132,10 @@ public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrench
tank.drain(currentWithdraw, true);
addEnergy(euTick);
}
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
if (tank.getFluidType() != null && getStackInSlot(2) == ItemStack.EMPTY) {
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
setInventorySlotContents(2, null);
} else if (tank.getFluidType() == null && getStackInSlot(2) != ItemStack.EMPTY) {
setInventorySlotContents(2, ItemStack.EMPTY);
}
}

View file

@ -124,10 +124,10 @@ public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchab
tank.drain(1, true);
addEnergy(euTick);
}
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
if (tank.getFluidType() != null && getStackInSlot(2) == ItemStack.EMPTY) {
// inventory.setInventorySlotContents(2, new ItemStack(tank
// .getFluidType().getBlock()));
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
} else if (tank.getFluidType() == null && getStackInSlot(2) != ItemStack.EMPTY) {
setInventorySlotContents(2, null);
}
}