16amattice

Untitled

May 10th, 2020
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.kyrxstudios.kitgui;
  2. import java.util.ArrayList;
  3. import java.util.HashMap;
  4. import java.util.List;
  5. import java.util.Map;
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.ChatColor;
  8. import org.bukkit.Location;
  9. import org.bukkit.Material;
  10. import org.bukkit.block.Block;
  11. import org.bukkit.block.BlockFace;
  12. import org.bukkit.block.Chest;
  13. import org.bukkit.command.Command;
  14. import org.bukkit.command.CommandSender;
  15. import org.bukkit.enchantments.Enchantment;
  16. import org.bukkit.entity.Player;
  17. import org.bukkit.event.EventHandler;
  18. import org.bukkit.event.Listener;
  19. import org.bukkit.event.inventory.InventoryClickEvent;
  20. import org.bukkit.event.inventory.InventoryType;
  21. import org.bukkit.inventory.Inventory;
  22. import org.bukkit.inventory.ItemFlag;
  23. import org.bukkit.inventory.ItemStack;
  24. import org.bukkit.inventory.meta.ItemMeta;
  25. import org.bukkit.plugin.java.JavaPlugin;
  26.  
  27.  
  28. public class Main extends JavaPlugin implements Listener {
  29.  
  30.     Map<String, Long> cooldowns = new HashMap<String, Long>();
  31.  
  32.     public static Inventory kits;
  33.  
  34.     @Override
  35.     public void onEnable() {
  36.         this.getServer().getPluginManager().registerEvents(this, this);
  37.  
  38.         createInventory();
  39.     }
  40.  
  41.     @Override
  42.     public void onDisable() {
  43.  
  44.     }
  45.  
  46.     private void createInventory() {
  47.         Inventory inv = Bukkit.createInventory(null, 9, ChatColor.GOLD + "AceCraft Kits");
  48.         ItemStack item = new ItemStack(Material.GOLDEN_SHOVEL);
  49.         ItemMeta meta = item.getItemMeta();
  50.         meta.setDisplayName(ChatColor.GREEN + "Claim Kit");
  51.         List<String> lore = new ArrayList<>();
  52.         lore.add("");
  53.         lore.add(ChatColor.YELLOW + "Click here to get this kit");
  54.         meta.setLore(lore);
  55.         meta.addEnchant(Enchantment.DURABILITY, 1, true);
  56.         meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
  57.         item.setItemMeta(meta);
  58.         inv.setItem(0, item);
  59.  
  60.         item.setType(Material.LIGHT_GRAY_SHULKER_BOX);
  61.         meta = item.getItemMeta();
  62.         meta.setDisplayName(ChatColor.DARK_GRAY + "Daily Kit");
  63.         item.setItemMeta(meta);
  64.         inv.setItem(1, item);
  65.  
  66.         item.setType(Material.GRAY_SHULKER_BOX);
  67.         meta = item.getItemMeta();
  68.         meta.setDisplayName(ChatColor.DARK_GRAY + "Soldier Kit");
  69.         item.setItemMeta(meta);
  70.         inv.setItem(2, item);
  71.  
  72.         item.setType(Material.BLUE_SHULKER_BOX);
  73.         meta = item.getItemMeta();
  74.         meta.setDisplayName(ChatColor.BLUE + "Spy Kit");
  75.         item.setItemMeta(meta);
  76.         inv.setItem(3, item);
  77.  
  78.         item.setType(Material.YELLOW_SHULKER_BOX);
  79.         meta = item.getItemMeta();
  80.         meta.setDisplayName(ChatColor.YELLOW + "Assassin Kit");
  81.         item.setItemMeta(meta);
  82.         inv.setItem(4, item);
  83.         item.setType(Material.RED_SHULKER_BOX);
  84.         meta = item.getItemMeta();
  85.         meta.setDisplayName(ChatColor.RED + "Captain Kit");
  86.         item.setItemMeta(meta);
  87.         inv.setItem(5, item);
  88.  
  89.         item.setType(Material.ORANGE_SHULKER_BOX);
  90.         meta = item.getItemMeta();
  91.         meta.setDisplayName(ChatColor.GOLD + "Legend Kit");
  92.         item.setItemMeta(meta);
  93.         inv.setItem(6, item);
  94.  
  95.         item.setType(Material.LIGHT_BLUE_SHULKER_BOX);
  96.         meta = item.getItemMeta();
  97.         meta.setDisplayName(ChatColor.AQUA + "Champion Kit");
  98.         item.setItemMeta(meta);
  99.         inv.setItem(7, item);
  100.  
  101.         item.setType(Material.PURPLE_SHULKER_BOX);
  102.         meta = item.getItemMeta();
  103.         meta.setDisplayName(ChatColor.DARK_PURPLE + "Titan Kit");
  104.         item.setItemMeta(meta);
  105.         inv.setItem(8, item);
  106.  
  107.         kits = inv;
  108.     }
  109.  
  110.  
  111.     public boolean onCommand(CommandSender sender, Command cmd, String lebel, String[] args) {
  112.         if(lebel.equalsIgnoreCase("kits")) {
  113.             if(!(sender instanceof Player)) {
  114.                 sender.sendMessage("Sorry, Console can not open kits!");
  115.                 return true;
  116.             }
  117.             Player player = (Player) sender;
  118.             player.openInventory(kits);
  119.             return true;
  120.  
  121.         }
  122.         return false;
  123.     }
  124.  
  125.     @EventHandler
  126.     public void onClick(InventoryClickEvent event) {
  127.         if (!event.getView().getTitle().contains("Kits"))
  128.             return;
  129.         if(event.getCurrentItem() == null)
  130.             return;
  131.         if(event.getCurrentItem().getItemMeta() == null)
  132.             return;
  133.  
  134.  
  135.  
  136.         Player player = (Player) event.getWhoClicked();
  137.         event.setCancelled(true);
  138.  
  139.         if(event.getClickedInventory().getType() == InventoryType.PLAYER)
  140.             return;
  141.  
  142.  
  143.  
  144.         if(event.getSlot() == 0) {
  145.             // Claim Kit
  146.             if (player.hasPermission("kits.claim")) {
  147.                 if (cooldowns.containsKey(player.getName())) {
  148.                     // player is inside hashmap
  149.                     if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
  150.                         // they still have time left in the cooldown
  151.                         long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 60000;
  152.                         player.closeInventory();
  153.                         player.sendMessage(ChatColor.GOLD + "Ability will be ready in " + timeleft + " minutes(s)");
  154.                     }
  155.                 } else {
  156.                     //drop chest
  157.                     this.dropChest(player, this.getClaimKit());
  158.                     player.closeInventory();
  159.                     player.updateInventory();
  160.                     return;
  161.                 }
  162.             }else{
  163.                 player.sendMessage("You do not have permission to use this kit!");
  164.                 player.closeInventory();
  165.             }
  166.  
  167.         }
  168.  
  169.         if(event.getSlot() == 1) {
  170.             // Daily Kit
  171.             if (player.hasPermission("kits.daily")) {
  172.                 if (cooldowns.containsKey(player.getName())) {
  173.                     // player is inside hashmap
  174.                     if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
  175.                         // they still have time left in the cooldown
  176.                         long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 60000;
  177.                         player.closeInventory();
  178.                         player.sendMessage(ChatColor.GOLD + "Ability will be ready in " + timeleft + " minutes(s)");
  179.                     }
  180.                 } else {
  181.                     //drop chest
  182.                     this.dropChest(player, this.getDailyKit());
  183.                     player.closeInventory();
  184.                     player.updateInventory();
  185.                     return;
  186.                 }
  187.             }else{
  188.                 player.sendMessage("You do not have permission to use this kit!");
  189.                 player.closeInventory();
  190.             }
  191.  
  192.         }
  193.  
  194.         if(event.getSlot() == 2) {
  195.             // Soldier Kit
  196.             if (player.hasPermission("kits.soldier")) {
  197.                 if (cooldowns.containsKey(player.getName())) {
  198.                     // player is inside hashmap
  199.                     if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
  200.                         // they still have time left in the cooldown
  201.                         long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 60000;
  202.                         player.closeInventory();
  203.                         player.sendMessage(ChatColor.GOLD + "Ability will be ready in " + timeleft + " minutes(s)");
  204.                     }
  205.                 } else {
  206.                     //drop chest
  207.                     this.dropChest(player, this.getSoldierKit());
  208.                     player.closeInventory();
  209.                     player.updateInventory();
  210.                     return;
  211.                 }
  212.             }else{
  213.                 player.sendMessage("You do not have permission to use this kit!");
  214.                 player.closeInventory();
  215.             }
  216.  
  217.         }
  218.  
  219.         if(event.getSlot() == 3) {
  220.             // Spy Kit
  221.             if (player.hasPermission("kits.spy")) {
  222.                 if (cooldowns.containsKey(player.getName())) {
  223.                     // player is inside hashmap
  224.                     if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
  225.                         // they still have time left in the cooldown
  226.                         long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 60000;
  227.                         player.closeInventory();
  228.                         player.sendMessage(ChatColor.GOLD + "Ability will be ready in " + timeleft + " minutes(s)");
  229.                     }
  230.                 } else {
  231.                     //drop chest
  232.                     this.dropChest(player, this.getSpyKit());
  233.                     player.closeInventory();
  234.                     player.updateInventory();
  235.                     return;
  236.                 }
  237.             }else{
  238.                 player.sendMessage("You do not have permission to use this kit!");
  239.                 player.closeInventory();
  240.             }
  241.  
  242.         }
  243.  
  244.         if(event.getSlot() == 4) {
  245.             // Assassin Kit
  246.             if (player.hasPermission("kits.assassin")) {
  247.                 if (cooldowns.containsKey(player.getName())) {
  248.                     // player is inside hashmap
  249.                     if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
  250.                         // they still have time left in the cooldown
  251.                         long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 60000;
  252.                         player.closeInventory();
  253.                         player.sendMessage(ChatColor.GOLD + "Ability will be ready in " + timeleft + " minutes(s)");
  254.                     }
  255.                 } else {
  256.                     //drop chest
  257.                     this.dropChest(player, this.getAssassinKit());
  258.                     player.closeInventory();
  259.                     player.updateInventory();
  260.                     return;
  261.                 }
  262.             }else{
  263.                 player.sendMessage("You do not have permission to use this kit!");
  264.                 player.closeInventory();
  265.             }
  266.  
  267.         }
  268.  
  269.         if(event.getSlot() == 5) {
  270.             // Captain Kit
  271.             if (player.hasPermission("kits.captain")) {
  272.                 if (cooldowns.containsKey(player.getName())) {
  273.                     // player is inside hashmap
  274.                     if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
  275.                         // they still have time left in the cooldown
  276.                         long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 60000;
  277.                         player.closeInventory();
  278.                         player.sendMessage(ChatColor.GOLD + "Ability will be ready in " + timeleft + " minutes(s)");
  279.                     }
  280.                 } else {
  281.                     //drop chest
  282.                     this.dropChest(player, this.getCaptainKit());
  283.                     player.closeInventory();
  284.                     player.updateInventory();
  285.                     return;
  286.                 }
  287.             }else{
  288.                 player.sendMessage("You do not have permission to use this kit!");
  289.                 player.closeInventory();
  290.             }
  291.  
  292.         }
  293.  
  294.         if(event.getSlot() == 6) {
  295.             // Legend Kit
  296.             if (player.hasPermission("kits.legend")) {
  297.                 if (cooldowns.containsKey(player.getName())) {
  298.                     // player is inside hashmap
  299.                     if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
  300.                         // they still have time left in the cooldown
  301.                         long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 60000;
  302.                         player.closeInventory();
  303.                         player.sendMessage(ChatColor.GOLD + "Ability will be ready in " + timeleft + " minutes(s)");
  304.                     }
  305.                 } else {
  306.                     //drop chest
  307.                     this.dropChest(player, this.getLegendKit());
  308.                     player.closeInventory();
  309.                     player.updateInventory();
  310.                     return;
  311.                 }
  312.             }else{
  313.                 player.sendMessage("You do not have permission to use this kit!");
  314.                 player.closeInventory();
  315.             }
  316.  
  317.         }
  318.  
  319.         if(event.getSlot() == 7) {
  320.             // Champion Kit
  321.             if (player.hasPermission("kits.champion")) {
  322.                 if (cooldowns.containsKey(player.getName())) {
  323.                     // player is inside hashmap
  324.                     if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
  325.                         // they still have time left in the cooldown
  326.                         long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 60000;
  327.                         player.closeInventory();
  328.                         player.sendMessage(ChatColor.GOLD + "Ability will be ready in " + timeleft + " minutes(s)");
  329.                     }
  330.                 } else {
  331.                     //drop chest
  332.                     this.dropChest(player, this.getChampionKit());
  333.                     player.closeInventory();
  334.                     player.updateInventory();
  335.                     return;
  336.                 }
  337.             }else{
  338.                 player.sendMessage("You do not have permission to use this kit!");
  339.                 player.closeInventory();
  340.             }
  341.  
  342.         }
  343.  
  344.         if(event.getSlot() == 8) {
  345.             // Titan Kit
  346.             if (player.hasPermission("kits.titan")) {
  347.                 if (cooldowns.containsKey(player.getName())) {
  348.                     // player is inside hashmap
  349.                     if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
  350.                         // they still have time left in the cooldown
  351.                         long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 60000;
  352.                         player.closeInventory();
  353.                         player.sendMessage(ChatColor.GOLD + "Ability will be ready in " + timeleft + " minutes(s)");
  354.                     }
  355.                 } else {
  356.                     //drop chest
  357.                     this.dropChest(player, this.getTitanKit());
  358.                     player.closeInventory();
  359.                     player.updateInventory();
  360.                     return;
  361.                 }
  362.             }else{
  363.                 player.sendMessage("You do not have permission to use this kit!");
  364.                 player.closeInventory();
  365.             }
  366.  
  367.         }
  368.     }
  369.  
  370.  
  371.  
  372.     private void dropChest(Player player, ItemStack[] items) {
  373.         Location chest = null;
  374.         if (player.getFacing() == BlockFace.NORTH)
  375.             chest = player.getLocation().add(0,0,-1);
  376.         if (player.getFacing() == BlockFace.SOUTH)
  377.             chest = player.getLocation().add(0,0,1);
  378.         if (player.getFacing() == BlockFace.EAST)
  379.             chest = player.getLocation().add(1,0,0);
  380.         if (player.getFacing() == BlockFace.WEST)
  381.             chest = player.getLocation().add(-1,0,0);
  382.  
  383.         if(chest.getBlock().getType() != Material.AIR) {
  384.             player.sendMessage(ChatColor.DARK_RED + "Can Not Open Kit Here!");
  385.             return;
  386.  
  387.  
  388.         }
  389.  
  390.         Block block = chest.getBlock();
  391.         block.setType(Material.CHEST);
  392.         Chest c = (Chest) block.getState();
  393.         c.getInventory().addItem(items);
  394.        
  395.  
  396.         cooldowns.put(player.getName(), System.currentTimeMillis() + (86400 * 1000));
  397.  
  398.  
  399.     }
  400.  
  401.     private ItemStack[] getClaimKit() {
  402.         ItemStack[] items = {new ItemStack(Material.GOLDEN_SHOVEL),
  403.         };
  404.         return items;
  405.     }
  406.  
  407.     private ItemStack[] getDailyKit() {
  408.         ItemStack[] items = {new ItemStack(Material.IRON_SWORD),
  409.                 new ItemStack(Material.IRON_PICKAXE),
  410.                 new ItemStack(Material.IRON_SHOVEL),
  411.                 new ItemStack(Material.IRON_AXE),
  412.                 new ItemStack(Material.IRON_HOE),
  413.                 new ItemStack(Material.IRON_CHESTPLATE),
  414.                 new ItemStack(Material.IRON_LEGGINGS),
  415.                 new ItemStack(Material.IRON_BOOTS),
  416.                 new ItemStack(Material.IRON_HELMET),
  417.                 new ItemStack(Material.COOKED_BEEF, 32),
  418.                 new ItemStack(Material.OAK_WOOD, 16),
  419.                 new ItemStack(Material.OBSIDIAN, 8),
  420.                 new ItemStack(Material.DIAMOND, 1),
  421.         };
  422.         return items;
  423.     }
  424.  
  425.     private ItemStack[] getSoldierKit() {
  426.         ItemStack[] items = {new ItemStack(Material.DIAMOND_SWORD),
  427.                 new ItemStack(Material.DIAMOND_PICKAXE),
  428.                 new ItemStack(Material.DIAMOND_SHOVEL),
  429.                 new ItemStack(Material.DIAMOND_AXE),
  430.                 new ItemStack(Material.DIAMOND_HOE),
  431.                 new ItemStack(Material.DIAMOND_HELMET),
  432.                 new ItemStack(Material.DIAMOND_CHESTPLATE),
  433.                 new ItemStack(Material.DIAMOND_LEGGINGS),
  434.                 new ItemStack(Material.DIAMOND_BOOTS),
  435.                 new ItemStack(Material.DIAMOND_HELMET),
  436.                 new ItemStack(Material.COOKED_BEEF, 16),
  437.                 new ItemStack(Material.DIAMOND, 3),
  438.         };
  439.         return items;
  440.     }
  441.  
  442.     private ItemStack[] getSpyKit() {
  443.         ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
  444.         ItemMeta meta = item.getItemMeta();
  445.         meta.addEnchant(Enchantment.DAMAGE_ALL, 1, false);
  446.         item.setItemMeta(meta);
  447.  
  448.         ItemStack item2 = new ItemStack(Material.DIAMOND_PICKAXE);
  449.         ItemMeta meta2 = item2.getItemMeta();
  450.         meta2.addEnchant(Enchantment.DIG_SPEED, 1, false);
  451.         item2.setItemMeta(meta2);
  452.  
  453.         ItemStack item3 = new ItemStack(Material.DIAMOND_SHOVEL);
  454.         ItemMeta meta3 = item3.getItemMeta();
  455.         meta3.addEnchant(Enchantment.DIG_SPEED, 1, false);
  456.         item3.setItemMeta(meta3);
  457.  
  458.         ItemStack item4 = new ItemStack(Material.DIAMOND_AXE);
  459.         ItemMeta meta4 = item4.getItemMeta();
  460.         meta4.addEnchant(Enchantment.DIG_SPEED, 1, false);
  461.         item4.setItemMeta(meta4);
  462.  
  463.         ItemStack item5 = new ItemStack(Material.DIAMOND_HOE);
  464.         ItemMeta meta5 = item5.getItemMeta();
  465.         meta5.addEnchant(Enchantment.DIG_SPEED, 1, false);
  466.         item5.setItemMeta(meta5);
  467.  
  468.         ItemStack item6 = new ItemStack(Material.DIAMOND_HELMET);
  469.         ItemMeta meta6 = item6.getItemMeta();
  470.         meta6.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  471.         item6.setItemMeta(meta6);
  472.  
  473.         ItemStack item7 = new ItemStack(Material.DIAMOND_CHESTPLATE);
  474.         ItemMeta meta7 = item7.getItemMeta();
  475.         meta7.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  476.         item7.setItemMeta(meta7);
  477.  
  478.         ItemStack item8 = new ItemStack(Material.DIAMOND_LEGGINGS);
  479.         ItemMeta meta8 = item8.getItemMeta();
  480.         meta8.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  481.         item8.setItemMeta(meta8);
  482.  
  483.         ItemStack item9 = new ItemStack(Material.DIAMOND_BOOTS);
  484.         ItemMeta meta9 = item9.getItemMeta();
  485.         meta9.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  486.         item9.setItemMeta(meta9);
  487.  
  488.         ItemStack item10 = new ItemStack(Material.COOKED_BEEF, 16);
  489.  
  490.         ItemStack item11 = new ItemStack(Material.DIAMOND, 4);
  491.  
  492.         ItemStack[] items = {item, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11};
  493.         return items;
  494.  
  495.     }
  496.  
  497.     private ItemStack[] getAssassinKit() {
  498.         ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
  499.         ItemMeta meta = item.getItemMeta();
  500.         meta.addEnchant(Enchantment.DAMAGE_ALL, 1, false);
  501.         item.setItemMeta(meta);
  502.  
  503.         ItemStack item2 = new ItemStack(Material.DIAMOND_PICKAXE);
  504.         ItemMeta meta2 = item2.getItemMeta();
  505.         meta2.addEnchant(Enchantment.DIG_SPEED, 1, false);
  506.         item2.setItemMeta(meta2);
  507.  
  508.         ItemStack item3 = new ItemStack(Material.DIAMOND_SHOVEL);
  509.         ItemMeta meta3 = item3.getItemMeta();
  510.         meta3.addEnchant(Enchantment.DIG_SPEED, 1, false);
  511.         item3.setItemMeta(meta3);
  512.  
  513.         ItemStack item4 = new ItemStack(Material.DIAMOND_AXE);
  514.         ItemMeta meta4 = item4.getItemMeta();
  515.         meta4.addEnchant(Enchantment.DIG_SPEED, 1, false);
  516.         item4.setItemMeta(meta4);
  517.  
  518.         ItemStack item5 = new ItemStack(Material.DIAMOND_HOE);
  519.         ItemMeta meta5 = item5.getItemMeta();
  520.         meta5.addEnchant(Enchantment.DIG_SPEED, 1, false);
  521.         item5.setItemMeta(meta5);
  522.  
  523.         ItemStack item6 = new ItemStack(Material.DIAMOND_HELMET);
  524.         ItemMeta meta6 = item6.getItemMeta();
  525.         meta6.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  526.         item6.setItemMeta(meta6);
  527.  
  528.         ItemStack item7 = new ItemStack(Material.DIAMOND_CHESTPLATE);
  529.         ItemMeta meta7 = item7.getItemMeta();
  530.         meta7.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  531.         item7.setItemMeta(meta7);
  532.  
  533.         ItemStack item8 = new ItemStack(Material.DIAMOND_LEGGINGS);
  534.         ItemMeta meta8 = item8.getItemMeta();
  535.         meta8.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  536.         item8.setItemMeta(meta8);
  537.  
  538.         ItemStack item9 = new ItemStack(Material.DIAMOND_BOOTS);
  539.         ItemMeta meta9 = item9.getItemMeta();
  540.         meta9.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  541.         item9.setItemMeta(meta9);
  542.  
  543.         ItemStack[] items = {item, item2, item3, item4, item5, item6, item7, item8, item9};
  544.         return items;
  545.  
  546.     }
  547.  
  548.     private ItemStack[] getCaptainKit() {
  549.         ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
  550.         ItemMeta meta = item.getItemMeta();
  551.         meta.addEnchant(Enchantment.DAMAGE_ALL, 1, false);
  552.         meta.addEnchant(Enchantment.DURABILITY, 1, false);
  553.         item.setItemMeta(meta);
  554.  
  555.         ItemStack item2 = new ItemStack(Material.DIAMOND_PICKAXE);
  556.         ItemMeta meta2 = item2.getItemMeta();
  557.         meta2.addEnchant(Enchantment.DIG_SPEED, 1, false);
  558.         item2.setItemMeta(meta2);
  559.  
  560.         ItemStack item3 = new ItemStack(Material.DIAMOND_SHOVEL);
  561.         ItemMeta meta3 = item3.getItemMeta();
  562.         meta3.addEnchant(Enchantment.DIG_SPEED, 1, false);
  563.         item3.setItemMeta(meta3);
  564.  
  565.         ItemStack item4 = new ItemStack(Material.DIAMOND_AXE);
  566.         ItemMeta meta4 = item4.getItemMeta();
  567.         meta4.addEnchant(Enchantment.DIG_SPEED, 1, false);
  568.         item4.setItemMeta(meta4);
  569.  
  570.         ItemStack item5 = new ItemStack(Material.DIAMOND_HOE);
  571.         ItemMeta meta5 = item5.getItemMeta();
  572.         meta5.addEnchant(Enchantment.DIG_SPEED, 1, false);
  573.         item5.setItemMeta(meta5);
  574.  
  575.         ItemStack item6 = new ItemStack(Material.DIAMOND_HELMET);
  576.         ItemMeta meta6 = item6.getItemMeta();
  577.         meta6.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  578.         item6.setItemMeta(meta6);
  579.  
  580.         ItemStack item7 = new ItemStack(Material.DIAMOND_CHESTPLATE);
  581.         ItemMeta meta7 = item7.getItemMeta();
  582.         meta7.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  583.         item7.setItemMeta(meta7);
  584.  
  585.         ItemStack item8 = new ItemStack(Material.DIAMOND_LEGGINGS);
  586.         ItemMeta meta8 = item8.getItemMeta();
  587.         meta8.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  588.         item8.setItemMeta(meta8);
  589.  
  590.         ItemStack item9 = new ItemStack(Material.DIAMOND_BOOTS);
  591.         ItemMeta meta9 = item9.getItemMeta();
  592.         meta9.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  593.         item9.setItemMeta(meta9);
  594.  
  595.         ItemStack[] items = {item, item2, item3, item4, item5, item6, item7, item8};
  596.         return items;
  597.     }
  598.  
  599.     private ItemStack[] getLegendKit() {
  600.         ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
  601.         ItemMeta meta = item.getItemMeta();
  602.         meta.addEnchant(Enchantment.DAMAGE_ALL, 1, false);
  603.         item.setItemMeta(meta);
  604.  
  605.         ItemStack item2 = new ItemStack(Material.DIAMOND_PICKAXE);
  606.         ItemMeta meta2 = item2.getItemMeta();
  607.         meta2.addEnchant(Enchantment.DIG_SPEED, 1, false);
  608.         item2.setItemMeta(meta2);
  609.  
  610.         ItemStack item3 = new ItemStack(Material.DIAMOND_SHOVEL);
  611.         ItemMeta meta3 = item3.getItemMeta();
  612.         meta3.addEnchant(Enchantment.DIG_SPEED, 1, false);
  613.         item3.setItemMeta(meta3);
  614.  
  615.         ItemStack item4 = new ItemStack(Material.DIAMOND_AXE);
  616.         ItemMeta meta4 = item4.getItemMeta();
  617.         meta4.addEnchant(Enchantment.DIG_SPEED, 1, false);
  618.         item4.setItemMeta(meta4);
  619.  
  620.         ItemStack item5 = new ItemStack(Material.DIAMOND_HOE);
  621.         ItemMeta meta5 = item5.getItemMeta();
  622.         meta5.addEnchant(Enchantment.DIG_SPEED, 1, false);
  623.         item5.setItemMeta(meta5);
  624.  
  625.         ItemStack item6 = new ItemStack(Material.DIAMOND_HELMET);
  626.         ItemMeta meta6 = item6.getItemMeta();
  627.         meta6.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  628.         item6.setItemMeta(meta6);
  629.  
  630.         ItemStack item7 = new ItemStack(Material.DIAMOND_CHESTPLATE);
  631.         ItemMeta meta7 = item7.getItemMeta();
  632.         meta7.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  633.         item7.setItemMeta(meta7);
  634.  
  635.         ItemStack item8 = new ItemStack(Material.DIAMOND_LEGGINGS);
  636.         ItemMeta meta8 = item8.getItemMeta();
  637.         meta8.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  638.         item8.setItemMeta(meta8);
  639.  
  640.         ItemStack item9 = new ItemStack(Material.DIAMOND_BOOTS);
  641.         ItemMeta meta9 = item9.getItemMeta();
  642.         meta9.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  643.         item9.setItemMeta(meta9);
  644.  
  645.         ItemStack[] items = {item, item2, item3, item4, item5, item6, item7, item8, item9};
  646.         return items;
  647.  
  648.     }
  649.  
  650.     private ItemStack[] getChampionKit() {
  651.         ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
  652.         ItemMeta meta = item.getItemMeta();
  653.         meta.addEnchant(Enchantment.DAMAGE_ALL, 1, false);
  654.         item.setItemMeta(meta);
  655.  
  656.         ItemStack item2 = new ItemStack(Material.DIAMOND_PICKAXE);
  657.         ItemMeta meta2 = item2.getItemMeta();
  658.         meta2.addEnchant(Enchantment.DIG_SPEED, 1, false);
  659.         item2.setItemMeta(meta2);
  660.  
  661.         ItemStack item3 = new ItemStack(Material.DIAMOND_SHOVEL);
  662.         ItemMeta meta3 = item3.getItemMeta();
  663.         meta3.addEnchant(Enchantment.DIG_SPEED, 1, false);
  664.         item3.setItemMeta(meta3);
  665.  
  666.         ItemStack item4 = new ItemStack(Material.DIAMOND_AXE);
  667.         ItemMeta meta4 = item4.getItemMeta();
  668.         meta4.addEnchant(Enchantment.DIG_SPEED, 1, false);
  669.         item4.setItemMeta(meta4);
  670.  
  671.         ItemStack item5 = new ItemStack(Material.DIAMOND_HOE);
  672.         ItemMeta meta5 = item5.getItemMeta();
  673.         meta5.addEnchant(Enchantment.DIG_SPEED, 1, false);
  674.         item5.setItemMeta(meta5);
  675.  
  676.         ItemStack item6 = new ItemStack(Material.DIAMOND_HELMET);
  677.         ItemMeta meta6 = item6.getItemMeta();
  678.         meta6.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  679.         item6.setItemMeta(meta6);
  680.  
  681.         ItemStack item7 = new ItemStack(Material.DIAMOND_CHESTPLATE);
  682.         ItemMeta meta7 = item7.getItemMeta();
  683.         meta7.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  684.         item7.setItemMeta(meta7);
  685.  
  686.         ItemStack item8 = new ItemStack(Material.DIAMOND_LEGGINGS);
  687.         ItemMeta meta8 = item8.getItemMeta();
  688.         meta8.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  689.         item8.setItemMeta(meta8);
  690.  
  691.         ItemStack item9 = new ItemStack(Material.DIAMOND_BOOTS);
  692.         ItemMeta meta9 = item9.getItemMeta();
  693.         meta9.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  694.         item9.setItemMeta(meta9);
  695.  
  696.         ItemStack[] items = {item, item2, item3, item4, item5, item6, item7, item8, item9};
  697.         return items;
  698.  
  699.     }
  700.  
  701.     private ItemStack[] getTitanKit() {
  702.         ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
  703.         ItemMeta meta = item.getItemMeta();
  704.         meta.addEnchant(Enchantment.DAMAGE_ALL, 1, false);
  705.         item.setItemMeta(meta);
  706.  
  707.         ItemStack item2 = new ItemStack(Material.DIAMOND_PICKAXE);
  708.         ItemMeta meta2 = item2.getItemMeta();
  709.         meta2.addEnchant(Enchantment.DIG_SPEED, 1, false);
  710.         item2.setItemMeta(meta2);
  711.  
  712.         ItemStack item3 = new ItemStack(Material.DIAMOND_SHOVEL);
  713.         ItemMeta meta3 = item3.getItemMeta();
  714.         meta3.addEnchant(Enchantment.DIG_SPEED, 1, false);
  715.         item3.setItemMeta(meta3);
  716.  
  717.         ItemStack item4 = new ItemStack(Material.DIAMOND_AXE);
  718.         ItemMeta meta4 = item4.getItemMeta();
  719.         meta4.addEnchant(Enchantment.DIG_SPEED, 1, false);
  720.         item4.setItemMeta(meta4);
  721.  
  722.         ItemStack item5 = new ItemStack(Material.DIAMOND_HOE);
  723.         ItemMeta meta5 = item5.getItemMeta();
  724.         meta5.addEnchant(Enchantment.DIG_SPEED, 1, false);
  725.         item5.setItemMeta(meta5);
  726.  
  727.         ItemStack item6 = new ItemStack(Material.DIAMOND_HELMET);
  728.         ItemMeta meta6 = item6.getItemMeta();
  729.         meta6.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  730.         item6.setItemMeta(meta6);
  731.  
  732.         ItemStack item7 = new ItemStack(Material.DIAMOND_CHESTPLATE);
  733.         ItemMeta meta7 = item7.getItemMeta();
  734.         meta7.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  735.         item7.setItemMeta(meta7);
  736.  
  737.         ItemStack item8 = new ItemStack(Material.DIAMOND_LEGGINGS);
  738.         ItemMeta meta8 = item8.getItemMeta();
  739.         meta8.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  740.         item8.setItemMeta(meta8);
  741.  
  742.         ItemStack item9 = new ItemStack(Material.DIAMOND_BOOTS);
  743.         ItemMeta meta9 = item9.getItemMeta();
  744.         meta9.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
  745.         item9.setItemMeta(meta9);
  746.  
  747.         ItemStack[] items = {item, item2, item3, item4, item5, item6, item7, item8, item9};
  748.         return items;
  749.     }}
Advertisement
Add Comment
Please, Sign In to add comment