Skip to content

Commit c93aff7

Browse files
authored
Fix stackoverflow & update GroovyScript (#2657)
1 parent 3328f2e commit c93aff7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencies {
4141
// Published dependencies
4242
api("codechicken:codechickenlib:3.2.3.358")
4343
api("com.cleanroommc:modularui:2.5.0-rc1") { transitive = false }
44-
api("com.cleanroommc:groovyscript:1.1.1") { transitive = false }
44+
api("com.cleanroommc:groovyscript:1.2.0-hotfix1") { transitive = false }
4545
api("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.700")
4646
api("appeng:ae2-uel:v0.56.4") { transitive = false }
4747
api rfg.deobf("curse.maven:ctm-267602:2915363") // CTM 1.0.2.31

src/main/java/gregtech/GregTechMod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
dependencies = "required:forge@[14.23.5.2847,);" + "required-after:codechickenlib@[3.2.3,);" +
3434
"required-after:modularui@[2.3,);" + "required-after:mixinbooter@[8.0,);" + "after:appliedenergistics2;" +
3535
"after:forestry;" + "after:extrabees;" + "after:extratrees;" + "after:genetics;" + "after:magicbees;" +
36-
"after:jei@[4.15.0,);" + "after:crafttweaker@[4.1.20,);" + "after:groovyscript@[1.1.0,);" +
36+
"after:jei@[4.15.0,);" + "after:crafttweaker@[4.1.20,);" + "after:groovyscript@[1.2.0,);" +
3737
"after:theoneprobe;" + "after:hwyla;")
3838
public class GregTechMod {
3939

src/main/java/gregtech/integration/groovy/GrSRecipeHelper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import net.minecraft.item.ItemStack;
99

10-
import com.cleanroommc.groovyscript.helper.ingredient.IngredientHelper;
10+
import com.cleanroommc.groovyscript.helper.ingredient.GroovyScriptCodeConverter;
1111
import com.cleanroommc.groovyscript.helper.ingredient.NbtHelper;
1212

1313
public class GrSRecipeHelper {
@@ -20,7 +20,7 @@ public static String getRecipeRemoveLine(RecipeMap<?> recipeMap, Recipe recipe)
2020
.append(recipe.getEUt())
2121
.append(", ");
2222

23-
if (recipe.getInputs().size() > 0) {
23+
if (!recipe.getInputs().isEmpty()) {
2424
builder.append("[");
2525
for (GTRecipeInput ci : recipe.getInputs()) {
2626
String ingredient = getGroovyItemString(ci);
@@ -32,10 +32,10 @@ public static String getRecipeRemoveLine(RecipeMap<?> recipeMap, Recipe recipe)
3232
builder.append("null, ");
3333
}
3434

35-
if (recipe.getFluidInputs().size() > 0) {
35+
if (!recipe.getFluidInputs().isEmpty()) {
3636
builder.append("[");
3737
for (GTRecipeInput fluidIngredient : recipe.getFluidInputs()) {
38-
builder.append(IngredientHelper.asGroovyCode(fluidIngredient.getInputFluidStack(), false));
38+
builder.append(GroovyScriptCodeConverter.asGroovyCode(fluidIngredient.getInputFluidStack(), false));
3939

4040
if (fluidIngredient.getAmount() > 1) {
4141
builder.append(" * ")
@@ -72,7 +72,7 @@ public static String getGroovyItemString(GTRecipeInput recipeInput) {
7272
}
7373
if (itemStack != null) {
7474
if (itemId == null) {
75-
builder.append(IngredientHelper.asGroovyCode(itemStack, false));
75+
builder.append(GroovyScriptCodeConverter.asGroovyCode(itemStack, false));
7676
}
7777

7878
if (itemStack.getTagCompound() != null) {

src/main/java/gregtech/integration/groovy/GroovyExpansions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static Material.Builder materialBuilder(MaterialEvent event, int id, Reso
2929
}
3030

3131
public static Material.Builder materialBuilder(MaterialEvent event, int id, String domain, String path) {
32-
return materialBuilder(event, id, domain, path);
32+
return materialBuilder(event, id, new ResourceLocation(domain, path));
3333
}
3434

3535
public static Material.Builder materialBuilder(MaterialEvent event, int id, String s) {

0 commit comments

Comments
 (0)