Advertisement
Jycko

ItemSample.java

Jul 9th, 2018
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.39 KB | None | 0 0
  1. public class ItemSample {
  2.     private static ItemSample instance;
  3.     public static ItemStack TheBox = new ItemStack(Material.CHEST);
  4.     public static ItemStack Ship = new ItemStack(Material.BOAT);
  5.     public static ItemStack Keep = new ItemStack(Material.EMERALD_BLOCK);
  6.     public static ItemMeta TheBoxMeta = TheBox.getItemMeta();
  7.     public static ItemMeta ShipMeta = Ship.getItemMeta();
  8.     public static ItemMeta KeepMeta = Keep.getItemMeta();
  9.     private ItemSample() {
  10.         instance = this;
  11.         TheBoxMeta.setDisplayName(ShipmentBox.Name);
  12.         TheBoxMeta.setLore(ShipmentBox.Lores);
  13.         ShipMeta.setDisplayName(ShipmentBox.ShipName);
  14.         ShipMeta.setLore(ShipmentBox.ShipLores);
  15.         KeepMeta.setDisplayName(ShipmentBox.KeepName);
  16.         KeepMeta.setLore(ShipmentBox.KeepLores);
  17.     }
  18.     public static ItemSample getInstance() {
  19.         if (instance == null) {
  20.             instance = new ItemSample();
  21.         }
  22.         return instance;
  23.     }
  24.     public static void GiveBox(Player p) {
  25.         TheBoxMeta.setDisplayName(Utility.TransColor(ShipmentBox.Name + " &6&l&m-&e Owned by &l" + p.getName()));
  26.         TheBox.setItemMeta(TheBoxMeta);
  27.         p.getInventory().addItem(TheBox);
  28.     }
  29.     public static void GiveBox(Player p, int amount) {
  30.         TheBoxMeta.setDisplayName(Utility.TransColor(ShipmentBox.Name + " &6&l&m-&e Owned by &l" + p.getName()));
  31.         TheBox.setItemMeta(TheBoxMeta);
  32.         ItemStack TheBox2 = TheBox;
  33.         TheBox2.setAmount(amount);
  34.         p.getInventory().addItem(TheBox2);
  35.     }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement