@Override public boolean onBlockActivated( World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if (player.getCurrentEquippedItem() != null) { if (player.getCurrentEquippedItem().getItem() instanceof ItemBlock) { if (world.getTileEntity(x, y, z) instanceof TileEntityDisguiseBlock) { TileEntityDisguiseBlock te = (TileEntityDisguiseBlock) world.getTileEntity(x, y, z); if (te != null) { if (!player.isSneaking()) { if (!((ItemBlock) player.getCurrentEquippedItem().getItem()) .field_150939_a.hasTileEntity(te.getMetadata())) { te.setBlock( Block.getBlockFromItem(player.getCurrentEquippedItem().getItem()), player.getCurrentEquippedItem().getItemDamage()); return true; } } } } } } return false; }
@SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) { if (blockAccess.getTileEntity(x, y, z) instanceof TileEntityDisguiseBlock) { TileEntityDisguiseBlock te = (TileEntityDisguiseBlock) blockAccess.getTileEntity(x, y, z); if (te != null) { Block block = te.getBlock(); if (block != null) { return block.getIcon(side, te.getMetadata()); } } } return blockIcon; }