Nullcheck tile in Lava/Water/Void sigils (#1236)
This commit is contained in:
parent
0beef19ba1
commit
77bdbed8b5
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue