Tool Belt

Tool Belt

51M Downloads

Blacklist/Whitelist configurations loaded too soon

CovertJaguar opened this issue ยท 7 comments

commented

Blacklist/Whitelist configurations need to be processed no sooner than PostInit.

At the moment, since they are processed during PreInit, they will be unable to find any items from mods further down the mod load order than itself.

commented

True. The config loading will still have to happen in preinit, since that's where the data is, but I guess it can be processed later in post.

commented

No wait no. That's not true. Mods should be registering the items and blocks using the Registry events, so preinit should work for any mod following the proper practices. It shouldn't be my fault if they don't use the events.

commented

Registry events? I'll bet most modders haven't even heard of those. Best practices states that any intermod interactions must happen in Post.

class FMLPostInitializationEvent
Recommended activities: interact with other mods to establish cross-mod behaviours.
class FMLPreInitializationEvent
Register your blocks and items with the {@link net.minecraftforge.fml.common.registry.GameRegistry}
commented

https://github.com/gigaherz/ToolBelt/blob/master/src/main/java/gigaherz/toolbelt/ToolBelt.java#L57,L69

They were introduced sometime during early 1.10 or so. The events fire for Block first, then Item, then all the other registries (such as potions and enchantments) afterward in a non-specified order.

Yes, common suggested practice is to do things in post, to avoid issues with mods that do things wrong too late. The point was that since 1.10.2, it is considered bad practice to register your stuff outside the events. It's still supported, but discouraged.

commented

Which means you must also support it for as long as Forge does.

commented

No it does not. I will move it to post, but it does not mean I "must". I could choose not to, and tell everyone to go yell at the other modders. I won't, but I could. ;P

commented

v1.6.0 moved the whitelist/blacklist parsing to post-init. It's up on curseforge.