Skip to content

Commit 9642e6d

Browse files
authored
Infusion Crafting name usage (#319)
* use name field for infusion crafting * fix crucible not being documented as using output
1 parent b12ed5f commit 9642e6d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/main/java/com/cleanroommc/groovyscript/compat/mods/thaumcraft/Crucible.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public void removeAll() {
120120
}
121121
}
122122

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

125126
@Property

src/main/java/com/cleanroommc/groovyscript/compat/mods/thaumcraft/InfusionCrafting.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import com.cleanroommc.groovyscript.helper.SimpleObjectStream;
1010
import com.cleanroommc.groovyscript.helper.ingredient.IngredientHelper;
1111
import com.cleanroommc.groovyscript.helper.recipe.AbstractRecipeBuilder;
12-
import com.cleanroommc.groovyscript.helper.recipe.RecipeName;
1312
import com.cleanroommc.groovyscript.registry.VirtualizedRegistry;
1413
import net.minecraft.item.ItemStack;
1514
import net.minecraft.util.ResourceLocation;
@@ -127,6 +126,9 @@ public void removeAll() {
127126
}
128127
}
129128

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

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

143+
@Override
144+
public String getRecipeNamePrefix() {
145+
return "infusion_matrix_recipe";
146+
}
147+
141148
@RecipeBuilderMethodDescription
142149
public RecipeBuilder mainInput(IIngredient ingredient) {
143150
this.mainInput = ingredient;
@@ -204,7 +211,7 @@ protected int getMaxItemInput() {
204211

205212
@Override
206213
public void validate(GroovyLog.Msg msg) {
207-
validateItems(msg, 1, 100, 1, 1);
214+
validateItems(msg, 1, Integer.MAX_VALUE, 1, 1);
208215
msg.add(IngredientHelper.isEmpty(mainInput), () -> "Main Input must not be empty");
209216
// More than 1 item cannot be placed
210217
validateStackSize(msg, 1, "mainInput", mainInput);
@@ -214,6 +221,7 @@ public void validate(GroovyLog.Msg msg) {
214221
if (instability < 0) {
215222
instability = 0;
216223
}
224+
validateName();
217225
}
218226

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

224232
Object[] inputs = this.input.stream().map(IIngredient::toMcIngredient).toArray();
225233
InfusionRecipe recipe = new InfusionRecipe(researchKey, output.get(0), instability, aspects, mainInput.toMcIngredient(), inputs);
226-
ModSupport.THAUMCRAFT.get().infusionCrafting.add(RecipeName.generateRl("infusion_matrix_recipe"), recipe);
234+
ModSupport.THAUMCRAFT.get().infusionCrafting.add(super.name, recipe);
227235
return recipe;
228236
}
229237
}

0 commit comments

Comments
 (0)