diff --git a/examples/postInit/betterwithaddons.groovy b/examples/postInit/betterwithaddons.groovy index f99d870f2..76f8849b1 100644 --- a/examples/postInit/betterwithaddons.groovy +++ b/examples/postInit/betterwithaddons.groovy @@ -141,7 +141,7 @@ mods.betterwithaddons.rotting.recipeBuilder() .register() mods.betterwithaddons.rotting.recipeBuilder() - .input(item('placeholdername:snack')) + .input(item('minecraft:apple')) .time(100) .key('groovy_example') .rotted(item('minecraft:clay') * 4) diff --git a/examples/postInit/betterwithmods.groovy b/examples/postInit/betterwithmods.groovy index 0a7d1cbd6..1b529fe68 100644 --- a/examples/postInit/betterwithmods.groovy +++ b/examples/postInit/betterwithmods.groovy @@ -42,7 +42,7 @@ mods.betterwithmods.cauldron.removeByOutput(item('minecraft:gunpowder')) // mods.betterwithmods.cauldron.removeAll() mods.betterwithmods.cauldron.recipeBuilder() - .input(item('minecraft:clay')) + .input(item('minecraft:clay') * 3) .output(item('minecraft:diamond')) .heat(2) .register() @@ -62,7 +62,7 @@ mods.betterwithmods.crucible.removeByOutput(item('minecraft:gunpowder')) // mods.betterwithmods.crucible.removeAll() mods.betterwithmods.crucible.recipeBuilder() - .input(item('minecraft:clay')) + .input(item('minecraft:clay') * 3) .output(item('minecraft:diamond')) .heat(2) .register() @@ -98,7 +98,7 @@ mods.betterwithmods.hopper.recipeBuilder() mods.betterwithmods.hopper.recipeBuilder() .name('betterwithmods:wicker') - .input(item('minecraft:clay')) + .input(item('minecraft:clay') * 3) .inWorldItemOutput(item('minecraft:gold_ingot')) .register() @@ -150,7 +150,7 @@ mods.betterwithmods.mill_stone.removeByOutput(item('minecraft:blaze_powder')) // mods.betterwithmods.mill_stone.removeAll() mods.betterwithmods.mill_stone.recipeBuilder() - .input(item('minecraft:diamond')) + .input(item('minecraft:diamond') * 3) .output(item('minecraft:gold_ingot') * 16) .register() diff --git a/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithaddons/Rotting.java b/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithaddons/Rotting.java index 22be4e306..b88b4d93b 100644 --- a/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithaddons/Rotting.java +++ b/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithaddons/Rotting.java @@ -39,7 +39,7 @@ public boolean isEnabled() { @RecipeBuilderDescription(example = { @Example(".input(item('minecraft:gold_ingot'))"), - @Example(".input(item('placeholdername:snack')).time(100).key('groovy_example').rotted(item('minecraft:clay') * 4)") + @Example(".input(item('minecraft:apple')).time(100).key('groovy_example').rotted(item('minecraft:clay') * 4)") }) public RecipeBuilder recipeBuilder() { return new RecipeBuilder(); diff --git a/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithmods/BetterWithMods.java b/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithmods/BetterWithMods.java index ca3afc008..2d2344a1f 100644 --- a/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithmods/BetterWithMods.java +++ b/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithmods/BetterWithMods.java @@ -1,6 +1,9 @@ package com.cleanroommc.groovyscript.compat.mods.betterwithmods; +import betterwithmods.util.StackIngredient; +import com.cleanroommc.groovyscript.api.IIngredient; import com.cleanroommc.groovyscript.compat.mods.GroovyPropertyContainer; +import net.minecraft.item.crafting.Ingredient; public class BetterWithMods extends GroovyPropertyContainer { @@ -14,4 +17,17 @@ public class BetterWithMods extends GroovyPropertyContainer { public final Heat heat = new Heat(); public final Hopper hopper = new Hopper(); public final HopperFilters hopperFilters = new HopperFilters(); + + public static class Helper { + + /** + * Because Better With Mods checks if the ingredient is an instanceof {@link StackIngredient} + * to determine if the Ingredient has an amount, we have to use their custom Ingredient. + *
+ * If this isn't used, then the recipe may appear correctly in JEI but will actually only consume 1 when done in-game.
+ */
+ public static Ingredient fromIIngredient(IIngredient ingredient) {
+ return StackIngredient.fromIngredient(ingredient.getAmount(), ingredient.toMcIngredient());
+ }
+ }
}
diff --git a/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithmods/Cauldron.java b/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithmods/Cauldron.java
index e13d0f1fe..508efad65 100644
--- a/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithmods/Cauldron.java
+++ b/src/main/java/com/cleanroommc/groovyscript/compat/mods/betterwithmods/Cauldron.java
@@ -19,7 +19,7 @@
public class Cauldron extends StandardListRegistry