Advertisement
Sn0wFR

ItemBuilder

Apr 4th, 2020
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. public class ItemBuilder {
  2.  
  3.     private String lore;
  4.     private String name;
  5.     private ItemStack it;
  6.     private int slot;
  7.    
  8.     ItemBuilder(int slot, ItemStack it, String name, String lore){
  9.         this.setSlot(slot);
  10.         this.setIt(it);
  11.         this.setName(name);
  12.         this.setLore(lore);
  13.     }
  14.  
  15.     public ItemStack getItem() {
  16.         ItemStack i = it;
  17.         ItemMeta iM = i.getItemMeta();
  18.         iM.setDisplayName(name);
  19.         iM.setLore(Arrays.asList(lore));
  20.         i.setItemMeta(iM);
  21.         return i;
  22.     }
  23.    
  24.     public int getSlot() {
  25.         return slot;
  26.     }
  27.  
  28.     public void setSlot(int slot) {
  29.         this.slot = slot;
  30.     }
  31.  
  32.     public ItemStack getIt() {
  33.         return it;
  34.     }
  35.  
  36.     public void setIt(ItemStack it) {
  37.         this.it = it;
  38.     }
  39.  
  40.     public String getName() {
  41.         return name;
  42.     }
  43.  
  44.     public void setName(String name) {
  45.         this.name = name;
  46.     }
  47.  
  48.     public String getLore() {
  49.         return lore;
  50.     }
  51.  
  52.     public void setLore(String lore) {
  53.         this.lore = lore;
  54.     }
  55.    
  56.    
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement