From e9ee2d48c6fdd456fd3d44e0f341bf3abaaa1dcd Mon Sep 17 00:00:00 2001 From: Waiting Idly <25394029+WaitingIdly@users.noreply.github.com> Date: Sat, 13 Dec 2025 14:39:56 -0800 Subject: [PATCH 1/2] only log wildcard in debug --- .../groovyscript/compat/vanilla/Furnace.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/cleanroommc/groovyscript/compat/vanilla/Furnace.java b/src/main/java/com/cleanroommc/groovyscript/compat/vanilla/Furnace.java index a15f9c320..73598b5ce 100644 --- a/src/main/java/com/cleanroommc/groovyscript/compat/vanilla/Furnace.java +++ b/src/main/java/com/cleanroommc/groovyscript/compat/vanilla/Furnace.java @@ -80,15 +80,17 @@ public boolean removeByInput(IIngredient input) { })) { return true; } - var log = GroovyLog.msg("Error removing Minecraft Furnace recipe").error(); - log.add("Can't find recipe for input " + input); + //noinspection ConstantValue if ((Object) input instanceof ItemStack is && is.getMetadata() != OreDictionary.WILDCARD_VALUE) { var wild = new ItemStack(is.getItem(), 1, OreDictionary.WILDCARD_VALUE); if (!FurnaceRecipes.instance().getSmeltingResult(wild).isEmpty()) { - log.add("there was no input found for {}, but there was an input matching the wildcard itemstack {}", GroovyScriptCodeConverter.asGroovyCode(is, false), GroovyScriptCodeConverter.asGroovyCode(wild, false)); + GroovyLog.msg("Error removing Minecraft Furnace recipe") + .debug() + .add("there was no input found for {}, but there was an input matching the wildcard itemstack {}", GroovyScriptCodeConverter.asGroovyCode(is, false), GroovyScriptCodeConverter.asGroovyCode(wild, false)) + .add("did you mean to run furnace.removeByInput({}) instead?", GroovyScriptCodeConverter.asGroovyCode(wild, false)) + .post(); } } - log.post(); return false; } From 94177996a523b51ededf4e94bd83473fd9c8a15f Mon Sep 17 00:00:00 2001 From: Waiting Idly <25394029+WaitingIdly@users.noreply.github.com> Date: Sat, 13 Dec 2025 14:42:23 -0800 Subject: [PATCH 2/2] remove logs from furnace --- .../groovyscript/compat/vanilla/Furnace.java | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/cleanroommc/groovyscript/compat/vanilla/Furnace.java b/src/main/java/com/cleanroommc/groovyscript/compat/vanilla/Furnace.java index 73598b5ce..4cee974f6 100644 --- a/src/main/java/com/cleanroommc/groovyscript/compat/vanilla/Furnace.java +++ b/src/main/java/com/cleanroommc/groovyscript/compat/vanilla/Furnace.java @@ -6,7 +6,6 @@ import com.cleanroommc.groovyscript.api.documentation.annotations.*; import com.cleanroommc.groovyscript.helper.SimpleObjectStream; import com.cleanroommc.groovyscript.helper.ingredient.GroovyScriptCodeConverter; -import com.cleanroommc.groovyscript.helper.ingredient.IngredientHelper; import com.cleanroommc.groovyscript.helper.recipe.AbstractRecipeBuilder; import com.cleanroommc.groovyscript.registry.AbstractReloadableStorage; import com.cleanroommc.groovyscript.registry.VirtualizedRegistry; @@ -65,12 +64,6 @@ public boolean remove(Recipe recipe) { @MethodDescription(example = @Example("item('minecraft:clay:*')")) public boolean removeByInput(IIngredient input) { - if (GroovyLog.msg("Error adding Minecraft Furnace recipe") - .add(IngredientHelper.isEmpty(input), () -> "Input must not be empty") - .error() - .postIfNotEmpty()) { - return false; - } if (FurnaceRecipes.instance().getSmeltingList().entrySet().removeIf(entry -> { if (input.test(entry.getKey())) { addBackup(Recipe.of(entry.getKey(), entry.getValue())); @@ -96,26 +89,13 @@ public boolean removeByInput(IIngredient input) { @MethodDescription(example = @Example("item('minecraft:brick')")) public boolean removeByOutput(IIngredient output) { - if (GroovyLog.msg("Error adding Minecraft Furnace recipe") - .add(IngredientHelper.isEmpty(output), () -> "Output must not be empty") - .error() - .postIfNotEmpty()) { - return false; - } - if (FurnaceRecipes.instance().getSmeltingList().entrySet().removeIf(entry -> { + return FurnaceRecipes.instance().getSmeltingList().entrySet().removeIf(entry -> { if (output.test(entry.getValue())) { addBackup(Recipe.of(entry.getKey(), entry.getValue())); return true; } return false; - })) { - return true; - } - GroovyLog.msg("Error removing Minecraft Furnace recipe") - .add("Can't find recipe for output " + output) - .error() - .post(); - return false; + }); } @MethodDescription(type = MethodDescription.Type.QUERY)