gigaherz / Guidebook

Minecraft book API and library
https://www.curseforge.com/minecraft/mc-mods/guidebook
Other
31 stars 16 forks source link

[1.19.3] `BookRegistryEvent` fires while the Forge event bus is still shut down #111

Closed XFactHD closed 1 year ago

XFactHD commented 1 year ago

At the moment, the BookRegistryEvent is fired at a point in time where the Forge event bus is not available yet: grafik

Since the event only fires exactly once, the simplest fix would most likely be to make the event implement IModBusEvent and fire it on the mod bus via ModLoader.get().postEvent(). I'm going to assume that this event has been broken for a few versions and didn't just break in the 1.19.3 update.

Forge: 1.19.3-44.1.0 Guidebook: Guidebook-1.19.3-3.7.1

gigaherz commented 1 year ago

Oops I forgot this event existed. I normally use the books via the books.json file, similar to how you add sound files via sounds.json

gigaherz commented 1 year ago

I'm thinking about it and I should probably just deprecate it and remove it in the future. There isn't really a good place to keep this event without turning it into a mod-bus event and an IMC message people can post from their constructor would make more sense.

XFactHD commented 1 year ago

IMC or purely the JSON seem like adequate solutions to me as well.

gigaherz commented 1 year ago

v3.7.2 deprecates the event, although I didn't add an alternative besides the existing book json resource.