Implement remaining IE handler

This commit is contained in:
LLytho 2022-06-21 21:28:21 +02:00
parent 804cd45128
commit eddbd81739
4 changed files with 21 additions and 5 deletions

View file

@ -4,6 +4,7 @@ public class RecipeConstants {
public static final String ITEM = "item";
public static final String TAG = "tag";
public static final String INPUT = "input";
public static final String INPUTS = "inputs";
public static final String INGREDIENT = "ingredient";
public static final String INGREDIENTS = "ingredients";
public static final String OUTPUT = "output";

View file

@ -11,7 +11,7 @@ public class AlmostUnifiedRuntimeForge extends AlmostUnifiedRuntime {
@Override
protected void onRun() {
if(AlmostUnifiedPlatform.INSTANCE.isModLoaded(ModConstants.IE)) {
if (AlmostUnifiedPlatform.INSTANCE.isModLoaded(ModConstants.IE)) {
IEModPriorityOverride.overrideModPriorities(modPriorities).run();
}
}

View file

@ -18,10 +18,19 @@ public class IERecipeHandler implements RecipeHandler {
@Override
public void transformRecipe(JsonObject json, RecipeContext context) {
// alloy recipes
replaceIEIngredient(json.get("input0"), context);
replaceIEIngredient(json.get("input1"), context);
replaceIEResult(json.get("secondaries"), context);
replaceIEIngredient(json.get("input0"), context); // alloy recipes, refinery
replaceIEIngredient(json.get("input1"), context); // alloy recipes, refinery
replaceIEIngredient(json.get(RecipeConstants.INPUT),
context); // arc furnace, squeezer, cloche, coke oven, fermenter, fertilizer, metal_press
replaceIEIngredient(json.get("additives"), context); // arc furnace
replaceIEIngredient(json.get(RecipeConstants.INPUTS), context); // blueprint, mixer
replaceIEResult(json.get("secondaries"), context); // alloy recipes, crusher
JsonUtils.arrayForEach(json.get("secondaries"), JsonObject.class, secondary -> {
replaceIEResult(secondary.get(RecipeConstants.OUTPUT), context);
});
replaceIEResult(json.get(RecipeConstants.RESULT), context);
replaceIEResult(json.get(RecipeConstants.RESULTS), context);

View file

@ -0,0 +1,6 @@
@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault
package com.almostreliable.unified.compat;
import net.minecraft.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;