From 4c441dacfcd24a32909f7db02642be30d6321aff Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 10 Nov 2020 18:40:07 +0000 Subject: [PATCH] Fixed duplication glitch --- .../enchantments/support/merging/anvil/AnvilListeners.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilListeners.java b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilListeners.java index deb1310a..0ce5444d 100644 --- a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilListeners.java +++ b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilListeners.java @@ -44,14 +44,14 @@ public class AnvilListeners implements Listener { modCost = newOut.getSecond(); } - if(!newOut.getFirst().getType().equals(left.getType())) return; // sketchy hotfix - new EcoBukkitRunnable(player.getTicksLived()) { @Override public void onRun() { int preCost = event.getInventory().getRepairCost(); ItemStack item = newOut.getFirst(); + if(!event.getInventory().getItem(0).getType().equals(item.getType())) return; + if(ConfigManager.getConfig().getBool("anvil.rework-cost")) { int repairCost = RepairCost.getRepairCost(item); int reworkCount = NumberUtils.log2(repairCost + 1);