Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. @EventHandler
  2. public void onDeath(PlayerDeathEvent e) {
  3. if(FileManager.getCfg().getBoolean("config.removerespawnkitondeath") == true) {
  4. for(ItemStack i : e.getDrops()) {
  5. if(check(i)) e.getDrops().remove(i);
  6. }
  7. }
  8. }
  9.  
  10. public boolean check(ItemStack i) {
  11. List<ItemStack> itemstacki = new ArrayList<ItemStack>();
  12. itemstacki.add(new ItemStack(Material.IRON_HELMET, 1));
  13. itemstacki.add(new ItemStack(Material.IRON_CHESTPLATE, 1));
  14. itemstacki.add(new ItemStack(Material.IRON_LEGGINGS, 1));
  15. itemstacki.add(new ItemStack(Material.IRON_BOOTS, 1));
  16. ItemStack bow = new ItemStack(Material.BOW, 1);
  17. ItemStack beef = new ItemStack(Material.COOKED_BEEF, 1);
  18. ItemMeta bowmeta = bow.getItemMeta();
  19. ItemMeta beefmeta = beef.getItemMeta();
  20. beefmeta.addEnchant(Enchantment.MENDING, 1, true);
  21. beefmeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
  22. beef.setItemMeta(beefmeta);
  23. bowmeta.addEnchant(Enchantment.ARROW_INFINITE, 10, true);
  24. bowmeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
  25. bow.setItemMeta(bowmeta);
  26. itemstacki.add(bow);
  27. itemstacki.add(beef);
  28. itemstacki.add(new ItemStack(Material.ARROW, 1));
  29. ItemStack is = i.clone();
  30. is.setDurability(i.getType().getMaxDurability());
  31. if(itemstacki.contains(is)) return true;
  32. else return false;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement