Metallurgy 4: Reforged

Metallurgy 4: Reforged

466k Downloads

Forge Errors when disabling item registration in the config

blahthebiste opened this issue ยท 5 comments

commented

General Information

Forge generates errors trying to parse recipes for disabled items. This does not cause any issues in game that I know of.

To Reproduce:

  1. Use the config file to disable certain items. Example in registry.cfg:
    blocks {
    # If true bricks metal blocks will be registered
    B:"Bricks Metal Blocks"=false
  2. Start the game. Keep the console open.
  3. Observe a huge number of forge errors in the log, one for each disabled item
    Example:

[15:51:57] [Server thread/ERROR] [FML]: Parsing error loading recipe metallurgy:generated/block/bricks_rubracium
com.google.gson.JsonSyntaxException: Unknown item 'metallurgy:rubracium_bricks'
at net.minecraftforge.common.crafting.CraftingHelper.getItemStack(CraftingHelper.java:214) ~[CraftingHelper.class:?]
at net.minecraftforge.oredict.ShapedOreRecipe.factory(ShapedOreRecipe.java:254) ~[ShapedOreRecipe.class:?]
at net.minecraftforge.common.crafting.CraftingHelper.getRecipe(CraftingHelper.java:416) ~[CraftingHelper.class:?]
at net.minecraftforge.common.crafting.CraftingHelper.lambda$loadRecipes$22(CraftingHelper.java:723) ~[CraftingHelper.class:?]
at net.minecraftforge.common.crafting.CraftingHelper.findFiles(CraftingHelper.java:833) ~[CraftingHelper.class:?]
at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:688) ~[CraftingHelper.class:?]
at java.util.ArrayList.forEach(Unknown Source) [?:1.8.0_281]
at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:633) [CraftingHelper.class:?]
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:747) [Loader.class:?]
at net.minecraftforge.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:108) [FMLServerHandler.class:?]
at net.minecraftforge.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:338) [FMLCommonHandler.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:219) [nz.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486) [MinecraftServer.class:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_281]

Versions:

  • Metallurgy: 1.2.5
  • Forge: 14.23.5.2854
  • Minecraft: 1.12.2

commented

I knew sooner or later someone would point this out, anyways I don't think there is much I can do about it, since recipes are loaded by Forge directly from JSON files, and I don't have control over it afaik
I'll investigate a bit more anyways, if anyone has pointers or resources to share, please do so

commented

It's not a significant issue, just thought I'd let you know. All it costs it log space as far as I can tell.

commented

Ok I've discovered a way to fix this, will be released together with the next patch release (1.2.6)
Edit: It really was too simple to actually work (but you can't rename files inside of zip archives without extracting them)

commented

hey @Rongmario thanks for the pointers! I'll investigate some more to see if it's feasible with the generated json recipes we're using and hopefully release a real fix soon

commented

Since you already have ther recipe jsons, I'd recommend registering a custom IConditionFactory in net.minecraftforge.common.crafting.CraftingHelper - you can make sure recipe jsons with certain JSON parameters can be filtered depending on your mod's configuration.

The easiest way of course is just to register recipes via code and not json.