Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. @SuppressWarnings("deprecation")
  2. public static String getItemName(String i) {
  3.  
  4. if(i.equals("33:0")) return "Piston";
  5. if(i.equals("397:5")) return "Dragon's head";
  6.  
  7. String[] dataid = i.split(":");
  8. int id = Integer.parseInt(dataid[0]);
  9. int data = Integer.parseInt(dataid[1]);
  10.  
  11. ItemStack a = new ItemStack(id, 1, (byte) data);
  12. String item = a.getType().toString();
  13.  
  14. String name = "";
  15. for (String word : item.split("_"))
  16. name += word.substring(0, 1) + word.substring(1, word.length()).toLowerCase() + " ";
  17. name = name.substring(0, name.length() - 1);
  18. return name;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement