hilburn

Untitled

Sep 13th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. @Override
  2.     public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
  3.     {
  4.  
  5.         if (world.getTileEntity(x, y, z) instanceof TileEntityPylon)
  6.     {
  7.             if (stack.stackTagCompound != null && !world.isRemote)
  8.             {
  9.                     int red = stack.stackTagCompound.getInteger("colorRed");
  10.                     int green = stack.stackTagCompound.getInteger("colorGreen");
  11.                     int blue = stack.stackTagCompound.getInteger("colorBlue");
  12.  
  13.                     boolean isFirstTimeUse = stack.stackTagCompound.getBoolean("isFirstTimeUse");
  14.                     if (isFirstTimeUse)
  15.                     {
  16.  
  17.                             stack.stackTagCompound.setInteger("colorRed", tePylon.red);
  18.                             stack.stackTagCompound.setInteger("colorGreen", tePylon.green);
  19.                             stack.stackTagCompound.setInteger("colorBlue", tePylon.blue);
  20.                             stack.stackTagCompound.setBoolean("isFirstTimeUse", false);
  21.  
  22.                             return true;
  23.                     }
  24.                 }
  25.  
  26.         }
  27.         return false;
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment