Advertisement
PaleoCrafter

Untitled

Jun 23rd, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1.     @Override
  2.     public void onUpdate(ItemStack stack, World world,
  3.             Entity ent, int par4, boolean par5) {
  4.         if (!stack.hasTagCompound()) {
  5.             stack.setTagCompound(new NBTTagCompound());
  6.         }
  7.  
  8.         if (!stack.getTagCompound().hasKey("SubItemName")) {
  9.             switch (stack.getItemDamage()) {
  10.                 case 0:
  11.                     stack.getTagCompound().setString("SubItemName", "kilo");
  12.                 case 1:
  13.                     stack.getTagCompound().setString("SubItemName", "mega");
  14.                 case 2:
  15.                     stack.getTagCompound().setString("SubItemName", "giga");
  16.                 case 3:
  17.                     stack.getTagCompound().setString("SubItemName", "tera");
  18.                 default:
  19.                     stack.getTagCompound().setString("SubItemName", "kilo");
  20.             }
  21.         }
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement