diff --git a/src/main/java/jp/ngt/rtm/block/BlockMachineBase.java b/src/main/java/jp/ngt/rtm/block/BlockMachineBase.java index ba492aab..d98f332f 100644 --- a/src/main/java/jp/ngt/rtm/block/BlockMachineBase.java +++ b/src/main/java/jp/ngt/rtm/block/BlockMachineBase.java @@ -65,9 +65,14 @@ protected boolean clickMachine(World world, int x, int y, int z, EntityPlayer pl @Override public int getLightValue(IBlockAccess world, int x, int y, int z) { - TileEntityMachineBase tile = (TileEntityMachineBase) world.getTileEntity(x, y, z); - MachineConfig cfg = tile.getModelSet().getConfig(); - return tile.isGettingPower ? cfg.brightness[1] : cfg.brightness[0]; + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof TileEntityMachineBase) { + TileEntityMachineBase tileEntityMachineBase = (TileEntityMachineBase) tile; + MachineConfig cfg = tileEntityMachineBase.getModelSet().getConfig(); + return tileEntityMachineBase.isGettingPower ? cfg.brightness[1] : cfg.brightness[0]; + } else { + return this.getLightValue(); + } } @Override