Add recolourBlock support to plastic.
This commit is contained in:
parent
4b6cc394f5
commit
386fd4e770
1 changed files with 12 additions and 0 deletions
|
@ -17,6 +17,7 @@ import net.minecraft.util.MovingObjectPosition;
|
|||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -96,4 +97,15 @@ public class BlockPlastic extends Block
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta != colour)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, colour, 3);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue