From 66b2cfcfc0d0a60244d453c31abdcd6cb92f72ae Mon Sep 17 00:00:00 2001 From: pahimar Date: Mon, 30 Dec 2013 22:58:17 -0500 Subject: [PATCH] Taking this to extremes to test this damned NEI + EE3 "bug" --- .../handler/ItemTooltipEventHandler.java | 23 +++++++++++-------- .../java/com/pahimar/ee3/emc/EmcRegistry.java | 2 +- .../pahimar/ee3/imc/InterModCommsHandler.java | 2 +- .../ee3/item/crafting/RecipeRegistry.java | 3 --- .../ee3/item/crafting/RecipesVanilla.java | 2 -- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/pahimar/ee3/client/handler/ItemTooltipEventHandler.java b/src/main/java/com/pahimar/ee3/client/handler/ItemTooltipEventHandler.java index 41979019..33f8f63f 100644 --- a/src/main/java/com/pahimar/ee3/client/handler/ItemTooltipEventHandler.java +++ b/src/main/java/com/pahimar/ee3/client/handler/ItemTooltipEventHandler.java @@ -27,22 +27,25 @@ public class ItemTooltipEventHandler @ForgeSubscribe public void handleItemTooltipEvent(ItemTooltipEvent event) { - WrappedStack stack = new WrappedStack(event.itemStack); - - if (EmcRegistry.getInstance().hasEmcValue(stack)) + if (debug) { - EmcValue emcValue = EmcRegistry.getInstance().getEmcValue(stack); + WrappedStack stack = new WrappedStack(event.itemStack); - event.toolTip.add(""); - if (emcValue != null && debug) + if (EmcRegistry.getInstance().hasEmcValue(stack)) { - event.toolTip.add("EMC: " + String.format("%s", emcDecimalFormat.format(stack.getStackSize() * emcValue.getValue()))); + EmcValue emcValue = EmcRegistry.getInstance().getEmcValue(stack); - for (EmcType emcType : EmcType.TYPES) + event.toolTip.add(""); + if (emcValue != null) { - if (emcValue.components[emcType.ordinal()] > 0) + event.toolTip.add("EMC: " + String.format("%s", emcDecimalFormat.format(stack.getStackSize() * emcValue.getValue()))); + + for (EmcType emcType : EmcType.TYPES) { - event.toolTip.add(" * " + emcType + ": " + String.format("%s", emcDecimalFormat.format(stack.getStackSize() * emcValue.components[emcType.ordinal()]))); + if (emcValue.components[emcType.ordinal()] > 0) + { + event.toolTip.add(" * " + emcType + ": " + String.format("%s", emcDecimalFormat.format(stack.getStackSize() * emcValue.components[emcType.ordinal()]))); + } } } } diff --git a/src/main/java/com/pahimar/ee3/emc/EmcRegistry.java b/src/main/java/com/pahimar/ee3/emc/EmcRegistry.java index 1863acde..54aaf73a 100644 --- a/src/main/java/com/pahimar/ee3/emc/EmcRegistry.java +++ b/src/main/java/com/pahimar/ee3/emc/EmcRegistry.java @@ -27,7 +27,7 @@ public class EmcRegistry if (emcRegistry == null) { emcRegistry = new EmcRegistry(); - emcRegistry.init(); + //emcRegistry.init(); } return emcRegistry; diff --git a/src/main/java/com/pahimar/ee3/imc/InterModCommsHandler.java b/src/main/java/com/pahimar/ee3/imc/InterModCommsHandler.java index 82b49796..87ce37c8 100644 --- a/src/main/java/com/pahimar/ee3/imc/InterModCommsHandler.java +++ b/src/main/java/com/pahimar/ee3/imc/InterModCommsHandler.java @@ -278,6 +278,6 @@ public class InterModCommsHandler implements ITickHandler, IScheduledTickHandler public int nextTickSpacing() { - return 10; + return 20; } } diff --git a/src/main/java/com/pahimar/ee3/item/crafting/RecipeRegistry.java b/src/main/java/com/pahimar/ee3/item/crafting/RecipeRegistry.java index be2326f8..0b69a701 100644 --- a/src/main/java/com/pahimar/ee3/item/crafting/RecipeRegistry.java +++ b/src/main/java/com/pahimar/ee3/item/crafting/RecipeRegistry.java @@ -18,7 +18,6 @@ public class RecipeRegistry private RecipeRegistry() { - recipeMap = HashMultimap.create(); discoveredStacks = new ArrayList(); @@ -27,7 +26,6 @@ public class RecipeRegistry public static RecipeRegistry getInstance() { - if (recipeRegistry == null) { recipeRegistry = new RecipeRegistry(); @@ -104,7 +102,6 @@ public class RecipeRegistry private void discoverStacks() { - discoveredStacks = new ArrayList(); // Scan stacks from known recipes diff --git a/src/main/java/com/pahimar/ee3/item/crafting/RecipesVanilla.java b/src/main/java/com/pahimar/ee3/item/crafting/RecipesVanilla.java index 441675e0..910be69f 100644 --- a/src/main/java/com/pahimar/ee3/item/crafting/RecipesVanilla.java +++ b/src/main/java/com/pahimar/ee3/item/crafting/RecipesVanilla.java @@ -17,12 +17,10 @@ import java.util.List; public class RecipesVanilla { - private static Multimap> vanillaRecipes = null; public static Multimap> getVanillaRecipes() { - if (vanillaRecipes == null) { init();