mirror of
https://github.com/AlmostReliable/almostunified.git
synced 2024-11-23 16:18:24 -05:00
Add support for amethyst imbuement
This commit is contained in:
parent
2e50963fe0
commit
bed00c9415
3 changed files with 33 additions and 1 deletions
|
@ -3,6 +3,7 @@ package com.almostreliable.unified.api;
|
|||
@SuppressWarnings("SpellCheckingInspection")
|
||||
public final class ModConstants {
|
||||
public static final String IE = "immersiveengineering";
|
||||
public static final String AMETHYST_IMBUEMENT = "amethyst_imbuement";
|
||||
|
||||
private ModConstants() {}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.almostreliable.unified;
|
||||
|
||||
import com.almostreliable.unified.api.ModConstants;
|
||||
import com.almostreliable.unified.compat.AmethystImbuementRecipeUnifier;
|
||||
import com.almostreliable.unified.recipe.unifier.RecipeHandlerFactory;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
@ -40,6 +42,6 @@ public class AlmostUnifiedPlatformFabric implements AlmostUnifiedPlatform {
|
|||
|
||||
@Override
|
||||
public void bindRecipeHandlers(RecipeHandlerFactory factory) {
|
||||
|
||||
factory.registerForMod(ModConstants.AMETHYST_IMBUEMENT, new AmethystImbuementRecipeUnifier());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package com.almostreliable.unified.compat;
|
||||
|
||||
import com.almostreliable.unified.api.recipe.RecipeUnifier;
|
||||
import com.almostreliable.unified.api.recipe.RecipeUnifierBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("SpellCheckingInspection")
|
||||
public class AmethystImbuementRecipeUnifier implements RecipeUnifier {
|
||||
@Override
|
||||
public void collectUnifier(RecipeUnifierBuilder builder) {
|
||||
final List<String> fields = List.of("imbueA",
|
||||
"imbueB",
|
||||
"imbueC",
|
||||
"imbueD",
|
||||
"craftA",
|
||||
"craftB",
|
||||
"craftC",
|
||||
"craftD",
|
||||
"craftE",
|
||||
"craftF",
|
||||
"craftG",
|
||||
"craftH",
|
||||
"craftI");
|
||||
|
||||
fields.forEach(field -> builder.put(field, (json, ctx) -> ctx.createIngredientReplacement(json)));
|
||||
builder.put("resultA", (json, ctx) -> ctx.createResultReplacement(json));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue