Skip to content

Commit

Permalink
add Blood Magic compat
Browse files Browse the repository at this point in the history
  • Loading branch information
rlnt committed Mar 17, 2024
1 parent 38b08e2 commit 01c3d90
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning].

## Unreleased

### Added
- added support for Blood Magic

### Fixed
- fixed `show_notification` recipe key not being ignored by default

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public final class ModConstants {
public static final String ARS_ELEMENTAL = "ars_elemental";
public static final String ARS_NOUVEAU = "ars_nouveau";
public static final String ARS_SCALAES = "ars_scalaes";
public static final String BLOOD_MAGIC = "bloodmagic";
public static final String CYCLIC = "cyclic";
public static final String ENDER_IO = "enderio";
public static final String GREGTECH_MODERN = "gtceu";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void bindRecipeHandlers(RecipeHandlerFactory factory) {
ModConstants.ARS_NOUVEAU,
ModConstants.ARS_SCALAES
).forEach(modId -> factory.registerForMod(modId, new ArsNouveauRecipeUnifier()));
factory.registerForMod(ModConstants.BLOOD_MAGIC, new BloodMagicRecipeUnifier());
factory.registerForMod(ModConstants.CYCLIC, new CyclicRecipeUnifier());
factory.registerForMod(ModConstants.ENDER_IO, new EnderIORecipeUnifier());
factory.registerForMod(ModConstants.GREGTECH_MODERN, new GregTechModernRecipeUnifier());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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;

import java.util.List;

public class BloodMagicRecipeUnifier implements RecipeUnifier {

public static final String ADDED_INPUT = "addedinput";
public static final String ADDED_OUTPUT = "addedoutput";
public static final String BASE_INPUT = "baseinput";
public static final String INPUT0 = "input0";
public static final String INPUT1 = "input1";
public static final String INPUT2 = "input2";
public static final String INPUT3 = "input3";
public static final String TOOL = "tool";
public static final String TYPE = "type";

@Override
public void collectUnifier(RecipeUnifierBuilder builder) {
List.of(
// arc
TOOL,
// array
ADDED_INPUT,
BASE_INPUT,
// soulforge
INPUT0,
INPUT1,
INPUT2,
INPUT3
).forEach(key -> builder.put(key, (json, ctx) -> ctx.createIngredientReplacement(json)));

// arc
builder.put(ADDED_OUTPUT, (json, ctx) -> ctx.createResultReplacement(json, false, TYPE, RecipeConstants.ITEM));
}
}

0 comments on commit 01c3d90

Please sign in to comment.