Metallurgy 4: Reforged

Metallurgy 4: Reforged

438k Downloads

metallurgy_tweaks.zip doesn't respect registry config

Tschipp opened this issue ยท 6 comments

commented

General Information

Describe the bug:
When I disable certain blocks and items in the registry config, the crafttweaker script doesn't respect this and throws errors

To Reproduce:
Disable some cosmetic blocks in the registry config


Environment Versions

Versions:

  • Metallurgy: 1.2.11
  • Other mods you think could cause issues: Crafttweaker
  • Forge: 14.23.5.2838
  • Minecraft: 1.12.2

commented

ok so, this bug is pretty complicated to fix on the scripts' side as checking for null items in zenscript is verbose and pollutes the scripts code much, so I added #ikwid preprocessor directive to every script to avoid the chat spam about broken metallurgy tweaks scripts

Of course this doesn't fix the script in any way so, if for instance some cosmetic blocks are disabled in the configs you won't get Chisel Integration at all, since it's based on those.
I am sure that if someone is editing the registry config they are aware of what they're doing and of the consequences that disabling item registration might have on old worlds and on the mod's content.

what I'm trying to say is that messing with registry always has the chance of breaking something, this means it was probably a bad idea to implement it in the first place, but since we never compressed our block and item ids making use of meta
I decided to leave this option for people to reduce the big impact Metallurgy 4: Reforged has on the limited number of IDs in 1.12.2

so I wanted to know what you guys think about this "fix"

commented

The limited number of ids is exactly why I disabled most decorative blocks. They are nice, but I personally didn't have a use for them. Of course from a modder's perspective I totally understand how having a config for enabling/disabling registration can cause unintended consequences and lots of conditional code, which is a pain to maintain. I guess what would improve the issue, was if the zip didn't get replaced every time on restart, so I could actually edit the scripts if there are erroring lines

commented

mmh, to clarify, adding #ikwid will suppress the error messages in the chat, they'll still be logged in crafttweaker.log for debugging purposes.
And yeah, I'm not planning on removing the registry config as it can be useful for the reasons you mentioned.

My question was more related to if it's worth going inside zenscripts to null check every IItemStack instance to avoid errors at all.
since with the #ikwid workaround the script will still hiddenly fail and related features won't load.
For example one of the scripts adds compatibility between metallurgy cosmetic blocks and the chisel mod, if any of the cosmetic blocks is disabled in the registry config that compatibility module will fail, and won't even load partially.

I guess I'll keep this as a fix until someone complains about it :P

Side Note: I'll wait on a few more reports if there will be any before actually releasing the next patch
Extra Note: Editing metallurgy tweaks is possible and works the same way as editing the materials.json config you need to set to false the related entry in general.cfg before actually editing it

commented

The only reason why I would make a proper check is because the #ikwid supresses all chat output, not just the one from the script of where it's added. It seems to be a global preprocessor argument.

commented

ah, I didn't know it spanned across scripts, but yeah in that case it can be troublesome, I'll think of a better way to fix this

commented

I have released a new patch where almost all the features that were previously implemented via zenscripts are implemented via IMC, and since I have more control over what actually is actually registered in java this issue should be fixed there.
1.2.12

Feel free to tell me if you come across any other issues when disabling items via registry config