tterrag1098

Untitled

Nov 13th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. @Override
  2.     public void onBlockClicked(World world, int x, int y, int z,
  3.             EntityPlayer player) {
  4.         System.out.println(player.getItemInUse());
  5.         if (player.getItemInUse() != null && player.getItemInUse().itemID == ModItem.CONNECTOR_ID && this.blockID == ModBlock.COLOREDLAMP_ID && player.isSneaking())
  6.         {
  7.             world.setBlock(x, y, z, ModBlock.EMPTYCOLOREDLAMP_ID);
  8.             world.markBlockForUpdate(x, y, z);
  9.             if (!player.inventory.addItemStackToInventory(new ItemStack(Block.torchWood, 1)))
  10.                 player.dropItem(Block.torchWood.blockID, 1);
  11.         }
  12.         super.onBlockClicked(world, x, y, z, player);
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment