From 9610958e28499dabd1c1b7deefa312425870c72f Mon Sep 17 00:00:00 2001 From: Pim van der Loos Date: Thu, 7 Sep 2017 13:43:58 +0200 Subject: [PATCH] - Removed support for combining armored elytras with enchanted books. It was too buggy. --- .../nl/pim16aap2/armoredElytra/EventHandlers.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/main/java/nl/pim16aap2/armoredElytra/EventHandlers.java b/src/main/java/nl/pim16aap2/armoredElytra/EventHandlers.java index 499883d..77c4b87 100644 --- a/src/main/java/nl/pim16aap2/armoredElytra/EventHandlers.java +++ b/src/main/java/nl/pim16aap2/armoredElytra/EventHandlers.java @@ -176,8 +176,7 @@ public class EventHandlers implements Listener { if (anvilInventory.getItem(0).getType() == Material.ELYTRA) { ItemStack result = null; // Check if the second input slot contains a diamond chestplate. - if (anvilInventory.getItem(1).getType() == Material.DIAMOND_CHESTPLATE || - (anvilInventory.getItem(1).getType() == Material.ENCHANTED_BOOK && isArmoredElytra(anvilInventory.getItem(0)))) { + if (anvilInventory.getItem(1).getType() == Material.DIAMOND_CHESTPLATE) { // Combine the enchantments of the two items in the input slots. result = addEnchants(anvilInventory.getItem(0), anvilInventory.getItem(1), p); if (anvilInventory.getItem(1).getType() == Material.DIAMOND_CHESTPLATE) { @@ -198,7 +197,7 @@ public class EventHandlers implements Listener { } // Put the created item in the second slot of the anvil. if (result!=null) { - if (anvilInventory.getItem(1).getType() == Material.DIAMOND_CHESTPLATE/* || isArmoredElytra(anvilInventory.getItem(0))*/) { + if (anvilInventory.getItem(1).getType() == Material.DIAMOND_CHESTPLATE) { ItemMeta itemmeta = result.getItemMeta(); itemmeta.setDisplayName(ChatColor.AQUA+"Armored Elytra"); itemmeta.setLore(Arrays.asList("This is an armored Elytra.")); @@ -230,16 +229,6 @@ public class EventHandlers implements Listener { anvilInventory.setItem(2, result); } } - // Super ugly way of making sure that when applying enchantments from an enchanted book to an elytra, the result has a higher chance of showing up. - if (anvilInventory.getItem(1).getType() == Material.ENCHANTED_BOOK) { - p.updateInventory(); - p.updateInventory(); - p.updateInventory(); - p.updateInventory(); - p.updateInventory(); - p.updateInventory(); - p.sendMessage(ChatColor.GREEN+"Combining enchanted books with elytras IS possible, but sometimes you have to remove the book and put it back a few times."); - } } p.updateInventory(); }