diff --git a/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java b/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java index e484e4428..dfcbb55b6 100644 --- a/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java +++ b/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java @@ -1,6 +1,11 @@ package mekanism.client.nei; +import static codechicken.core.gui.GuiDraw.changeTexture; +import static codechicken.core.gui.GuiDraw.drawTexturedModalRect; + import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -19,7 +24,6 @@ import org.lwjgl.opengl.GL11; import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; -import static codechicken.core.gui.GuiDraw.*; public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler { @@ -54,17 +58,19 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler return "mekanism.infuser"; } - public ItemStack getInfuseStack(InfuseType type) + public List getInfuseStacks(InfuseType type) { + List ret = new ArrayList(); + for(Map.Entry obj : InfuseRegistry.getObjectMap().entrySet()) { if(obj.getValue().type == type) { - return obj.getKey(); + ret.add(obj.getKey()); } } - return null; + return ret; } public Set> getRecipes() @@ -119,7 +125,7 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler { for(Map.Entry irecipe : getRecipes()) { - arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); + arecipes.add(new CachedIORecipe(irecipe, getInfuseStacks(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); } } else { @@ -140,7 +146,7 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler { if(NEIServerUtils.areStacksSameTypeCrafting(((InfusionOutput)irecipe.getValue()).resource, result)) { - arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); + arecipes.add(new CachedIORecipe(irecipe, getInfuseStacks(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); } } } @@ -152,16 +158,17 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler { if(NEIServerUtils.areStacksSameTypeCrafting(((InfusionInput)irecipe.getKey()).inputStack, ingredient)) { - arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); + arecipes.add(new CachedIORecipe(irecipe, getInfuseStacks(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); } } } public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { + public List infuseStacks; + public PositionedStack inputStack; public PositionedStack outputStack; - public PositionedStack infuseStack; public InfuseType infusionType; @@ -180,27 +187,24 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler @Override public PositionedStack getOtherStack() { - return infuseStack; + return new PositionedStack(infuseStacks.get(cycleticks/40 % infuseStacks.size()), 12, 20); } - public CachedIORecipe(ItemStack input, ItemStack output, ItemStack infuse, InfuseType type) + public CachedIORecipe(ItemStack input, ItemStack output, List infuses, InfuseType type) { super(); inputStack = new PositionedStack(input, 46, 28); outputStack = new PositionedStack(output, 104, 28); - if(infuse != null) - { - infuseStack = new PositionedStack(infuse, 12, 20); - } + infuseStacks = infuses; infusionType = type; } - public CachedIORecipe(Map.Entry recipe, ItemStack infuse, InfuseType type) + public CachedIORecipe(Map.Entry recipe, List infuses, InfuseType type) { - this(((InfusionInput)recipe.getKey()).inputStack, ((InfusionOutput)recipe.getValue()).resource, infuse, type); + this(((InfusionInput)recipe.getKey()).inputStack, ((InfusionOutput)recipe.getValue()).resource, infuses, type); } } }