Skip to content

Commit

Permalink
Fix stackoverflow & update GroovyScript (#2657)
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 authored Nov 10, 2024
1 parent 3328f2e commit c93aff7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies {
// Published dependencies
api("codechicken:codechickenlib:3.2.3.358")
api("com.cleanroommc:modularui:2.5.0-rc1") { transitive = false }
api("com.cleanroommc:groovyscript:1.1.1") { transitive = false }
api("com.cleanroommc:groovyscript:1.2.0-hotfix1") { transitive = false }
api("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.700")
api("appeng:ae2-uel:v0.56.4") { transitive = false }
api rfg.deobf("curse.maven:ctm-267602:2915363") // CTM 1.0.2.31
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregtech/GregTechMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
dependencies = "required:forge@[14.23.5.2847,);" + "required-after:codechickenlib@[3.2.3,);" +
"required-after:modularui@[2.3,);" + "required-after:mixinbooter@[8.0,);" + "after:appliedenergistics2;" +
"after:forestry;" + "after:extrabees;" + "after:extratrees;" + "after:genetics;" + "after:magicbees;" +
"after:jei@[4.15.0,);" + "after:crafttweaker@[4.1.20,);" + "after:groovyscript@[1.1.0,);" +
"after:jei@[4.15.0,);" + "after:crafttweaker@[4.1.20,);" + "after:groovyscript@[1.2.0,);" +
"after:theoneprobe;" + "after:hwyla;")
public class GregTechMod {

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/gregtech/integration/groovy/GrSRecipeHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import net.minecraft.item.ItemStack;

import com.cleanroommc.groovyscript.helper.ingredient.IngredientHelper;
import com.cleanroommc.groovyscript.helper.ingredient.GroovyScriptCodeConverter;
import com.cleanroommc.groovyscript.helper.ingredient.NbtHelper;

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

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

if (recipe.getFluidInputs().size() > 0) {
if (!recipe.getFluidInputs().isEmpty()) {
builder.append("[");
for (GTRecipeInput fluidIngredient : recipe.getFluidInputs()) {
builder.append(IngredientHelper.asGroovyCode(fluidIngredient.getInputFluidStack(), false));
builder.append(GroovyScriptCodeConverter.asGroovyCode(fluidIngredient.getInputFluidStack(), false));

if (fluidIngredient.getAmount() > 1) {
builder.append(" * ")
Expand Down Expand Up @@ -72,7 +72,7 @@ public static String getGroovyItemString(GTRecipeInput recipeInput) {
}
if (itemStack != null) {
if (itemId == null) {
builder.append(IngredientHelper.asGroovyCode(itemStack, false));
builder.append(GroovyScriptCodeConverter.asGroovyCode(itemStack, false));
}

if (itemStack.getTagCompound() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static Material.Builder materialBuilder(MaterialEvent event, int id, Reso
}

public static Material.Builder materialBuilder(MaterialEvent event, int id, String domain, String path) {
return materialBuilder(event, id, domain, path);
return materialBuilder(event, id, new ResourceLocation(domain, path));
}

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

0 comments on commit c93aff7

Please sign in to comment.