Fixed a crash when having phantom liquifaces connected to non-tileentities

Closes #111
This commit is contained in:
Ellpeck 2016-06-07 23:22:26 +02:00
parent 470e7b5518
commit 22e886ded2

View file

@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
@ -37,6 +38,12 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface{
@Override
public boolean isBoundThingInRange(){
return super.isBoundThingInRange() && this.worldObj.getTileEntity(this.boundPosition).hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null);
if(super.isBoundThingInRange()){
TileEntity tile = this.worldObj.getTileEntity(this.boundPosition);
if(tile != null){
return tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null);
}
}
return false;
}
}