From f0702f969258bd01a5fc967c44d1d4805522b17f Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Tue, 27 Apr 2021 11:22:15 +0200 Subject: fix(logspam): spam unification typos (#514) Address issue: [Gregtech.log spam with 6724 lines of "Unknown Key for Unification, Typo?" #7866](https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/7866) - Fix the logic for logging possible Typos (prioritise least cost) - Improve reverse recipes by excluding ore names of tools early to prevent unexpected and un needed unification lookups - Turn off unification typo logging in reverse recipes Reduced unification typo spam from 6724, down to 11 remaining entries: ```none circuitGood circuitData circuitElite circuitMaster circuitUltimate circuitSuperconductor gearSteel gearAluminium gearStainlessSteel gearTitanium gearTungstenSteel ``` --- src/main/java/gregtech/api/enums/ToolDictNames.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java/gregtech/api/enums') diff --git a/src/main/java/gregtech/api/enums/ToolDictNames.java b/src/main/java/gregtech/api/enums/ToolDictNames.java index d81bbeae4e..2bb1aef1bd 100644 --- a/src/main/java/gregtech/api/enums/ToolDictNames.java +++ b/src/main/java/gregtech/api/enums/ToolDictNames.java @@ -29,4 +29,14 @@ public enum ToolDictNames { craftingToolScrewdriver, craftingToolSolderingIron, craftingToolSolderingMetal; + + public static boolean contains(String aName) { + if (!aName.startsWith("craftingTool")) return false; + for (ToolDictNames tool: ToolDictNames.values()) { + if (tool.toString().equals(aName)) { + return true; + } + } + return false; + } } \ No newline at end of file -- cgit