Search in sources :

Example 1 with BlockLightRedirector

use of lumien.randomthings.block.BlockLightRedirector in project Random-Things by lumien231.

the class MessageLightRedirector method onMessage.

@Override
public void onMessage(MessageContext context) {
    WorldClient worldObj = Minecraft.getMinecraft().world;
    if (worldObj != null && worldObj.provider.getDimension() == dimension && worldObj.isBlockLoaded(pos)) {
        for (EnumFacing facing : EnumFacing.VALUES) {
            if (!(worldObj.getBlockState(pos.offset(facing)).getBlock() instanceof BlockLightRedirector)) {
                IBlockState state = worldObj.getBlockState(pos.offset(facing));
                worldObj.notifyBlockUpdate(pos.offset(facing), state, state, 3);
            }
        }
    }
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) EnumFacing(net.minecraft.util.EnumFacing) BlockLightRedirector(lumien.randomthings.block.BlockLightRedirector) WorldClient(net.minecraft.client.multiplayer.WorldClient)

Aggregations

BlockLightRedirector (lumien.randomthings.block.BlockLightRedirector)1 IBlockState (net.minecraft.block.state.IBlockState)1 WorldClient (net.minecraft.client.multiplayer.WorldClient)1 EnumFacing (net.minecraft.util.EnumFacing)1