Nullcheck tile in Lava/Water/Void sigils (#1236)

This commit is contained in:
Nicholas Ignoffo 2018-02-19 14:06:05 -08:00
parent 0beef19ba1
commit 77bdbed8b5
3 changed files with 3 additions and 3 deletions

View file

@ -80,7 +80,7 @@ public class ItemSigilLava extends ItemSigilBase {
}
TileEntity tile = world.getTileEntity(blockPos);
if (tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side)) {
if (tile != null && tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side)) {
IFluidHandler handler = tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side);
FluidStack fluid = new FluidStack(FluidRegistry.LAVA, 1000);
int amount = handler.fill(fluid, false);

View file

@ -86,7 +86,7 @@ public class ItemSigilVoid extends ItemSigilBase {
}
TileEntity tile = world.getTileEntity(blockPos);
if (tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side)) {
if (tile != null && tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side)) {
IFluidHandler handler = tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side);
FluidStack amount = handler.drain(1000, false);

View file

@ -73,7 +73,7 @@ public class ItemSigilWater extends ItemSigilBase {
return EnumActionResult.FAIL;
TileEntity tile = world.getTileEntity(blockPos);
if (tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side)) {
if (tile != null && tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side)) {
IFluidHandler handler = tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side);
FluidStack fluid = new FluidStack(FluidRegistry.WATER, 1000);
int amount = handler.fill(fluid, false);