Balm (Fabric Edition)

Balm (Fabric Edition)

27M Downloads

More reliable way to listen to config load

BlayTheNinth opened this issue ยท 0 comments

commented

Current approach with listening to ConfigLoadedEvent only works if the event handler is added before configs register. Since registering configs is one of the first things done in initializers / modules, on Fabric where configs load instantly those handlers will never fire.

  • Either we move the ConfigLoadedEvent to a later time, although I don't think artificially pretending that it's not yet loaded is a good idea
  • Or we add an alternative way of "waiting" for a config, e.g. BalmConfig.onConfigAvailable(schema, handler) which would also be a bit cleaner on caller site since there'd be no need to compare the event's schema manually.