Advertisement
EntenPlayz

Untitled

Jul 15th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. package de.EntenPlayz.APIs;
  2.  
  3. import org.bukkit.Material;
  4. import org.bukkit.inventory.ItemStack;
  5. import org.bukkit.inventory.meta.ItemMeta;
  6. import org.bukkit.inventory.meta.SkullMeta;
  7.  
  8. public class ItemAPI
  9. {
  10. ItemMeta itemMeta;
  11. ItemStack itemStack;
  12. SkullMeta skullMeta;
  13.  
  14. public ItemAPI(String display, Material material, byte subid, int amount)
  15. {
  16. this.itemStack = new ItemStack(material, amount, (short)subid);
  17. this.itemMeta = this.itemStack.getItemMeta();
  18. this.itemMeta.setDisplayName(display);
  19. }
  20.  
  21. public ItemAPI(String display, byte id, byte subid, int amount)
  22. {
  23. this.itemStack = new ItemStack(id, amount, (short)subid);
  24. this.itemMeta = this.itemStack.getItemMeta();
  25. this.itemMeta.setDisplayName(display);
  26. }
  27.  
  28. public ItemAPI(String display, String SkullOwner, int amount)
  29. {
  30. this.itemStack = new ItemStack(Material.SKULL_ITEM, amount);
  31. this.skullMeta = ((SkullMeta)this.itemStack.getItemMeta());
  32. this.skullMeta.setDisplayName(display);
  33. this.skullMeta.setOwner(SkullOwner);
  34. }
  35.  
  36. public ItemStack build()
  37. {
  38. this.itemStack.setItemMeta(this.itemMeta);
  39. return this.itemStack;
  40. }
  41.  
  42. public ItemStack buildskull()
  43. {
  44. this.itemStack.setItemMeta(this.skullMeta);
  45. return this.itemStack;
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement