From b69954c4c59a39d7ebab876a8956d7dc9c8f014e Mon Sep 17 00:00:00 2001 From: pahimar Date: Mon, 23 Dec 2013 08:47:37 -0500 Subject: [PATCH] Just some more quick work before going out yet again for Christmas --- .../java/com/pahimar/ee3/recipe/CalcinationManager.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/pahimar/ee3/recipe/CalcinationManager.java b/src/main/java/com/pahimar/ee3/recipe/CalcinationManager.java index 29e51db4..a6d3b697 100644 --- a/src/main/java/com/pahimar/ee3/recipe/CalcinationManager.java +++ b/src/main/java/com/pahimar/ee3/recipe/CalcinationManager.java @@ -24,6 +24,7 @@ public class CalcinationManager public static List getCalcinationResult(ItemStack calcinedStack) { ItemStack itemStack = calcinedStack.copy(); + itemStack.stackSize = 1; List calcinationResults = new ArrayList(); TreeMap sortedItems = new TreeMap(); @@ -45,15 +46,13 @@ public class CalcinationManager { sortedItems.put(EmcRegistry.getInstance().getEmcValue(itemStack), itemStack); - TreeMap lessThanMap = new TreeMap(sortedItems.headMap(EmcRegistry.getInstance().getEmcValue(itemStack))); - - if (lessThanMap.size() == 0) + if (sortedItems.lowerEntry(EmcRegistry.getInstance().getEmcValue(itemStack)) == null) { calcinationResults.add(new ItemStack(ModItems.alchemicalDust, 1, 0)); } else { - calcinationResults.add(lessThanMap.lastEntry().getValue()); + calcinationResults.add(sortedItems.lowerEntry(EmcRegistry.getInstance().getEmcValue(itemStack)).getValue()); } } }