Advertisement
Lisenochek

Untitled

Aug 26th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. package com.realistic.list;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import org.bukkit.Material;
  6. import org.bukkit.inventory.ItemStack;
  7. import org.bukkit.inventory.meta.ItemMeta;
  8.  
  9. public class GUI_List {
  10.  
  11. public static ItemStack create(Material material, int amount, byte metadata, String name, String lore1,
  12. String lore2, String lore3, String lore4, String lore5) {
  13.  
  14. ItemStack item = new ItemStack(material, amount, metadata);
  15. ItemMeta meta = item.getItemMeta();
  16.  
  17. if (name != null) {
  18. meta.setDisplayName(name);
  19. }
  20.  
  21. ArrayList<String> lore = new ArrayList<String>();
  22.  
  23. if (lore1 != null) {
  24. lore.add(lore1);
  25. }
  26. if (lore2 != null) {
  27. lore.add(lore2);
  28. }
  29. if (lore3 != null) {
  30. lore.add(lore3);
  31. }
  32. if (lore4 != null) {
  33. lore.add(lore4);
  34. }
  35. if (lore5 != null) {
  36. lore.add(lore5);
  37. }
  38. meta.setLore(lore);
  39. item.setItemMeta(meta);
  40.  
  41. return item;
  42. }
  43.  
  44. public static ItemStack create(Material material, String name) {
  45.  
  46. return create(material, 1, (byte) 0, name, null, null, null, null, null);
  47. }
  48.  
  49. public static ItemStack create(Material material, int amount, byte metadata, String name) {
  50.  
  51. return create(material, amount, metadata, name, null, null, null, null, null);
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement