Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public void removeAll() {
}
}

@Property(property = "output", comp = @Comp(eq = 1))
public static class RecipeBuilder extends AbstractRecipeBuilder<CrucibleRecipe> {

@Property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.cleanroommc.groovyscript.helper.SimpleObjectStream;
import com.cleanroommc.groovyscript.helper.ingredient.IngredientHelper;
import com.cleanroommc.groovyscript.helper.recipe.AbstractRecipeBuilder;
import com.cleanroommc.groovyscript.helper.recipe.RecipeName;
import com.cleanroommc.groovyscript.registry.VirtualizedRegistry;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
Expand Down Expand Up @@ -127,6 +126,9 @@ public void removeAll() {
}
}

@Property(property = "input", comp = @Comp(gte = 1))
@Property(property = "output", comp = @Comp(eq = 1))
@Property(property = "name")
public static class RecipeBuilder extends AbstractRecipeBuilder<InfusionRecipe> {

@Property(comp = @Comp(not = "null"))
Expand All @@ -138,6 +140,11 @@ public static class RecipeBuilder extends AbstractRecipeBuilder<InfusionRecipe>
@Property
private int instability;

@Override
public String getRecipeNamePrefix() {
return "infusion_matrix_recipe";
}

@RecipeBuilderMethodDescription
public RecipeBuilder mainInput(IIngredient ingredient) {
this.mainInput = ingredient;
Expand Down Expand Up @@ -204,7 +211,7 @@ protected int getMaxItemInput() {

@Override
public void validate(GroovyLog.Msg msg) {
validateItems(msg, 1, 100, 1, 1);
validateItems(msg, 1, Integer.MAX_VALUE, 1, 1);
msg.add(IngredientHelper.isEmpty(mainInput), () -> "Main Input must not be empty");
// More than 1 item cannot be placed
validateStackSize(msg, 1, "mainInput", mainInput);
Expand All @@ -214,6 +221,7 @@ public void validate(GroovyLog.Msg msg) {
if (instability < 0) {
instability = 0;
}
validateName();
}

@Override
Expand All @@ -223,7 +231,7 @@ public void validate(GroovyLog.Msg msg) {

Object[] inputs = this.input.stream().map(IIngredient::toMcIngredient).toArray();
InfusionRecipe recipe = new InfusionRecipe(researchKey, output.get(0), instability, aspects, mainInput.toMcIngredient(), inputs);
ModSupport.THAUMCRAFT.get().infusionCrafting.add(RecipeName.generateRl("infusion_matrix_recipe"), recipe);
ModSupport.THAUMCRAFT.get().infusionCrafting.add(super.name, recipe);
return recipe;
}
}
Expand Down