JEI cleanup, pass 1

This commit is contained in:
Tom Elfring committed 2017-08-12 16:28:45 +02:00
1 parent e549aafcd1
commit db6f775848
33 files changed
+270 -227

No files matched your search

@@ -1,5 +1,6 @@
package mekanism.client.jei;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -63,6 +64,7 @@ import mekanism.client.jei.machine.other.SolarNeutronRecipeCategory;
import mekanism.client.jei.machine.other.SolarNeutronRecipeWrapper;
import mekanism.client.jei.machine.other.ThermalEvaporationRecipeCategory;
import mekanism.client.jei.machine.other.ThermalEvaporationRecipeWrapper;
import mekanism.common.Mekanism;
import mekanism.common.MekanismBlocks;
import mekanism.common.MekanismItems;
import mekanism.common.base.IFactory;
@@ -70,6 +72,8 @@ import mekanism.common.base.IFactory.RecipeType;
import mekanism.common.base.ITierItem;
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
import mekanism.common.block.states.BlockStateMachine.MachineType;
import mekanism.common.inventory.container.ContainerFormulaicAssemblicator;
import mekanism.common.inventory.container.ContainerRobitInventory;
import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
import mekanism.common.recipe.machines.BasicMachineRecipe;
@@ -92,7 +96,9 @@ import mezz.jei.api.ISubtypeRegistry.ISubtypeInterpreter;
import mezz.jei.api.JEIPlugin;
import mezz.jei.api.ingredients.IModIngredientRegistration;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
import mezz.jei.api.recipe.IRecipeWrapper;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
@@ -100,27 +106,24 @@ import net.minecraftforge.fluids.Fluid;
@JEIPlugin
public class MekanismJEI implements IModPlugin
{
public static GasStackRenderer GAS_RENDERER;
private static final GasStackRenderer GAS_RENDERER = new GasStackRenderer();
public static ISubtypeInterpreter NBT_INTERPRETER = new ISubtypeInterpreter() {
@Override
public String getSubtypeInfo(ItemStack itemStack)
{
String ret = Integer.toString(itemStack.getMetadata());
if(itemStack.getItem() instanceof ITierItem)
{
ret += ":" + ((ITierItem)itemStack.getItem()).getBaseTier(itemStack).getSimpleName();
}
if(itemStack.getItem() instanceof IFactory)
{
ret += ":" + RecipeType.values()[((IFactory)itemStack.getItem()).getRecipeType(itemStack)].getName();
}
return ret.isEmpty() ? null : ret.toLowerCase();
}
};
public static final ISubtypeInterpreter NBT_INTERPRETER = itemStack ->
{
String ret = Integer.toString(itemStack.getMetadata());
if(itemStack.getItem() instanceof ITierItem)
{
ret += ":" + ((ITierItem)itemStack.getItem()).getBaseTier(itemStack).getSimpleName();
}
if(itemStack.getItem() instanceof IFactory)
{
ret += ":" + RecipeType.values()[((IFactory)itemStack.getItem()).getRecipeType(itemStack)].getName();
}
return ret.isEmpty() ? null : ret.toLowerCase();
};
@Override
public void registerItemSubtypes(ISubtypeRegistry registry)
@@ -139,10 +142,43 @@ public class MekanismJEI implements IModPlugin
@Override
public void registerIngredients(IModIngredientRegistration registry)
{
List<GasStack> list = GasRegistry.getRegisteredGasses().stream().filter(g -> g.isVisible()).map(g -> new GasStack(g, Fluid.BUCKET_VOLUME)).collect(Collectors.toList());
registry.register(GasStack.class, list, new GasStackHelper(), GAS_RENDERER = new GasStackRenderer());
List<GasStack> 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);
}
@Override
public void registerCategories(IRecipeCategoryRegistration registry)
{
ChemicalCrystallizerRecipeCategory chemicalCrystallizerCategory = new ChemicalCrystallizerRecipeCategory(registry.getJeiHelpers().getGuiHelper());
ChemicalDissolutionChamberRecipeCategory chemicalDissolutionChamberCategory = new ChemicalDissolutionChamberRecipeCategory(registry.getJeiHelpers().getGuiHelper());
ChemicalInfuserRecipeCategory chemicalInfuserCategory = new ChemicalInfuserRecipeCategory(registry.getJeiHelpers().getGuiHelper());
ChemicalOxidizerRecipeCategory chemicalOxidizerCategory = new ChemicalOxidizerRecipeCategory(registry.getJeiHelpers().getGuiHelper());
ChemicalWasherRecipeCategory chemicalWasherCategory = new ChemicalWasherRecipeCategory(registry.getJeiHelpers().getGuiHelper());
ElectrolyticSeparatorRecipeCategory electrolyticSeparatorCategory = new ElectrolyticSeparatorRecipeCategory(registry.getJeiHelpers().getGuiHelper());
MetallurgicInfuserRecipeCategory metallurgicInfuserCategory = new MetallurgicInfuserRecipeCategory(registry.getJeiHelpers().getGuiHelper());
PRCRecipeCategory prcCategory = new PRCRecipeCategory(registry.getJeiHelpers().getGuiHelper());
// RotaryCondensentratorRecipeCategory rotaryCondensentratorCategory = new RotaryCondensentratorRecipeCategory(registry.getJeiHelpers().getGuiHelper());
SolarNeutronRecipeCategory solarNeutronCategory = new SolarNeutronRecipeCategory(registry.getJeiHelpers().getGuiHelper());
ThermalEvaporationRecipeCategory thermalEvaporationCategory = new ThermalEvaporationRecipeCategory(registry.getJeiHelpers().getGuiHelper());
// AdvancedMachineRecipeCategory advancedMachineRecipeCategoryCombiner = new AdvancedMachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), Recipe.COMBINER.name().toLowerCase(), "tile.MachineBlock.Combiner.name", ProgressBar.STONE);
// AdvancedMachineRecipeCategory advancedMachineRecipeCategoryPurificationChamber = new AdvancedMachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), Recipe.PURIFICATION_CHAMBER.name().toLowerCase(), "tile.MachineBlock.PurificationChamber.name", ProgressBar.RED);
// AdvancedMachineRecipeCategory advancedMachineRecipeCategoryOsmiumCompressor = new AdvancedMachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), Recipe.OSMIUM_COMPRESSOR.name().toLowerCase(), "tile.MachineBlock.OsmiumCompressor.name", ProgressBar.RED);
// AdvancedMachineRecipeCategory advancedMachineRecipeCategoryChemicalInjectionChamber = new AdvancedMachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), Recipe.CHEMICAL_INJECTION_CHAMBER.name().toLowerCase(), "nei.chemicalInjectionChamber", ProgressBar.YELLOW);
// ChanceMachineRecipeCategory chanceMachineRecipeCategoryPrecisionSawmill = new ChanceMachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), Recipe.PRECISION_SAWMILL.name().toLowerCase(), "tile.MachineBlock2.PrecisionSawmill.name", ProgressBar.PURPLE);
// MachineRecipeCategory machineRecipeCategoryEnrichment = new MachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), Recipe.ENRICHMENT_CHAMBER.name().toLowerCase(), "tile.MachineBlock.EnrichmentChamber.name", ProgressBar.BLUE);
// MachineRecipeCategory machineRecipeCategoryCrusher = new MachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), Recipe.CRUSHER.name().toLowerCase(), "tile.MachineBlock.Crusher.name", ProgressBar.CRUSH);
registry.addRecipeCategories(chemicalCrystallizerCategory, chemicalDissolutionChamberCategory, chemicalInfuserCategory, chemicalOxidizerCategory,
chemicalWasherCategory, electrolyticSeparatorCategory, metallurgicInfuserCategory, prcCategory, /*rotaryCondensentratorCategory,*/ solarNeutronCategory,
thermalEvaporationCategory/*, advancedMachineRecipeCategoryCombiner, advancedMachineRecipeCategoryPurificationChamber, advancedMachineRecipeCategoryOsmiumCompressor,
advancedMachineRecipeCategoryChemicalInjectionChamber, chanceMachineRecipeCategoryPrecisionSawmill, machineRecipeCategoryEnrichment,
machineRecipeCategoryCrusher*/
);
}
@Override
public void register(IModRegistry registry)
{
@@ -150,71 +186,58 @@ public class MekanismJEI implements IModPlugin
registry.getJeiHelpers().getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(MekanismItems.ItemProxy));
registry.getJeiHelpers().getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(MekanismBlocks.BoundingBlock));
try {
//TODO Update these to new JEI API
try
{
registerBasicMachine(registry, Recipe.ENRICHMENT_CHAMBER, "tile.MachineBlock.EnrichmentChamber.name", ProgressBar.BLUE, EnrichmentRecipeWrapper.class);
registerBasicMachine(registry, Recipe.CRUSHER, "tile.MachineBlock.Crusher.name", ProgressBar.CRUSH, CrusherRecipeWrapper.class);
registerAdvancedMachine(registry, Recipe.COMBINER, "tile.MachineBlock.Combiner.name", ProgressBar.STONE, CombinerRecipeWrapper.class);
registerAdvancedMachine(registry, Recipe.PURIFICATION_CHAMBER, "tile.MachineBlock.PurificationChamber.name", ProgressBar.RED, PurificationChamberRecipeWrapper.class);
registerAdvancedMachine(registry, Recipe.OSMIUM_COMPRESSOR, "tile.MachineBlock.OsmiumCompressor.name", ProgressBar.RED, OsmiumCompressorRecipeWrapper.class);
registerAdvancedMachine(registry, Recipe.CHEMICAL_INJECTION_CHAMBER, "nei.chemicalInjectionChamber", ProgressBar.YELLOW, ChemicalInjectionChamberRecipeWrapper.class);
registerChanceMachine(registry, Recipe.PRECISION_SAWMILL, "tile.MachineBlock2.PrecisionSawmill.name", ProgressBar.PURPLE, PrecisionSawmillRecipeWrapper.class);
MetallurgicInfuserRecipeCategory metallurgicInfuserCategory = new MetallurgicInfuserRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(metallurgicInfuserCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(metallurgicInfuserCategory, MetallurgicInfuserRecipeWrapper.class));
addRecipes(registry, Recipe.METALLURGIC_INFUSER, metallurgicInfuserCategory, MetallurgicInfuserRecipe.class, MetallurgicInfuserRecipeCategory.class, MetallurgicInfuserRecipeWrapper.class);
ChemicalCrystallizerRecipeCategory chemicalCrystallizerCategory = new ChemicalCrystallizerRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalCrystallizerCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalCrystallizerCategory, ChemicalCrystallizerRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_CRYSTALLIZER, chemicalCrystallizerCategory, CrystallizerRecipe.class, ChemicalCrystallizerRecipeCategory.class, ChemicalCrystallizerRecipeWrapper.class);
ChemicalDissolutionChamberRecipeCategory chemicalDissolutionChamberCategory = new ChemicalDissolutionChamberRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalDissolutionChamberCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalDissolutionChamberCategory, ChemicalDissolutionChamberRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_DISSOLUTION_CHAMBER, chemicalDissolutionChamberCategory, DissolutionRecipe.class, ChemicalDissolutionChamberRecipeCategory.class, ChemicalDissolutionChamberRecipeWrapper.class);
ChemicalInfuserRecipeCategory chemicalInfuserCategory = new ChemicalInfuserRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalInfuserCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalInfuserCategory, ChemicalInfuserRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_INFUSER, chemicalInfuserCategory, ChemicalInfuserRecipe.class, ChemicalInfuserRecipeCategory.class, ChemicalInfuserRecipeWrapper.class);
ChemicalOxidizerRecipeCategory chemicalOxidizerCategory = new ChemicalOxidizerRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalOxidizerCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalOxidizerCategory, ChemicalOxidizerRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_OXIDIZER, chemicalOxidizerCategory, OxidationRecipe.class, ChemicalOxidizerRecipeCategory.class, ChemicalOxidizerRecipeWrapper.class);
ChemicalWasherRecipeCategory chemicalWasherCategory = new ChemicalWasherRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalWasherCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalWasherCategory, ChemicalWasherRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_WASHER, chemicalWasherCategory, WasherRecipe.class, ChemicalWasherRecipeCategory.class, ChemicalWasherRecipeWrapper.class);
SolarNeutronRecipeCategory solarNeutronCategory = new SolarNeutronRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(solarNeutronCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(solarNeutronCategory, SolarNeutronRecipeWrapper.class));
addRecipes(registry, Recipe.SOLAR_NEUTRON_ACTIVATOR, solarNeutronCategory, SolarNeutronRecipe.class, SolarNeutronRecipeCategory.class, SolarNeutronRecipeWrapper.class);
ElectrolyticSeparatorRecipeCategory electrolyticSeparatorCategory = new ElectrolyticSeparatorRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(electrolyticSeparatorCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(electrolyticSeparatorCategory, ElectrolyticSeparatorRecipeWrapper.class));
addRecipes(registry, Recipe.ELECTROLYTIC_SEPARATOR, electrolyticSeparatorCategory, SeparatorRecipe.class, ElectrolyticSeparatorRecipeCategory.class, ElectrolyticSeparatorRecipeWrapper.class);
ThermalEvaporationRecipeCategory thermalEvaporationCategory = new ThermalEvaporationRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(thermalEvaporationCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(thermalEvaporationCategory, ThermalEvaporationRecipeWrapper.class));
addRecipes(registry, Recipe.THERMAL_EVAPORATION_PLANT, thermalEvaporationCategory, ThermalEvaporationRecipe.class, ThermalEvaporationRecipeCategory.class, ThermalEvaporationRecipeWrapper.class);
PRCRecipeCategory prcCategory = new PRCRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(prcCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(prcCategory, PRCRecipeWrapper.class));
addRecipes(registry, Recipe.PRESSURIZED_REACTION_CHAMBER, prcCategory, PressurizedRecipe.class, PRCRecipeCategory.class, PRCRecipeWrapper.class);
} catch(Exception e) {
}
catch (Exception e)
{
e.printStackTrace();
}
//-TODO
registry.handleRecipes(MetallurgicInfuserRecipe.class, MetallurgicInfuserRecipeWrapper::new, "mekanism.metallurgic_infuser");
addRecipes(registry, Recipe.METALLURGIC_INFUSER, MetallurgicInfuserRecipe.class, MetallurgicInfuserRecipeWrapper.class, "mekanism.metallurgic_infuser");
registry.handleRecipes(CrystallizerRecipe.class, ChemicalCrystallizerRecipeWrapper::new, "mekanism.chemical_crystallizer");
addRecipes(registry, Recipe.CHEMICAL_CRYSTALLIZER, CrystallizerRecipe.class, ChemicalCrystallizerRecipeWrapper.class, "mekanism.chemical_crystallizer");
registry.handleRecipes(DissolutionRecipe.class, ChemicalDissolutionChamberRecipeWrapper::new, "mekanism.chemical_dissolution_chamber");
addRecipes(registry, Recipe.CHEMICAL_DISSOLUTION_CHAMBER, DissolutionRecipe.class, ChemicalDissolutionChamberRecipeWrapper.class, "mekanism.chemical_dissolution_chamber");
registry.handleRecipes(ChemicalInfuserRecipe.class, ChemicalInfuserRecipeWrapper::new, "mekanism.chemical_infuser");
addRecipes(registry, Recipe.CHEMICAL_INFUSER, ChemicalInfuserRecipe.class, ChemicalInfuserRecipeWrapper.class, "mekanism.chemical_infuser");
registry.handleRecipes(OxidationRecipe.class, ChemicalOxidizerRecipeWrapper::new, "mekanism.chemical_oxidizer");
addRecipes(registry, Recipe.CHEMICAL_OXIDIZER, OxidationRecipe.class, ChemicalOxidizerRecipeWrapper.class, "mekanism.chemical_oxidizer");
registry.handleRecipes(WasherRecipe.class, ChemicalWasherRecipeWrapper::new, "mekanism.chemical_washer");
addRecipes(registry, Recipe.CHEMICAL_WASHER, WasherRecipe.class, ChemicalWasherRecipeWrapper.class, "mekanism.chemical_washer");
registry.handleRecipes(SolarNeutronRecipe.class, SolarNeutronRecipeWrapper::new, "mekanism.solar_neutron_activator");
addRecipes(registry, Recipe.SOLAR_NEUTRON_ACTIVATOR, SolarNeutronRecipe.class, SolarNeutronRecipeWrapper.class, "mekanism.solar_neutron_activator");
registry.handleRecipes(SeparatorRecipe.class, ElectrolyticSeparatorRecipeWrapper::new, "mekanism.electrolytic_separator");
addRecipes(registry, Recipe.ELECTROLYTIC_SEPARATOR, SeparatorRecipe.class, ElectrolyticSeparatorRecipeWrapper.class, "mekanism.electrolytic_separator");
registry.handleRecipes(ThermalEvaporationRecipe.class, ThermalEvaporationRecipeWrapper::new, "mekanism.thermal_evaporation_plant");
addRecipes(registry, Recipe.THERMAL_EVAPORATION_PLANT, ThermalEvaporationRecipe.class, ThermalEvaporationRecipeWrapper.class, "mekanism.thermal_evaporation_plant");
registry.handleRecipes(PressurizedRecipe.class, PRCRecipeWrapper::new, "mekanism.pressurized_reaction_chamber");
addRecipes(registry, Recipe.PRESSURIZED_REACTION_CHAMBER, PressurizedRecipe.class, PRCRecipeWrapper.class, "mekanism.pressurized_reaction_chamber");
//TODO Update these to new JEI API
List<RotaryCondensentratorRecipeWrapper> condensentratorRecipes = new ArrayList<RotaryCondensentratorRecipeWrapper>();
RotaryCondensentratorRecipeCategory rotaryCondensentratorCategory = new RotaryCondensentratorRecipeCategory(registry.getJeiHelpers().getGuiHelper());
@@ -229,8 +252,9 @@ public class MekanismJEI implements IModPlugin
condensentratorRecipes.add(new RotaryCondensentratorRecipeWrapper(gas.getFluid(), gas, false, rotaryCondensentratorCategory));
}
}
//-TODO
registry.addRecipes(condensentratorRecipes);
registry.addRecipes(condensentratorRecipes, rotaryCondensentratorCategory.getUid());
registry.addRecipeClickArea(GuiEnrichmentChamber.class, 79, 40, 24, 7, "mekanism.enrichment_chamber");
registry.addRecipeClickArea(GuiCrusher.class, 79, 40, 24, 7, "mekanism.crusher");
@@ -270,12 +294,16 @@ public class MekanismJEI implements IModPlugin
registerRecipeItem(registry, MachineType.PRESSURIZED_REACTION_CHAMBER);
registerRecipeItem(registry, MachineType.ROTARY_CONDENSENTRATOR);
registry.addRecipeCategoryCraftingItem(BasicBlockType.THERMAL_EVAPORATION_CONTROLLER.getStack(1), "mekanism.thermal_evaporation_plant");
registry.addRecipeCatalyst(BasicBlockType.THERMAL_EVAPORATION_CONTROLLER.getStack(1), "mekanism.thermal_evaporation_plant");
registry.addRecipeCatalyst(MachineType.FORMULAIC_ASSEMBLICATOR.getStack(), VanillaRecipeCategoryUid.CRAFTING);
registry.getRecipeTransferRegistry().addRecipeTransferHandler(ContainerFormulaicAssemblicator.class, VanillaRecipeCategoryUid.CRAFTING, 20, 9, 35, 36);
registry.getRecipeTransferRegistry().addRecipeTransferHandler(ContainerRobitInventory.class, VanillaRecipeCategoryUid.CRAFTING, 1, 9, 10, 36);
}
private void registerRecipeItem(IModRegistry registry, MachineType type)
{
registry.addRecipeCategoryCraftingItem(type.getStack(), "mekanism." + type.getName());
registry.addRecipeCatalyst(type.getStack(), "mekanism." + type.getName());
}
private void registerBasicMachine(IModRegistry registry, Recipe recipe, String unlocalized, ProgressBar bar, Class<? extends MachineRecipeWrapper> wrapper) throws Exception
@@ -291,7 +319,7 @@ public class MekanismJEI implements IModPlugin
private void registerAdvancedMachine(IModRegistry registry, Recipe recipe, String unlocalized, ProgressBar bar, Class<? extends AdvancedMachineRecipeWrapper> wrapper) throws Exception
{
AdvancedMachineRecipeCategory category = new AdvancedMachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), recipe.name().toLowerCase(), unlocalized, bar);
registry.addRecipeCategories(category);
registry.addRecipeHandlers(new BaseRecipeHandler(category, wrapper));
@@ -307,10 +335,34 @@ public class MekanismJEI implements IModPlugin
addRecipes(registry, recipe, category, ChanceMachineRecipe.class, ChanceMachineRecipeCategory.class, wrapper);
}
private void addRecipes(IModRegistry registry, Recipe type, Class recipe, Class<? extends IRecipeWrapper> wrapper, String recipeCategoryUid)
{
List<IRecipeWrapper> recipes = new ArrayList<>();
//add all recipes with wrapper to the list
for(Object obj : type.get().values())
{
if(obj instanceof MachineRecipe)
{
try
{
recipes.add(wrapper.getConstructor(recipe).newInstance(obj));
}
catch (InstantiationException | NoSuchMethodException | InvocationTargetException | IllegalAccessException e)
{
Mekanism.logger.fatal("Error registering JEI recipe: " + recipe.getName(), e);
}
}
}
registry.addRecipes(recipes, recipeCategoryUid);
}
@Deprecated //Will be removed soon!
private void addRecipes(IModRegistry registry, Recipe type, IRecipeCategory cat, Class recipe, Class category, Class<? extends IRecipeWrapper> wrapper) throws Exception
{
List<IRecipeWrapper> recipes = new ArrayList<IRecipeWrapper>();
List<IRecipeWrapper> recipes = new ArrayList<>();
for(Object obj : type.get().values())
{
@@ -0,0 +1,9 @@
@ParametersAreNonnullByDefault
@FieldsAreNonnullByDefault
@MethodsReturnNonnullByDefault
package mekanism.client.jei.gas;
import mcp.MethodsReturnNonnullByDefault;
import mekanism.common.util.FieldsAreNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -26,9 +26,6 @@ import net.minecraft.util.ResourceLocation;
public class AdvancedMachineRecipeCategory extends BaseRecipeCategory
{
public String recipeName;
public String unlocalizedName;
public IDrawable background;
public AdvancedMachineRecipe tempRecipe;
@@ -91,7 +88,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<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
initGas(gasStacks, 0, true, 33, 21, 6, 12, new GasStack(input.gasType, 1), false);
}
@@ -18,7 +18,6 @@ import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.util.ResourceLocation;
@@ -16,7 +16,6 @@ import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.util.ResourceLocation;
@@ -0,0 +1,9 @@
@ParametersAreNonnullByDefault
@FieldsAreNonnullByDefault
@MethodsReturnNonnullByDefault
package mekanism.client.jei.machine.advanced;
import mcp.MethodsReturnNonnullByDefault;
import mekanism.common.util.FieldsAreNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -0,0 +1,9 @@
@ParametersAreNonnullByDefault
@FieldsAreNonnullByDefault
@MethodsReturnNonnullByDefault
package mekanism.client.jei.machine.basic;
import mcp.MethodsReturnNonnullByDefault;
import mekanism.common.util.FieldsAreNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -0,0 +1,9 @@
@ParametersAreNonnullByDefault
@FieldsAreNonnullByDefault
@MethodsReturnNonnullByDefault
package mekanism.client.jei.machine.chance;
import mcp.MethodsReturnNonnullByDefault;
import mekanism.common.util.FieldsAreNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -57,7 +57,7 @@ public class ChemicalCrystallizerRecipeCategory extends BaseRecipeCategory
itemStacks.init(0, false, 130-xOffset, 56-yOffset);
itemStacks.set(0, tempRecipe.getOutput().output);
IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
initGas(gasStacks, 0, true, 6-xOffset, 5-yOffset, 16, 58, tempRecipe.getInput().ingredient, true);
}
@@ -1,27 +1,18 @@
package mekanism.client.jei.machine.chemical;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.CrystallizerRecipe;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.ItemStack;
public class ChemicalCrystallizerRecipeWrapper extends BaseRecipeWrapper
public class ChemicalCrystallizerRecipeWrapper implements IRecipeWrapper
{
public CrystallizerRecipe recipe;
public ChemicalCrystallizerRecipeCategory category;
public ChemicalCrystallizerRecipeWrapper(CrystallizerRecipe r, ChemicalCrystallizerRecipeCategory c)
public ChemicalCrystallizerRecipeWrapper(CrystallizerRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -30,10 +21,4 @@ public class ChemicalCrystallizerRecipeWrapper extends BaseRecipeWrapper
ingredients.setInput(GasStack.class, recipe.recipeInput.ingredient);
ingredients.setOutput(ItemStack.class, recipe.recipeOutput.output);
}
@Override
public ChemicalCrystallizerRecipeCategory getCategory()
{
return category;
}
}
@@ -58,7 +58,7 @@ public class ChemicalDissolutionChamberRecipeCategory extends BaseRecipeCategory
itemStacks.init(0, true, 25-xOffset, 35-yOffset);
itemStacks.set(0, tempRecipe.getInput().ingredient);
IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
initGas(gasStacks, 0, true, 6-xOffset, 5-yOffset, 16, 58, new GasStack(MekanismFluids.SulfuricAcid, 1), true);
initGas(gasStacks, 1, false, 134-xOffset, 14-yOffset, 16, 58, tempRecipe.getOutput().output, true);
@@ -1,22 +1,21 @@
package mekanism.client.jei.machine.chemical;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.MekanismFluids;
import mekanism.common.recipe.machines.DissolutionRecipe;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.ItemStack;
public class ChemicalDissolutionChamberRecipeWrapper extends BaseRecipeWrapper
public class ChemicalDissolutionChamberRecipeWrapper implements IRecipeWrapper
{
public DissolutionRecipe recipe;
public ChemicalDissolutionChamberRecipeCategory category;
public ChemicalDissolutionChamberRecipeWrapper(DissolutionRecipe r, ChemicalDissolutionChamberRecipeCategory c)
public ChemicalDissolutionChamberRecipeWrapper(DissolutionRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -26,10 +25,4 @@ public class ChemicalDissolutionChamberRecipeWrapper extends BaseRecipeWrapper
ingredients.setInput(ItemStack.class, recipe.recipeInput.ingredient);
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
}
@Override
public ChemicalDissolutionChamberRecipeCategory getCategory()
{
return category;
}
}
@@ -51,7 +51,7 @@ public class ChemicalInfuserRecipeCategory extends BaseRecipeCategory
tempRecipe = ((ChemicalInfuserRecipeWrapper)recipeWrapper).recipe;
}
IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
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);
@@ -3,20 +3,17 @@ package mekanism.client.jei.machine.chemical;
import java.util.Arrays;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.ChemicalInfuserRecipe;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
public class ChemicalInfuserRecipeWrapper extends BaseRecipeWrapper
public class ChemicalInfuserRecipeWrapper implements IRecipeWrapper
{
public ChemicalInfuserRecipe recipe;
public ChemicalInfuserRecipeCategory category;
public ChemicalInfuserRecipeWrapper(ChemicalInfuserRecipe r, ChemicalInfuserRecipeCategory c)
public ChemicalInfuserRecipeWrapper(ChemicalInfuserRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -25,10 +22,4 @@ public class ChemicalInfuserRecipeWrapper extends BaseRecipeWrapper
ingredients.setInputs(GasStack.class, Arrays.asList(recipe.recipeInput.leftGas, recipe.recipeInput.rightGas));
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
}
@Override
public ChemicalInfuserRecipeCategory getCategory()
{
return category;
}
}
@@ -75,7 +75,7 @@ public class ChemicalOxidizerRecipeCategory extends BaseRecipeCategory
itemStacks.init(0, true, 25-xOffset, 35-yOffset);
itemStacks.set(0, tempRecipe.getInput().ingredient);
IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
initGas(gasStacks, 0, false, 134-xOffset, 14-yOffset, 16, 58, tempRecipe.recipeOutput.output, true);
}
@@ -4,18 +4,18 @@ import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.OxidationRecipe;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.ItemStack;
public class ChemicalOxidizerRecipeWrapper extends BaseRecipeWrapper
public class ChemicalOxidizerRecipeWrapper implements IRecipeWrapper
{
public OxidationRecipe recipe;
public ChemicalOxidizerRecipeCategory category;
public ChemicalOxidizerRecipeWrapper(OxidationRecipe r, ChemicalOxidizerRecipeCategory c)
public ChemicalOxidizerRecipeWrapper(OxidationRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -24,10 +24,4 @@ public class ChemicalOxidizerRecipeWrapper extends BaseRecipeWrapper
ingredients.setInput(ItemStack.class, recipe.recipeInput.ingredient);
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
}
@Override
public ChemicalOxidizerRecipeCategory getCategory()
{
return category;
}
}
@@ -61,7 +61,7 @@ public class ChemicalWasherRecipeCategory extends BaseRecipeCategory
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
fluidStacks.addTooltipCallback((index, input, ingredient, tooltip) -> tooltip.remove(1));
IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
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);
@@ -1,28 +1,19 @@
package mekanism.client.jei.machine.chemical;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.WasherRecipe;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class ChemicalWasherRecipeWrapper extends BaseRecipeWrapper
public class ChemicalWasherRecipeWrapper implements IRecipeWrapper
{
public WasherRecipe recipe;
public ChemicalWasherRecipeCategory category;
public ChemicalWasherRecipeWrapper(WasherRecipe r, ChemicalWasherRecipeCategory c)
public ChemicalWasherRecipeWrapper(WasherRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -32,10 +23,4 @@ public class ChemicalWasherRecipeWrapper extends BaseRecipeWrapper
ingredients.setInput(GasStack.class, recipe.recipeInput.ingredient);
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
}
@Override
public ChemicalWasherRecipeCategory getCategory()
{
return category;
}
}
@@ -0,0 +1,9 @@
@ParametersAreNonnullByDefault
@FieldsAreNonnullByDefault
@MethodsReturnNonnullByDefault
package mekanism.client.jei.machine.chemical;
import mcp.MethodsReturnNonnullByDefault;
import mekanism.common.util.FieldsAreNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -49,8 +49,10 @@ public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory
public void addGuiElements()
{
guiElements.add(GuiFluidGauge.getDummy(GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 5, 10));
guiElements.add(leftGas = GuiGasGauge.getDummy(GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 18));
guiElements.add(rightGas = GuiGasGauge.getDummy(GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18));
leftGas = GuiGasGauge.getDummy(GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 18);
guiElements.add(leftGas);
rightGas = GuiGasGauge.getDummy(GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18);
guiElements.add(rightGas);
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
@Override
public double getLevel()
@@ -94,7 +96,7 @@ public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
fluidStacks.addTooltipCallback((index, input, ingredient, tooltip) -> tooltip.remove(1));
IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
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);
@@ -6,18 +6,16 @@ import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.SeparatorRecipe;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraftforge.fluids.FluidStack;
public class ElectrolyticSeparatorRecipeWrapper extends BaseRecipeWrapper
public class ElectrolyticSeparatorRecipeWrapper implements IRecipeWrapper
{
public SeparatorRecipe recipe;
public ElectrolyticSeparatorRecipeCategory category;
public ElectrolyticSeparatorRecipeWrapper(SeparatorRecipe r, ElectrolyticSeparatorRecipeCategory c)
public ElectrolyticSeparatorRecipeWrapper(SeparatorRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -26,10 +24,4 @@ public class ElectrolyticSeparatorRecipeWrapper extends BaseRecipeWrapper
ingredients.setInput(FluidStack.class, recipe.recipeInput.ingredient);
ingredients.setOutputs(GasStack.class, Arrays.asList(recipe.recipeOutput.leftGas, recipe.recipeOutput.rightGas));
}
@Override
public ElectrolyticSeparatorRecipeCategory getCategory()
{
return category;
}
}
@@ -1,23 +1,20 @@
package mekanism.client.jei.machine.other;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.ItemStack;
import java.util.Arrays;
import java.util.List;
public class MetallurgicInfuserRecipeWrapper extends BaseRecipeWrapper
public class MetallurgicInfuserRecipeWrapper implements IRecipeWrapper
{
public MetallurgicInfuserRecipe recipe;
public MetallurgicInfuserRecipeCategory category;
public MetallurgicInfuserRecipeWrapper(MetallurgicInfuserRecipe r, MetallurgicInfuserRecipeCategory c)
public MetallurgicInfuserRecipeWrapper(MetallurgicInfuserRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -30,10 +27,4 @@ public class MetallurgicInfuserRecipeWrapper extends BaseRecipeWrapper
ingredients.setInputLists(ItemStack.class, Arrays.asList(inputStacks, infuseStacks));
ingredients.setOutput(ItemStack.class, recipe.recipeOutput.output);
}
@Override
public MetallurgicInfuserRecipeCategory getCategory()
{
return category;
}
}
@@ -59,8 +59,10 @@ public class PRCRecipeCategory extends BaseRecipeCategory
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, guiLocation, 115, 34));
guiElements.add(GuiFluidGauge.getDummy(GuiGauge.Type.STANDARD_YELLOW, this, guiLocation, 5, 10));
guiElements.add(gasInput = GuiGasGauge.getDummy(GuiGauge.Type.STANDARD_RED, this, guiLocation, 28, 10));
guiElements.add(gasOutput = GuiGasGauge.getDummy(GuiGauge.Type.SMALL_BLUE, this, guiLocation, 140, 40));
gasInput = GuiGasGauge.getDummy(GuiGauge.Type.STANDARD_RED, this, guiLocation, 28, 10);
guiElements.add(gasInput);
gasOutput = GuiGasGauge.getDummy(GuiGauge.Type.SMALL_BLUE, this, guiLocation, 140, 40);
guiElements.add(gasOutput);
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
@Override
@@ -107,7 +109,7 @@ public class PRCRecipeCategory extends BaseRecipeCategory
fluidStacks.set(0, tempRecipe.recipeInput.getFluid());
fluidStacks.addTooltipCallback((index, input, ingredient, tooltip) -> tooltip.remove(1));
IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
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);
@@ -4,19 +4,17 @@ import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.PressurizedRecipe;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class PRCRecipeWrapper extends BaseRecipeWrapper
public class PRCRecipeWrapper implements IRecipeWrapper
{
public PressurizedRecipe recipe;
public PRCRecipeCategory category;
public PRCRecipeWrapper(PressurizedRecipe r, PRCRecipeCategory c)
public PRCRecipeWrapper(PressurizedRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -28,10 +26,4 @@ public class PRCRecipeWrapper extends BaseRecipeWrapper
ingredients.setOutput(ItemStack.class, recipe.recipeOutput.getItemOutput());
ingredients.setOutput(GasStack.class, recipe.recipeOutput.getGasOutput());
}
@Override
public PRCRecipeCategory getCategory()
{
return category;
}
}
@@ -58,7 +58,7 @@ public class RotaryCondensentratorRecipeCategory extends BaseRecipeCategory
}
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
fluidStacks.init(0, !tempRecipe.condensentrating, 134-xOffset, 14-yOffset, 16, 58, 1000, false, fluidOverlayLarge);
@@ -8,7 +8,6 @@ import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@@ -50,7 +50,7 @@ public class SolarNeutronRecipeCategory extends BaseRecipeCategory
tempRecipe = ((SolarNeutronRecipeWrapper)recipeWrapper).recipe;
}
IGuiIngredientGroup gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(GasStack.class);
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);
@@ -4,17 +4,17 @@ import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.SolarNeutronRecipe;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
public class SolarNeutronRecipeWrapper extends BaseRecipeWrapper
public class SolarNeutronRecipeWrapper implements IRecipeWrapper
{
public SolarNeutronRecipe recipe;
public SolarNeutronRecipeCategory category;
public SolarNeutronRecipeWrapper(SolarNeutronRecipe r, SolarNeutronRecipeCategory c)
public SolarNeutronRecipeWrapper(SolarNeutronRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -23,10 +23,4 @@ public class SolarNeutronRecipeWrapper extends BaseRecipeWrapper
ingredients.setInput(GasStack.class, recipe.getInput().ingredient);
ingredients.setOutput(GasStack.class, recipe.getOutput().output);
}
@Override
public SolarNeutronRecipeCategory getCategory()
{
return category;
}
}
@@ -1,20 +1,17 @@
package mekanism.client.jei.machine.other;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraftforge.fluids.FluidStack;
public class ThermalEvaporationRecipeWrapper extends BaseRecipeWrapper
public class ThermalEvaporationRecipeWrapper implements IRecipeWrapper
{
public ThermalEvaporationRecipe recipe;
public ThermalEvaporationRecipeCategory category;
public ThermalEvaporationRecipeWrapper(ThermalEvaporationRecipe r, ThermalEvaporationRecipeCategory c)
public ThermalEvaporationRecipeWrapper(ThermalEvaporationRecipe r)
{
recipe = r;
category = c;
}
@Override
@@ -23,10 +20,4 @@ public class ThermalEvaporationRecipeWrapper extends BaseRecipeWrapper
ingredients.setInput(FluidStack.class, recipe.getInput().ingredient);
ingredients.setOutput(FluidStack.class, recipe.getOutput().output);
}
@Override
public ThermalEvaporationRecipeCategory getCategory()
{
return category;
}
}
@@ -0,0 +1,9 @@
@ParametersAreNonnullByDefault
@FieldsAreNonnullByDefault
@MethodsReturnNonnullByDefault
package mekanism.client.jei.machine.other;
import mcp.MethodsReturnNonnullByDefault;
import mekanism.common.util.FieldsAreNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -0,0 +1,9 @@
@ParametersAreNonnullByDefault
@FieldsAreNonnullByDefault
@MethodsReturnNonnullByDefault
package mekanism.client.jei.machine;
import mcp.MethodsReturnNonnullByDefault;
import mekanism.common.util.FieldsAreNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -0,0 +1,8 @@
@ParametersAreNonnullByDefault
@FieldsAreNonnullByDefault
@MethodsReturnNonnullByDefault
package mekanism.client.jei;
import mcp.MethodsReturnNonnullByDefault;
import mekanism.common.util.FieldsAreNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -0,0 +1,14 @@
package mekanism.common.util;
import javax.annotation.Nonnull;
import javax.annotation.meta.TypeQualifierDefault;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Nonnull
@TypeQualifierDefault(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface FieldsAreNonnullByDefault
{
}