From 97666386b1090a55676681386f4e2528b4be6b7e Mon Sep 17 00:00:00 2001 From: koolkrafter5 Date: Sat, 29 Mar 2025 10:48:29 -0400 Subject: [PATCH 1/3] Fix bug where searching for recipes of stone would show meteors with no filler. --- .../alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java index ce857103..0ef00eed 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java @@ -173,7 +173,7 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler { if (meteor.ores.stream().anyMatch(m -> matchItem(result, m.getBlock()))) { arecipes.add(new CachedMeteorRecipe(meteor, result)); } - if (meteor.filler.stream().anyMatch(m -> matchItem(result, m.getBlock()))) { + if (meteor.fillerChance > 0 && meteor.filler.stream().anyMatch(m -> matchItem(result, m.getBlock()))) { arecipes.add(new CachedMeteorRecipe(meteor, result)); } } From 7a23bb7e249029097d41481be48d1461741c9671 Mon Sep 17 00:00:00 2001 From: koolkrafter5 Date: Sat, 29 Mar 2025 12:04:38 -0400 Subject: [PATCH 2/3] Check for oredicts when deciding to show meteor recipes. --- .../client/nei/NEIMeteorRecipeHandler.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java index 0ef00eed..0a770a9d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java @@ -14,6 +14,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.oredict.OreDictionary; import org.lwjgl.opengl.GL11; import com.google.common.base.Joiner; @@ -193,11 +194,33 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler { if (NEIServerUtils.areStacksSameTypeCrafting(compared, compareTo)) { return true; } - // ignore ore variants (like basalt ore) + + // Ignore GregTech ore variants (like basalt ore) if (compared.getUnlocalizedName().startsWith("gt.blockores") && compareTo.getUnlocalizedName().startsWith("gt.blockores")) { return compared.getItemDamage() % 1000 == compareTo.getItemDamage() % 1000; } + + // Check oredicts for ores. Checks for direct matches (oreIron with oreIron) as well as IC2/GT crushed ores (crushedGold with oreGold), + // EFR raw ores (rawCopper with oreCopper (although those all seem to have oreX anyways)), and GT:NH raw ores (rawOreDiamond with oreDiamond). + String[] prefixes = {"crushed", "rawOre", "raw"}; + for (int i : OreDictionary.getOreIDs(compareTo)) { + String s1 = OreDictionary.getOreName(i); + if (s1.startsWith("ore")) { + for (int j : OreDictionary.getOreIDs(compared)) { + if (i == j) { + return true; + } + String s2 = OreDictionary.getOreName(j); + for (String prefix : prefixes) { + if (i == OreDictionary.getOreID(s2.replaceFirst("^" + prefix, "ore"))) { + return true; + } + } + } + } + } + return false; } From 49485fc6ac0fb8a912a5e0571536dacedccefdc5 Mon Sep 17 00:00:00 2001 From: koolkrafter5 Date: Sat, 29 Mar 2025 12:05:35 -0400 Subject: [PATCH 3/3] Spotless --- .../client/nei/NEIMeteorRecipeHandler.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java index 0a770a9d..3831e22c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java @@ -13,8 +13,8 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; - import net.minecraftforge.oredict.OreDictionary; + import org.lwjgl.opengl.GL11; import com.google.common.base.Joiner; @@ -201,9 +201,10 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler { return compared.getItemDamage() % 1000 == compareTo.getItemDamage() % 1000; } - // Check oredicts for ores. Checks for direct matches (oreIron with oreIron) as well as IC2/GT crushed ores (crushedGold with oreGold), - // EFR raw ores (rawCopper with oreCopper (although those all seem to have oreX anyways)), and GT:NH raw ores (rawOreDiamond with oreDiamond). - String[] prefixes = {"crushed", "rawOre", "raw"}; + // Check oredicts for ores. Checks for direct matches (oreIron with oreIron) as well as IC2/GT crushed ores + // (crushedGold with oreGold), EFR raw ores (rawCopper with oreCopper (although those all seem to have oreX + // anyways)), and GT:NH raw ores (rawOreDiamond with oreDiamond). + String[] prefixes = { "crushed", "rawOre", "raw" }; for (int i : OreDictionary.getOreIDs(compareTo)) { String s1 = OreDictionary.getOreName(i); if (s1.startsWith("ore")) {