Farmer's Delight

Farmer's Delight

97M Downloads

vectorwing/farmersdelight/common/Configuration will never receive config events

TsXor opened this issue ยท 2 comments

commented

https://github.com/vectorwing/FarmersDelight/blob/1.19/src/main/java/vectorwing/farmersdelight/common/Configuration.java#L9

I was writing some mods when referring to code stucture Farmer's Delight on "how should I do this" questions.
However, I found my configuration handler never receives configuration event.
After some looking around, I found configuration events are fired on mod event bus, and annotation @Mod.EventBusSubscriber by default makes the class listen to forge event bus, so current code (and possibly all code since 1.16.5) never receive config events.
To make it really receive events, annotation should be written like this.

@Mod.EventBusSubscriber(modid = FarmersDelight.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)

It seems that Farmer's delight never really do something on these events, but I think it important to point it out.

commented

Thanks for pointing this out!

Turns out that this @Mod.EventBusSubscriber is completely unnecessary, and likely a leftover from when I was following outdated modding tutorials. Since I'm using the config objects directly, I can just remove the annotation. ๐Ÿ‘

commented

Line removed on commit 3a9c108.