diff --git a/ee3_common/com/pahimar/ee3/core/handlers/EquivalencyHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/EquivalencyHandler.java index 14257ae2..fe3e62d3 100644 --- a/ee3_common/com/pahimar/ee3/core/handlers/EquivalencyHandler.java +++ b/ee3_common/com/pahimar/ee3/core/handlers/EquivalencyHandler.java @@ -233,6 +233,28 @@ public class EquivalencyHandler { return false; } } + + /* Ignores stack size for world transmutation */ + public boolean areWorldEquivalent(Object obj1, Object obj2) { + + ItemStack first = GeneralHelper.convertObjectToItemStack(obj1); + if(first == null) return false; + ItemStack second = GeneralHelper.convertObjectToItemStack(obj1); + if(second == null) return false; + + if ((getEquivalencyList(first.itemID, first.getItemDamage()) != null) && (getEquivalencyList(second.itemID, second.getItemDamage()) != null)) { + if ((first.itemID == second.itemID) && (first.getItemDamage() == second.getItemDamage())) { + return true; + } + else { + return (getEquivalencyList(first.itemID, first.getItemDamage()).equals(getEquivalencyList(second.itemID, second.getItemDamage()))); + } + } + else { + return false; + } + } + public void debug() { diff --git a/ee3_common/com/pahimar/ee3/core/handlers/WorldTransmutationHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/WorldTransmutationHandler.java index e41ed441..9d1943a8 100644 --- a/ee3_common/com/pahimar/ee3/core/handlers/WorldTransmutationHandler.java +++ b/ee3_common/com/pahimar/ee3/core/handlers/WorldTransmutationHandler.java @@ -128,7 +128,7 @@ public class WorldTransmutationHandler { ItemStack targetStack = new ItemStack(event.targetID, 1, event.targetMeta); if (!worldStack.isItemEqual(targetStack)) { - if (EquivalencyHandler.instance().areEquivalent(worldStack, targetStack)) { + if (EquivalencyHandler.instance().areWorldEquivalent(worldStack, targetStack)) { if (event.itemStack.getItemDamage() < event.itemStack.getMaxDamage()) { result = TransmutationHelper.transmuteInWorld(event.world, event.player, event.player.getCurrentEquippedItem(), event.x, event.y, event.z, event.targetID, event.targetMeta); }