mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-27 23:45:55 +00:00
protect against ClassCastException when a tank is used in eg a Carpenter's block
This commit is contained in:
1 parent
6c7216b0d0
commit
ac1ca7865e
1 file changed
+3
-3
@@ -130,9 +130,9 @@ public class BlockTank extends AbstractMachineBlock<TileTank> implements IAdvanc
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
||||
TileTank tank = (TileTank) world.getTileEntity(x, y, z);
|
||||
if(tank != null) {
|
||||
FluidStack stack = tank.tank.getFluid();
|
||||
TileEntity tank = world.getTileEntity(x, y, z);
|
||||
if(tank instanceof TileTank) {
|
||||
FluidStack stack = ((TileTank) tank).tank.getFluid();
|
||||
return stack == null || stack.amount <= 0 ? 0 : stack.getFluid().getLuminosity(stack);
|
||||
}
|
||||
return super.getLightValue(world, x, y, z);
|
||||
|
||||
Reference in new issue
Block a user