diff --git a/Common/src/main/java/com/almostreliable/unified/api/ModConstants.java b/Common/src/main/java/com/almostreliable/unified/api/ModConstants.java index f72f574..96ffdf0 100644 --- a/Common/src/main/java/com/almostreliable/unified/api/ModConstants.java +++ b/Common/src/main/java/com/almostreliable/unified/api/ModConstants.java @@ -5,6 +5,7 @@ public final class ModConstants { public static final String IE = "immersiveengineering"; public static final String AMETHYST_IMBUEMENT = "amethyst_imbuement"; public static final String AD_ASTRA = "ad_astra"; + public static final String MEKANISM = "mekanism"; private ModConstants() {} } diff --git a/Common/src/main/java/com/almostreliable/unified/api/recipe/RecipeConstants.java b/Common/src/main/java/com/almostreliable/unified/api/recipe/RecipeConstants.java index 1767f30..9ccd196 100644 --- a/Common/src/main/java/com/almostreliable/unified/api/recipe/RecipeConstants.java +++ b/Common/src/main/java/com/almostreliable/unified/api/recipe/RecipeConstants.java @@ -18,6 +18,9 @@ public final class RecipeConstants { public static final String ADDITIVES = "additives"; public static final String SECONDARIES = "secondaries"; public static final String SLAG = "slag"; + public static final String MAIN_INPUT = "mainInput"; + public static final String MAIN_OUTPUT = "mainOutput"; + public static final String SECONDARY_OUTPUT = "secondaryOutput"; - private RecipeConstants() {} + private RecipeConstants() {} } diff --git a/Forge/src/main/java/com/almostreliable/unified/AlmostUnifiedPlatformForge.java b/Forge/src/main/java/com/almostreliable/unified/AlmostUnifiedPlatformForge.java index bb5fe46..2da20d7 100644 --- a/Forge/src/main/java/com/almostreliable/unified/AlmostUnifiedPlatformForge.java +++ b/Forge/src/main/java/com/almostreliable/unified/AlmostUnifiedPlatformForge.java @@ -3,6 +3,7 @@ package com.almostreliable.unified; import com.almostreliable.unified.api.ModConstants; import com.almostreliable.unified.compat.AdAstraRecipeUnifier; import com.almostreliable.unified.compat.IERecipeUnifier; +import com.almostreliable.unified.compat.MekanismRecipeUnifier; import com.almostreliable.unified.recipe.unifier.RecipeHandlerFactory; import com.almostreliable.unified.utils.UnifyTag; import com.google.auto.service.AutoService; @@ -59,6 +60,7 @@ public class AlmostUnifiedPlatformForge implements AlmostUnifiedPlatform { @Override public void bindRecipeHandlers(RecipeHandlerFactory factory) { factory.registerForMod(ModConstants.AD_ASTRA, new AdAstraRecipeUnifier()); + factory.registerForMod(ModConstants.MEKANISM, new MekanismRecipeUnifier()); factory.registerForMod(ModConstants.IE, new IERecipeUnifier()); } diff --git a/Forge/src/main/java/com/almostreliable/unified/compat/MekanismRecipeUnifier.java b/Forge/src/main/java/com/almostreliable/unified/compat/MekanismRecipeUnifier.java new file mode 100644 index 0000000..31d5fc0 --- /dev/null +++ b/Forge/src/main/java/com/almostreliable/unified/compat/MekanismRecipeUnifier.java @@ -0,0 +1,15 @@ +package com.almostreliable.unified.compat; + +import com.almostreliable.unified.api.recipe.RecipeConstants; +import com.almostreliable.unified.api.recipe.RecipeUnifier; +import com.almostreliable.unified.api.recipe.RecipeUnifierBuilder; + +public class MekanismRecipeUnifier implements RecipeUnifier { + + @Override + public void collectUnifier(RecipeUnifierBuilder builder) { + builder.put(RecipeConstants.MAIN_INPUT, (json, ctx) -> ctx.createIngredientReplacement(json)); + builder.put(RecipeConstants.MAIN_OUTPUT, (json, ctx) -> ctx.createResultReplacement(json)); + builder.put(RecipeConstants.SECONDARY_OUTPUT, (json, ctx) -> ctx.createResultReplacement(json)); + } +}