diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java index ce857103..3831e22c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIMeteorRecipeHandler.java @@ -13,6 +13,7 @@ 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; @@ -173,7 +174,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)); } } @@ -193,11 +194,34 @@ 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; }