Fix Metallurgic Infuser JEI category being messed up when viewing all recipes

This commit is contained in:
pupnewfster authored and Dave Smith committed 2019-03-07 22:16:49 -07:00
1 parent af839e7026
commit 937bb92f23
2 files changed
+11 -22

No files matched your search

@@ -12,7 +12,6 @@ import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
@@ -22,11 +21,9 @@ import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -34,9 +31,6 @@ import java.util.Map;
public class MetallurgicInfuserRecipeCategory extends BaseRecipeCategory
{
private final IDrawable background;
@Nullable
private MetallurgicInfuserRecipe tempRecipe;
public MetallurgicInfuserRecipeCategory(IGuiHelper helper)
{
@@ -87,21 +81,6 @@ public class MetallurgicInfuserRecipeCategory extends BaseRecipeCategory
return ret;
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
if(tempRecipe == null)
{
return;
}
InfuseType type = tempRecipe.getInput().infuse.type;
changeTexture(MekanismRenderer.getBlocksTexture());
drawTexturedRectFromIcon(2, 2, type.sprite, 4, 52);
}
@Override
public IDrawable getBackground()
{
@@ -116,7 +95,7 @@ public class MetallurgicInfuserRecipeCategory extends BaseRecipeCategory
return;
}
tempRecipe = ((MetallurgicInfuserRecipeWrapper)recipeWrapper).getRecipe();
MetallurgicInfuserRecipe tempRecipe = ((MetallurgicInfuserRecipeWrapper)recipeWrapper).getRecipe();
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
@@ -1,8 +1,10 @@
package mekanism.client.jei.machine.other;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import java.util.Arrays;
@@ -33,4 +35,12 @@ public class MetallurgicInfuserRecipeWrapper implements IRecipeWrapper
{
return recipe;
}
@Override
public void drawInfo(Minecraft mc, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
if (mc.currentScreen != null) {
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
mc.currentScreen.drawTexturedModalRect(2, 2, recipe.getInput().infuse.type.sprite, 4, 52);
}
}
}