diff --git a/src/main/java/mekanism/client/jei/GasStackHelper.java b/src/main/java/mekanism/client/jei/GasStackHelper.java index fb8c073bc..319a705b4 100644 --- a/src/main/java/mekanism/client/jei/GasStackHelper.java +++ b/src/main/java/mekanism/client/jei/GasStackHelper.java @@ -8,7 +8,6 @@ import javax.annotation.Nullable; import mekanism.api.gas.Gas; import mekanism.api.gas.GasStack; import mezz.jei.api.ingredients.IIngredientHelper; -import net.minecraft.item.ItemStack; public class GasStackHelper implements IIngredientHelper { @@ -59,11 +58,6 @@ public class GasStackHelper implements IIngredientHelper { return ingredient.getGas().getTranslationKey(); } - @Override - public ItemStack cheatIngredient(GasStack ingredient, boolean fullStack) { - return ItemStack.EMPTY; - } - @Override public GasStack copyIngredient(GasStack ingredient) { return ingredient.copy(); diff --git a/src/main/java/mekanism/client/jei/MekanismJEI.java b/src/main/java/mekanism/client/jei/MekanismJEI.java index 3ee6e598d..eb506537e 100644 --- a/src/main/java/mekanism/client/jei/MekanismJEI.java +++ b/src/main/java/mekanism/client/jei/MekanismJEI.java @@ -109,6 +109,7 @@ import mezz.jei.api.ISubtypeRegistry; import mezz.jei.api.ISubtypeRegistry.ISubtypeInterpreter; import mezz.jei.api.JEIPlugin; import mezz.jei.api.ingredients.IModIngredientRegistration; +import mezz.jei.api.recipe.IIngredientType; import mezz.jei.api.recipe.IRecipeCategoryRegistration; import mezz.jei.api.recipe.IRecipeWrapper; import mezz.jei.api.recipe.VanillaRecipeCategoryUid; @@ -121,6 +122,8 @@ import net.minecraftforge.fml.common.Loader; @JEIPlugin public class MekanismJEI implements IModPlugin { + public static final IIngredientType TYPE_GAS = () -> GasStack.class; + public static final ISubtypeInterpreter NBT_INTERPRETER = itemStack -> { String ret = Integer.toString(itemStack.getMetadata()); @@ -166,7 +169,7 @@ public class MekanismJEI implements IModPlugin { public void registerIngredients(IModIngredientRegistration registry) { List list = GasRegistry.getRegisteredGasses().stream().filter(Gas::isVisible) .map(g -> new GasStack(g, Fluid.BUCKET_VOLUME)).collect(Collectors.toList()); - registry.register(GasStack.class, list, new GasStackHelper(), GAS_RENDERER); + registry.register(MekanismJEI.TYPE_GAS, list, new GasStackHelper(), GAS_RENDERER); } @Override diff --git a/src/main/java/mekanism/client/jei/machine/AdvancedMachineRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/AdvancedMachineRecipeCategory.java index dacce4083..b51766b5a 100644 --- a/src/main/java/mekanism/client/jei/machine/AdvancedMachineRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/AdvancedMachineRecipeCategory.java @@ -10,6 +10,7 @@ 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.jei.MekanismJEI; import mekanism.common.recipe.inputs.AdvancedMachineInput; import mekanism.common.recipe.machines.AdvancedMachineRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -89,7 +90,7 @@ public class AdvancedMachineRecipeCategory extends BaseRecipeCategory { itemStacks.set(1, ((ItemStackOutput) tempRecipe.recipeOutput).output); itemStacks.set(2, ((AdvancedMachineRecipeWrapper) recipeWrapper).getFuelStacks(input.gasType)); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); initGas(gasStacks, 0, true, 33, 21, 6, 12, new GasStack(input.gasType, TileEntityAdvancedElectricMachine.BASE_TICKS_REQUIRED diff --git a/src/main/java/mekanism/client/jei/machine/AdvancedMachineRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/AdvancedMachineRecipeWrapper.java index 6e3439ac3..13588729d 100644 --- a/src/main/java/mekanism/client/jei/machine/AdvancedMachineRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/AdvancedMachineRecipeWrapper.java @@ -3,12 +3,14 @@ package mekanism.client.jei.machine; import java.util.List; import mekanism.api.gas.Gas; import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.inputs.AdvancedMachineInput; import mekanism.common.recipe.machines.AdvancedMachineRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; import mekanism.common.tile.prefab.TileEntityAdvancedElectricMachine; import mekanism.common.util.GasUtils; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.item.ItemStack; @@ -22,11 +24,11 @@ public class AdvancedMachineRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(ItemStack.class, ((AdvancedMachineInput) recipe.getInput()).itemStack); - ingredients.setInput(GasStack.class, new GasStack(((AdvancedMachineInput) recipe.getInput()).gasType, + ingredients.setInput(VanillaTypes.ITEM, ((AdvancedMachineInput) recipe.getInput()).itemStack); + ingredients.setInput(MekanismJEI.TYPE_GAS, new GasStack(((AdvancedMachineInput) recipe.getInput()).gasType, TileEntityAdvancedElectricMachine.BASE_TICKS_REQUIRED * TileEntityAdvancedElectricMachine.BASE_GAS_PER_TICK)); - ingredients.setOutput(ItemStack.class, ((ItemStackOutput) recipe.getOutput()).output); + ingredients.setOutput(VanillaTypes.ITEM, ((ItemStackOutput) recipe.getOutput()).output); } public List getFuelStacks(Gas gasType) { diff --git a/src/main/java/mekanism/client/jei/machine/ChanceMachineRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/ChanceMachineRecipeCategory.java index ad24a01f5..28cb08ea1 100644 --- a/src/main/java/mekanism/client/jei/machine/ChanceMachineRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/ChanceMachineRecipeCategory.java @@ -1,6 +1,5 @@ package mekanism.client.jei.machine; -import javax.annotation.Nullable; import mekanism.client.gui.element.GuiPowerBar; import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler; import mekanism.client.gui.element.GuiProgress; @@ -27,9 +26,6 @@ public class ChanceMachineRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private ChanceMachineRecipe tempRecipe; - public ChanceMachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress) { super(helper, "mekanism:gui/GuiBasicMachine.png", name, unlocalized, progress); @@ -73,7 +69,7 @@ public class ChanceMachineRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((ChanceMachineRecipeWrapper) recipeWrapper).getRecipe(); + ChanceMachineRecipe tempRecipe = ((ChanceMachineRecipeWrapper) recipeWrapper).getRecipe(); IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks(); diff --git a/src/main/java/mekanism/client/jei/machine/ChanceMachineRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/ChanceMachineRecipeWrapper.java index 735485184..054a48245 100644 --- a/src/main/java/mekanism/client/jei/machine/ChanceMachineRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/ChanceMachineRecipeWrapper.java @@ -6,10 +6,10 @@ import mekanism.common.recipe.inputs.ItemStackInput; import mekanism.common.recipe.machines.ChanceMachineRecipe; import mekanism.common.recipe.outputs.ChanceOutput; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.item.ItemStack; public class ChanceMachineRecipeWrapper implements IRecipeWrapper { @@ -22,8 +22,8 @@ public class ChanceMachineRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { ChanceOutput output = (ChanceOutput) recipe.getOutput(); - ingredients.setInput(ItemStack.class, ((ItemStackInput) recipe.getInput()).ingredient); - ingredients.setOutputs(ItemStack.class, Arrays.asList(output.primaryOutput, output.secondaryOutput)); + ingredients.setInput(VanillaTypes.ITEM, ((ItemStackInput) recipe.getInput()).ingredient); + ingredients.setOutputs(VanillaTypes.ITEM, Arrays.asList(output.primaryOutput, output.secondaryOutput)); } @Override diff --git a/src/main/java/mekanism/client/jei/machine/DoubleMachineRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/DoubleMachineRecipeCategory.java index 1c3cc0656..c241bb8c1 100644 --- a/src/main/java/mekanism/client/jei/machine/DoubleMachineRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/DoubleMachineRecipeCategory.java @@ -1,6 +1,5 @@ package mekanism.client.jei.machine; -import javax.annotation.Nullable; import mekanism.client.gui.element.GuiPowerBar; import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler; import mekanism.client.gui.element.GuiProgress; @@ -27,9 +26,6 @@ public class DoubleMachineRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private DoubleMachineRecipe tempRecipe; - public DoubleMachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress) { super(helper, "mekanism:gui/guibasicmachine.png", name, unlocalized, progress); @@ -76,7 +72,7 @@ public class DoubleMachineRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((DoubleMachineRecipeWrapper) recipeWrapper).getRecipe(); + DoubleMachineRecipe tempRecipe = ((DoubleMachineRecipeWrapper) recipeWrapper).getRecipe(); DoubleMachineInput input = (DoubleMachineInput) tempRecipe.recipeInput; diff --git a/src/main/java/mekanism/client/jei/machine/DoubleMachineRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/DoubleMachineRecipeWrapper.java index 78ffee715..6d26c4111 100644 --- a/src/main/java/mekanism/client/jei/machine/DoubleMachineRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/DoubleMachineRecipeWrapper.java @@ -5,8 +5,8 @@ import mekanism.common.recipe.inputs.DoubleMachineInput; import mekanism.common.recipe.machines.DoubleMachineRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; -import net.minecraft.item.ItemStack; public class DoubleMachineRecipeWrapper implements IRecipeWrapper { @@ -19,8 +19,8 @@ public class DoubleMachineRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { DoubleMachineInput input = (DoubleMachineInput) recipe.getInput(); - ingredients.setInputs(ItemStack.class, Arrays.asList(input.itemStack, input.extraStack)); - ingredients.setOutput(ItemStack.class, ((ItemStackOutput) recipe.getOutput()).output); + ingredients.setInputs(VanillaTypes.ITEM, Arrays.asList(input.itemStack, input.extraStack)); + ingredients.setOutput(VanillaTypes.ITEM, ((ItemStackOutput) recipe.getOutput()).output); } public DoubleMachineRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/MachineRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/MachineRecipeCategory.java index b5d2b73f3..8d3a4f9f1 100644 --- a/src/main/java/mekanism/client/jei/machine/MachineRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/MachineRecipeCategory.java @@ -1,6 +1,5 @@ package mekanism.client.jei.machine; -import javax.annotation.Nullable; import mekanism.client.gui.element.GuiPowerBar; import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler; import mekanism.client.gui.element.GuiProgress; @@ -25,9 +24,6 @@ public class MachineRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private BasicMachineRecipe tempRecipe; - public MachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress) { super(helper, "mekanism:gui/GuiBasicMachine.png", name, unlocalized, progress); @@ -71,7 +67,7 @@ public class MachineRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((MachineRecipeWrapper) recipeWrapper).getRecipe(); + BasicMachineRecipe tempRecipe = ((MachineRecipeWrapper) recipeWrapper).getRecipe(); IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks(); diff --git a/src/main/java/mekanism/client/jei/machine/MachineRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/MachineRecipeWrapper.java index b1ba19ead..804a54e63 100644 --- a/src/main/java/mekanism/client/jei/machine/MachineRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/MachineRecipeWrapper.java @@ -4,8 +4,8 @@ import mekanism.common.recipe.inputs.ItemStackInput; import mekanism.common.recipe.machines.BasicMachineRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; -import net.minecraft.item.ItemStack; public class MachineRecipeWrapper implements IRecipeWrapper { @@ -17,8 +17,8 @@ public class MachineRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(ItemStack.class, ((ItemStackInput) recipe.getInput()).ingredient); - ingredients.setOutput(ItemStack.class, ((ItemStackOutput) recipe.getOutput()).output); + ingredients.setInput(VanillaTypes.ITEM, ((ItemStackInput) recipe.getInput()).ingredient); + ingredients.setOutput(VanillaTypes.ITEM, ((ItemStackOutput) recipe.getOutput()).output); } public BasicMachineRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalCrystallizerRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalCrystallizerRecipeCategory.java index aa0f17f1c..d1eb810b9 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalCrystallizerRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalCrystallizerRecipeCategory.java @@ -1,8 +1,8 @@ package mekanism.client.jei.machine.chemical; -import javax.annotation.Nullable; import mekanism.api.gas.GasStack; import mekanism.client.jei.BaseRecipeCategory; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.CrystallizerRecipe; import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; @@ -18,9 +18,6 @@ public class ChemicalCrystallizerRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private CrystallizerRecipe tempRecipe; - public ChemicalCrystallizerRecipeCategory(IGuiHelper helper) { super(helper, "mekanism:gui/nei/GuiChemicalCrystallizer.png", "chemical_crystallizer", "tile.MachineBlock2.ChemicalCrystallizer.name", null); @@ -50,14 +47,14 @@ public class ChemicalCrystallizerRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((ChemicalCrystallizerRecipeWrapper) recipeWrapper).getRecipe(); + CrystallizerRecipe tempRecipe = ((ChemicalCrystallizerRecipeWrapper) recipeWrapper).getRecipe(); IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks(); itemStacks.init(0, false, 130 - xOffset, 56 - yOffset); itemStacks.set(0, tempRecipe.getOutput().output); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); initGas(gasStacks, 0, true, 6 - xOffset, 5 - yOffset, 16, 58, tempRecipe.getInput().ingredient, true); } diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalCrystallizerRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalCrystallizerRecipeWrapper.java index 3c3322a95..ee9cbbe2c 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalCrystallizerRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalCrystallizerRecipeWrapper.java @@ -1,10 +1,10 @@ package mekanism.client.jei.machine.chemical; -import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.CrystallizerRecipe; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; -import net.minecraft.item.ItemStack; public class ChemicalCrystallizerRecipeWrapper implements IRecipeWrapper { @@ -16,8 +16,8 @@ public class ChemicalCrystallizerRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(GasStack.class, recipe.recipeInput.ingredient); - ingredients.setOutput(ItemStack.class, recipe.recipeOutput.output); + ingredients.setInput(MekanismJEI.TYPE_GAS, recipe.recipeInput.ingredient); + ingredients.setOutput(VanillaTypes.ITEM, recipe.recipeOutput.output); } public CrystallizerRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalDissolutionChamberRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalDissolutionChamberRecipeCategory.java index 368aca7f3..9a8742dde 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalDissolutionChamberRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalDissolutionChamberRecipeCategory.java @@ -1,8 +1,8 @@ package mekanism.client.jei.machine.chemical; -import javax.annotation.Nullable; import mekanism.api.gas.GasStack; import mekanism.client.jei.BaseRecipeCategory; +import mekanism.client.jei.MekanismJEI; import mekanism.common.MekanismFluids; import mekanism.common.recipe.machines.DissolutionRecipe; import mekanism.common.tile.TileEntityChemicalDissolutionChamber; @@ -20,9 +20,6 @@ public class ChemicalDissolutionChamberRecipeCategory extends BaseRecipeCategory private final IDrawable background; - @Nullable - private DissolutionRecipe tempRecipe; - public ChemicalDissolutionChamberRecipeCategory(IGuiHelper helper) { super(helper, "mekanism:gui/nei/GuiChemicalDissolutionChamber.png", "chemical_dissolution_chamber", "gui.chemicalDissolutionChamber.short", null); @@ -52,14 +49,14 @@ public class ChemicalDissolutionChamberRecipeCategory extends BaseRecipeCategory return; } - tempRecipe = ((ChemicalDissolutionChamberRecipeWrapper) recipeWrapper).getRecipe(); + DissolutionRecipe tempRecipe = ((ChemicalDissolutionChamberRecipeWrapper) recipeWrapper).getRecipe(); IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks(); itemStacks.init(0, true, 25 - xOffset, 35 - yOffset); itemStacks.set(0, tempRecipe.getInput().ingredient); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); initGas(gasStacks, 0, true, 6 - xOffset, 5 - yOffset, 16, 58, new GasStack(MekanismFluids.SulfuricAcid, TileEntityChemicalDissolutionChamber.BASE_INJECT_USAGE diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalDissolutionChamberRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalDissolutionChamberRecipeWrapper.java index 34e0225e5..ba2581f38 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalDissolutionChamberRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalDissolutionChamberRecipeWrapper.java @@ -1,12 +1,13 @@ package mekanism.client.jei.machine.chemical; import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.MekanismFluids; import mekanism.common.recipe.machines.DissolutionRecipe; import mekanism.common.tile.TileEntityChemicalDissolutionChamber; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; -import net.minecraft.item.ItemStack; public class ChemicalDissolutionChamberRecipeWrapper implements IRecipeWrapper { @@ -18,11 +19,11 @@ public class ChemicalDissolutionChamberRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(GasStack.class, new GasStack(MekanismFluids.SulfuricAcid, + ingredients.setInput(MekanismJEI.TYPE_GAS, new GasStack(MekanismFluids.SulfuricAcid, TileEntityChemicalDissolutionChamber.BASE_INJECT_USAGE * TileEntityChemicalDissolutionChamber.BASE_TICKS_REQUIRED)); - ingredients.setInput(ItemStack.class, recipe.recipeInput.ingredient); - ingredients.setOutput(GasStack.class, recipe.recipeOutput.output); + ingredients.setInput(VanillaTypes.ITEM, recipe.recipeInput.ingredient); + ingredients.setOutput(MekanismJEI.TYPE_GAS, recipe.recipeOutput.output); } public DissolutionRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalInfuserRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalInfuserRecipeCategory.java index cb1d53988..7c322d73c 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalInfuserRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalInfuserRecipeCategory.java @@ -1,8 +1,8 @@ package mekanism.client.jei.machine.chemical; -import javax.annotation.Nullable; import mekanism.api.gas.GasStack; import mekanism.client.jei.BaseRecipeCategory; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.ChemicalInfuserRecipe; import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; @@ -17,9 +17,6 @@ public class ChemicalInfuserRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private ChemicalInfuserRecipe tempRecipe; - public ChemicalInfuserRecipeCategory(IGuiHelper helper) { super(helper, "mekanism:gui/nei/GuiChemicalInfuser.png", "chemical_infuser", "tile.MachineBlock2.ChemicalInfuser.name", null); @@ -49,9 +46,9 @@ public class ChemicalInfuserRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((ChemicalInfuserRecipeWrapper) recipeWrapper).getRecipe(); + ChemicalInfuserRecipe tempRecipe = ((ChemicalInfuserRecipeWrapper) recipeWrapper).getRecipe(); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); initGas(gasStacks, 0, true, 26 - xOffset, 14 - yOffset, 16, 58, tempRecipe.getInput().leftGas, true); initGas(gasStacks, 1, true, 134 - xOffset, 14 - yOffset, 16, 58, tempRecipe.getInput().rightGas, true); diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalInfuserRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalInfuserRecipeWrapper.java index 1c7f13e1f..c8ba291fd 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalInfuserRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalInfuserRecipeWrapper.java @@ -1,7 +1,7 @@ package mekanism.client.jei.machine.chemical; import java.util.Arrays; -import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.ChemicalInfuserRecipe; import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeWrapper; @@ -16,8 +16,8 @@ public class ChemicalInfuserRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInputs(GasStack.class, Arrays.asList(recipe.recipeInput.leftGas, recipe.recipeInput.rightGas)); - ingredients.setOutput(GasStack.class, recipe.recipeOutput.output); + ingredients.setInputs(MekanismJEI.TYPE_GAS, Arrays.asList(recipe.recipeInput.leftGas, recipe.recipeInput.rightGas)); + ingredients.setOutput(MekanismJEI.TYPE_GAS, recipe.recipeOutput.output); } public ChemicalInfuserRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalOxidizerRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalOxidizerRecipeCategory.java index 34f9d4157..260bad9bb 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalOxidizerRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalOxidizerRecipeCategory.java @@ -1,6 +1,5 @@ package mekanism.client.jei.machine.chemical; -import javax.annotation.Nullable; import mekanism.api.gas.GasStack; import mekanism.client.gui.element.GuiGasGauge; import mekanism.client.gui.element.GuiGauge; @@ -10,6 +9,7 @@ import mekanism.client.gui.element.GuiProgress.ProgressBar; import mekanism.client.gui.element.GuiSlot; import mekanism.client.gui.element.GuiSlot.SlotType; import mekanism.client.jei.BaseRecipeCategory; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.OxidationRecipe; import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils.ResourceType; @@ -26,9 +26,6 @@ public class ChemicalOxidizerRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private OxidationRecipe tempRecipe; - public ChemicalOxidizerRecipeCategory(IGuiHelper helper) { super(helper, "mekanism:gui/GuiChemicalOxidizer.png", "chemical_oxidizer", "tile.MachineBlock2.ChemicalOxidizer.name", ProgressBar.LARGE_RIGHT); @@ -66,14 +63,14 @@ public class ChemicalOxidizerRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((ChemicalOxidizerRecipeWrapper) recipeWrapper).getRecipe(); + OxidationRecipe tempRecipe = ((ChemicalOxidizerRecipeWrapper) recipeWrapper).getRecipe(); IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks(); itemStacks.init(0, true, 25 - xOffset, 35 - yOffset); itemStacks.set(0, tempRecipe.getInput().ingredient); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); initGas(gasStacks, 0, false, 134 - xOffset, 14 - yOffset, 16, 58, tempRecipe.recipeOutput.output, true); } diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalOxidizerRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalOxidizerRecipeWrapper.java index 7d2e3d80b..e55b8fdff 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalOxidizerRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalOxidizerRecipeWrapper.java @@ -1,10 +1,10 @@ package mekanism.client.jei.machine.chemical; -import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.OxidationRecipe; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; -import net.minecraft.item.ItemStack; public class ChemicalOxidizerRecipeWrapper implements IRecipeWrapper { @@ -16,8 +16,8 @@ public class ChemicalOxidizerRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(ItemStack.class, recipe.recipeInput.ingredient); - ingredients.setOutput(GasStack.class, recipe.recipeOutput.output); + ingredients.setInput(VanillaTypes.ITEM, recipe.recipeInput.ingredient); + ingredients.setOutput(MekanismJEI.TYPE_GAS, recipe.recipeOutput.output); } public OxidationRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalWasherRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalWasherRecipeCategory.java index 52c8d9f4b..debdf9264 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalWasherRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalWasherRecipeCategory.java @@ -1,8 +1,8 @@ package mekanism.client.jei.machine.chemical; -import javax.annotation.Nullable; import mekanism.api.gas.GasStack; import mekanism.client.jei.BaseRecipeCategory; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.WasherRecipe; import mekanism.common.tile.TileEntityChemicalWasher; import mezz.jei.api.IGuiHelper; @@ -11,18 +11,15 @@ import mezz.jei.api.gui.IGuiFluidStackGroup; import mezz.jei.api.gui.IGuiIngredientGroup; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; public class ChemicalWasherRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private WasherRecipe tempRecipe; - public ChemicalWasherRecipeCategory(IGuiHelper helper) { super(helper, "mekanism:gui/nei/GuiChemicalWasher.png", "chemical_washer", "tile.MachineBlock2.ChemicalWasher.name", null); @@ -51,15 +48,15 @@ public class ChemicalWasherRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((ChemicalWasherRecipeWrapper) recipeWrapper).getRecipe(); + WasherRecipe tempRecipe = ((ChemicalWasherRecipeWrapper) recipeWrapper).getRecipe(); IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks(); fluidStacks.init(0, true, 6 - xOffset, 5 - yOffset, 16, 58, TileEntityChemicalWasher.WATER_USAGE, false, fluidOverlayLarge); - fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); + fluidStacks.set(0, ingredients.getInputs(VanillaTypes.FLUID).get(0)); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); initGas(gasStacks, 0, true, 27 - xOffset, 14 - yOffset, 16, 58, tempRecipe.getInput().ingredient, true); initGas(gasStacks, 1, false, 134 - xOffset, 14 - yOffset, 16, 58, tempRecipe.getOutput().output, true); diff --git a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalWasherRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalWasherRecipeWrapper.java index 6747f3bc7..1904a82ca 100644 --- a/src/main/java/mekanism/client/jei/machine/chemical/ChemicalWasherRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/chemical/ChemicalWasherRecipeWrapper.java @@ -1,9 +1,10 @@ package mekanism.client.jei.machine.chemical; -import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.WasherRecipe; import mekanism.common.tile.TileEntityChemicalWasher; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -18,9 +19,9 @@ public class ChemicalWasherRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(FluidStack.class, new FluidStack(FluidRegistry.WATER, TileEntityChemicalWasher.WATER_USAGE)); - ingredients.setInput(GasStack.class, recipe.recipeInput.ingredient); - ingredients.setOutput(GasStack.class, recipe.recipeOutput.output); + ingredients.setInput(VanillaTypes.FLUID, new FluidStack(FluidRegistry.WATER, TileEntityChemicalWasher.WATER_USAGE)); + ingredients.setInput(MekanismJEI.TYPE_GAS, recipe.recipeInput.ingredient); + ingredients.setOutput(MekanismJEI.TYPE_GAS, recipe.recipeOutput.output); } public WasherRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/other/ElectrolyticSeparatorRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/other/ElectrolyticSeparatorRecipeCategory.java index eef6fa5a7..e89358942 100644 --- a/src/main/java/mekanism/client/jei/machine/other/ElectrolyticSeparatorRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/other/ElectrolyticSeparatorRecipeCategory.java @@ -1,6 +1,5 @@ package mekanism.client.jei.machine.other; -import javax.annotation.Nullable; import mekanism.api.gas.GasStack; import mekanism.client.gui.element.GuiFluidGauge; import mekanism.client.gui.element.GuiGasGauge; @@ -14,6 +13,7 @@ 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.jei.MekanismJEI; import mekanism.common.recipe.machines.SeparatorRecipe; import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils.ResourceType; @@ -23,17 +23,14 @@ import mezz.jei.api.gui.IGuiFluidStackGroup; import mezz.jei.api.gui.IGuiIngredientGroup; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private SeparatorRecipe tempRecipe; - public ElectrolyticSeparatorRecipeCategory(IGuiHelper helper) { super(helper, "mekanism:gui/GuiElectrolyticSeparator.png", "electrolytic_separator", "tile.MachineBlock2.ElectrolyticSeparator.name", ProgressBar.BI); @@ -88,14 +85,14 @@ public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((ElectrolyticSeparatorRecipeWrapper) recipeWrapper).getRecipe(); + SeparatorRecipe tempRecipe = ((ElectrolyticSeparatorRecipeWrapper) recipeWrapper).getRecipe(); IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks(); fluidStacks.init(0, true, 2, 2, 16, 58, tempRecipe.getInput().ingredient.amount, false, fluidOverlayLarge); - fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); + fluidStacks.set(0, ingredients.getInputs(VanillaTypes.FLUID).get(0)); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); initGas(gasStacks, 0, false, 59 - xOffset, 19 - yOffset, 16, 28, tempRecipe.recipeOutput.leftGas, true); initGas(gasStacks, 1, false, 101 - xOffset, 19 - yOffset, 16, 28, tempRecipe.recipeOutput.rightGas, true); diff --git a/src/main/java/mekanism/client/jei/machine/other/ElectrolyticSeparatorRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/other/ElectrolyticSeparatorRecipeWrapper.java index 07fb67bb1..b084ee8e6 100644 --- a/src/main/java/mekanism/client/jei/machine/other/ElectrolyticSeparatorRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/other/ElectrolyticSeparatorRecipeWrapper.java @@ -1,11 +1,11 @@ package mekanism.client.jei.machine.other; import java.util.Arrays; -import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.SeparatorRecipe; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; -import net.minecraftforge.fluids.FluidStack; public class ElectrolyticSeparatorRecipeWrapper implements IRecipeWrapper { @@ -17,9 +17,9 @@ public class ElectrolyticSeparatorRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(FluidStack.class, recipe.recipeInput.ingredient); - ingredients - .setOutputs(GasStack.class, Arrays.asList(recipe.recipeOutput.leftGas, recipe.recipeOutput.rightGas)); + ingredients.setInput(VanillaTypes.FLUID, recipe.recipeInput.ingredient); + ingredients.setOutputs(MekanismJEI.TYPE_GAS, + Arrays.asList(recipe.recipeOutput.leftGas, recipe.recipeOutput.rightGas)); } public SeparatorRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/other/MetallurgicInfuserRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/other/MetallurgicInfuserRecipeWrapper.java index 564348611..1a902064c 100644 --- a/src/main/java/mekanism/client/jei/machine/other/MetallurgicInfuserRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/other/MetallurgicInfuserRecipeWrapper.java @@ -7,6 +7,7 @@ import mekanism.client.render.MekanismRenderer; import mekanism.common.InfuseStorage; import mekanism.common.recipe.machines.MetallurgicInfuserRecipe; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; @@ -24,9 +25,9 @@ public class MetallurgicInfuserRecipeWrapper implements IRecipeWrapper { List inputStacks = Collections.singletonList(recipe.recipeInput.inputStack); List infuseStacks = MetallurgicInfuserRecipeCategory.getInfuseStacks(recipe.getInput().infuse.type); - ingredients.setInput(ItemStack.class, recipe.recipeInput.inputStack); - ingredients.setInputLists(ItemStack.class, Arrays.asList(inputStacks, infuseStacks)); - ingredients.setOutput(ItemStack.class, recipe.recipeOutput.output); + ingredients.setInput(VanillaTypes.ITEM, recipe.recipeInput.inputStack); + ingredients.setInputLists(VanillaTypes.ITEM, Arrays.asList(inputStacks, infuseStacks)); + ingredients.setOutput(VanillaTypes.ITEM, recipe.recipeOutput.output); } public MetallurgicInfuserRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/other/PRCRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/other/PRCRecipeCategory.java index 5e6a0cf61..e570b2f11 100644 --- a/src/main/java/mekanism/client/jei/machine/other/PRCRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/other/PRCRecipeCategory.java @@ -1,6 +1,5 @@ package mekanism.client.jei.machine.other; -import javax.annotation.Nullable; import mekanism.api.gas.GasStack; import mekanism.client.gui.element.GuiFluidGauge; import mekanism.client.gui.element.GuiGasGauge; @@ -14,6 +13,7 @@ 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.jei.MekanismJEI; import mekanism.common.recipe.machines.PressurizedRecipe; import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; @@ -29,9 +29,6 @@ public class PRCRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private PressurizedRecipe tempRecipe; - public PRCRecipeCategory(IGuiHelper helper) { super(helper, "mekanism:gui/nei/GuiPRC.png", "pressurized_reaction_chamber", "tile.MachineBlock2.PressurizedReactionChamber.short.name", ProgressBar.MEDIUM); @@ -77,7 +74,7 @@ public class PRCRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((PRCRecipeWrapper) recipeWrapper).getRecipe(); + PressurizedRecipe tempRecipe = ((PRCRecipeWrapper) recipeWrapper).getRecipe(); IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks(); @@ -92,7 +89,7 @@ public class PRCRecipeCategory extends BaseRecipeCategory { fluidStacks.init(0, true, 3, 0, 16, 58, tempRecipe.getInput().getFluid().amount, false, fluidOverlayLarge); fluidStacks.set(0, tempRecipe.recipeInput.getFluid()); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); initGas(gasStacks, 0, true, 29 - xOffset, 11 - yOffset, 16, 58, tempRecipe.recipeInput.getGas(), true); initGas(gasStacks, 1, false, 141 - xOffset, 41 - yOffset, 16, 28, tempRecipe.recipeOutput.getGasOutput(), true); diff --git a/src/main/java/mekanism/client/jei/machine/other/PRCRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/other/PRCRecipeWrapper.java index 236cf6e43..4ecba11cc 100644 --- a/src/main/java/mekanism/client/jei/machine/other/PRCRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/other/PRCRecipeWrapper.java @@ -1,11 +1,10 @@ package mekanism.client.jei.machine.other; -import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.PressurizedRecipe; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class PRCRecipeWrapper implements IRecipeWrapper { @@ -17,11 +16,11 @@ public class PRCRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(ItemStack.class, recipe.recipeInput.getSolid()); - ingredients.setInput(FluidStack.class, recipe.recipeInput.getFluid()); - ingredients.setInput(GasStack.class, recipe.recipeInput.getGas()); - ingredients.setOutput(ItemStack.class, recipe.recipeOutput.getItemOutput()); - ingredients.setOutput(GasStack.class, recipe.recipeOutput.getGasOutput()); + ingredients.setInput(VanillaTypes.ITEM, recipe.recipeInput.getSolid()); + ingredients.setInput(VanillaTypes.FLUID, recipe.recipeInput.getFluid()); + ingredients.setInput(MekanismJEI.TYPE_GAS, recipe.recipeInput.getGas()); + ingredients.setOutput(VanillaTypes.ITEM, recipe.recipeOutput.getItemOutput()); + ingredients.setOutput(MekanismJEI.TYPE_GAS, recipe.recipeOutput.getGasOutput()); } public PressurizedRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/other/RotaryCondensentratorRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/other/RotaryCondensentratorRecipeCategory.java index f0be49084..becab9009 100644 --- a/src/main/java/mekanism/client/jei/machine/other/RotaryCondensentratorRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/other/RotaryCondensentratorRecipeCategory.java @@ -3,16 +3,17 @@ package mekanism.client.jei.machine.other; import javax.annotation.Nullable; import mekanism.api.gas.GasStack; import mekanism.client.jei.BaseRecipeCategory; +import mekanism.client.jei.MekanismJEI; import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiFluidStackGroup; import mezz.jei.api.gui.IGuiIngredientGroup; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; public class RotaryCondensentratorRecipeCategory extends BaseRecipeCategory { @@ -67,17 +68,17 @@ public class RotaryCondensentratorRecipeCategory extends BaseRecipeCategory { tempRecipe = (RotaryCondensentratorRecipeWrapper) recipeWrapper; IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks(); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); fluidStacks.init(0, !tempRecipe.condensentrating, 134 - xOffset, 14 - yOffset, 16, 58, tempRecipe.fluidAmount, false, fluidOverlayLarge); if (tempRecipe.condensentrating) { initGas(gasStacks, 0, true, 26 - xOffset, 14 - yOffset, 16, 58, new GasStack(tempRecipe.gasType, tempRecipe.gasAmount), true); - fluidStacks.set(0, ingredients.getOutputs(FluidStack.class).get(0)); + fluidStacks.set(0, ingredients.getOutputs(VanillaTypes.FLUID).get(0)); } else { initGas(gasStacks, 0, false, 26 - xOffset, 14 - yOffset, 16, 58, new GasStack(tempRecipe.gasType, tempRecipe.gasAmount), true); - fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0)); + fluidStacks.set(0, ingredients.getInputs(VanillaTypes.FLUID).get(0)); } } } diff --git a/src/main/java/mekanism/client/jei/machine/other/RotaryCondensentratorRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/other/RotaryCondensentratorRecipeWrapper.java index 6c9619be7..244f78d50 100644 --- a/src/main/java/mekanism/client/jei/machine/other/RotaryCondensentratorRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/other/RotaryCondensentratorRecipeWrapper.java @@ -3,8 +3,10 @@ package mekanism.client.jei.machine.other; import javax.annotation.Nonnull; import mekanism.api.gas.Gas; import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.util.LangUtils; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraftforge.fluids.Fluid; @@ -29,11 +31,11 @@ public class RotaryCondensentratorRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { if (condensentrating) { - ingredients.setInput(GasStack.class, new GasStack(gasType, gasAmount)); - ingredients.setOutput(FluidStack.class, new FluidStack(fluidType, fluidAmount)); + ingredients.setInput(MekanismJEI.TYPE_GAS, new GasStack(gasType, gasAmount)); + ingredients.setOutput(VanillaTypes.FLUID, new FluidStack(fluidType, fluidAmount)); } else { - ingredients.setInput(FluidStack.class, new FluidStack(fluidType, fluidAmount)); - ingredients.setOutput(GasStack.class, new GasStack(gasType, gasAmount)); + ingredients.setInput(VanillaTypes.FLUID, new FluidStack(fluidType, fluidAmount)); + ingredients.setOutput(MekanismJEI.TYPE_GAS, new GasStack(gasType, gasAmount)); } } diff --git a/src/main/java/mekanism/client/jei/machine/other/SolarNeutronRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/other/SolarNeutronRecipeCategory.java index 524c669fa..38371e051 100644 --- a/src/main/java/mekanism/client/jei/machine/other/SolarNeutronRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/other/SolarNeutronRecipeCategory.java @@ -1,8 +1,8 @@ package mekanism.client.jei.machine.other; -import javax.annotation.Nullable; import mekanism.api.gas.GasStack; import mekanism.client.jei.BaseRecipeCategory; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.SolarNeutronRecipe; import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; @@ -17,9 +17,6 @@ public class SolarNeutronRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private SolarNeutronRecipe tempRecipe; - public SolarNeutronRecipeCategory(IGuiHelper helper) { super(helper, "mekanism:gui/nei/GuiSolarNeutronActivator.png", "solar_neutron_activator", "tile.MachineBlock3.SolarNeutronActivator.name", null); @@ -48,9 +45,9 @@ public class SolarNeutronRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((SolarNeutronRecipeWrapper) recipeWrapper).getRecipe(); + SolarNeutronRecipe tempRecipe = ((SolarNeutronRecipeWrapper) recipeWrapper).getRecipe(); - IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class); + IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS); initGas(gasStacks, 0, true, 26 - xOffset, 14 - yOffset, 16, 58, tempRecipe.recipeInput.ingredient, true); initGas(gasStacks, 1, false, 134 - xOffset, 14 - yOffset, 16, 58, tempRecipe.recipeOutput.output, true); diff --git a/src/main/java/mekanism/client/jei/machine/other/SolarNeutronRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/other/SolarNeutronRecipeWrapper.java index c289f1e19..04947f622 100644 --- a/src/main/java/mekanism/client/jei/machine/other/SolarNeutronRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/other/SolarNeutronRecipeWrapper.java @@ -1,6 +1,6 @@ package mekanism.client.jei.machine.other; -import mekanism.api.gas.GasStack; +import mekanism.client.jei.MekanismJEI; import mekanism.common.recipe.machines.SolarNeutronRecipe; import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeWrapper; @@ -15,8 +15,8 @@ public class SolarNeutronRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(GasStack.class, recipe.getInput().ingredient); - ingredients.setOutput(GasStack.class, recipe.getOutput().output); + ingredients.setInput(MekanismJEI.TYPE_GAS, recipe.getInput().ingredient); + ingredients.setOutput(MekanismJEI.TYPE_GAS, recipe.getOutput().output); } public SolarNeutronRecipe getRecipe() { diff --git a/src/main/java/mekanism/client/jei/machine/other/ThermalEvaporationRecipeCategory.java b/src/main/java/mekanism/client/jei/machine/other/ThermalEvaporationRecipeCategory.java index 55f003a70..60e1cbb3e 100644 --- a/src/main/java/mekanism/client/jei/machine/other/ThermalEvaporationRecipeCategory.java +++ b/src/main/java/mekanism/client/jei/machine/other/ThermalEvaporationRecipeCategory.java @@ -1,6 +1,5 @@ package mekanism.client.jei.machine.other; -import javax.annotation.Nullable; import mekanism.client.jei.BaseRecipeCategory; import mekanism.common.recipe.machines.ThermalEvaporationRecipe; import mezz.jei.api.IGuiHelper; @@ -16,9 +15,6 @@ public class ThermalEvaporationRecipeCategory extends BaseRecipeCategory { private final IDrawable background; - @Nullable - private ThermalEvaporationRecipe tempRecipe; - public ThermalEvaporationRecipeCategory(IGuiHelper helper) { super(helper, "mekanism:gui/nei/GuiThermalEvaporationController.png", "thermal_evaporation_plant", "gui.thermalEvaporationController.short", null); @@ -47,7 +43,7 @@ public class ThermalEvaporationRecipeCategory extends BaseRecipeCategory { return; } - tempRecipe = ((ThermalEvaporationRecipeWrapper) recipeWrapper).getRecipe(); + ThermalEvaporationRecipe tempRecipe = ((ThermalEvaporationRecipeWrapper) recipeWrapper).getRecipe(); IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks(); diff --git a/src/main/java/mekanism/client/jei/machine/other/ThermalEvaporationRecipeWrapper.java b/src/main/java/mekanism/client/jei/machine/other/ThermalEvaporationRecipeWrapper.java index 98562191f..290ce9a88 100644 --- a/src/main/java/mekanism/client/jei/machine/other/ThermalEvaporationRecipeWrapper.java +++ b/src/main/java/mekanism/client/jei/machine/other/ThermalEvaporationRecipeWrapper.java @@ -2,8 +2,8 @@ package mekanism.client.jei.machine.other; import mekanism.common.recipe.machines.ThermalEvaporationRecipe; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapper; -import net.minecraftforge.fluids.FluidStack; public class ThermalEvaporationRecipeWrapper implements IRecipeWrapper { @@ -15,8 +15,8 @@ public class ThermalEvaporationRecipeWrapper implements IRecipeWrapper { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(FluidStack.class, recipe.getInput().ingredient); - ingredients.setOutput(FluidStack.class, recipe.getOutput().output); + ingredients.setInput(VanillaTypes.FLUID, recipe.getInput().ingredient); + ingredients.setOutput(VanillaTypes.FLUID, recipe.getOutput().output); } public ThermalEvaporationRecipe getRecipe() {