Taking this to extremes to test this damned NEI + EE3 "bug"

This commit is contained in:
pahimar 2013-12-30 22:58:17 -05:00
parent f9ef8c92bc
commit 66b2cfcfc0
5 changed files with 15 additions and 17 deletions

View file

@ -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()])));
}
}
}
}

View file

@ -27,7 +27,7 @@ public class EmcRegistry
if (emcRegistry == null)
{
emcRegistry = new EmcRegistry();
emcRegistry.init();
//emcRegistry.init();
}
return emcRegistry;

View file

@ -278,6 +278,6 @@ public class InterModCommsHandler implements ITickHandler, IScheduledTickHandler
public int nextTickSpacing()
{
return 10;
return 20;
}
}

View file

@ -18,7 +18,6 @@ public class RecipeRegistry
private RecipeRegistry()
{
recipeMap = HashMultimap.create();
discoveredStacks = new ArrayList<WrappedStack>();
@ -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<WrappedStack>();
// Scan stacks from known recipes

View file

@ -17,12 +17,10 @@ import java.util.List;
public class RecipesVanilla
{
private static Multimap<WrappedStack, List<WrappedStack>> vanillaRecipes = null;
public static Multimap<WrappedStack, List<WrappedStack>> getVanillaRecipes()
{
if (vanillaRecipes == null)
{
init();