CodeCrafter47 / AdvancedTabOverlay

GNU General Public License v3.0
5 stars 3 forks source link

PlaceholderAPI extensions don't always load before AdvancedTabOverlay #27

Open cyberkitsune opened 2 years ago

cyberkitsune commented 2 years ago

I'm currently having an issue where my AdvancedTabOverlay complains a placeholder doesn't exist at server startup, but PAPI registers it shortly after AdvancedTabOverlay loads. This means the placeholder is ignored until I run /advancedtaboverlay reload once.

[12:02:06 WARN]: [AdvancedTabOverlay] There have been 1 warnings while loading plugins/AdvancedTabOverlay/tabLists/default.yml
WARNING: Error in placeholder ${viewer server_tps_1_colored}:
Unknown placeholder

[12:02:06 INFO]: [PlaceholderAPI] Successfully registered expansion: server [2.6.1]
[12:02:06 INFO]: 1 placeholder hook(s) registered!

I suppose a potential solution to this would to re-evaulate the placeholders later on during enable, or possibly have PAPI as a depend and not a softdepend? (not ideal)

Andre601 commented 2 years ago

Having PlaceholderAPI as a depend wouldn't solve anything as it doesn't change when ATO gets enabled.

PlaceholderAPI has three distinct phases:

As you may guess by the above list is the issue that expansions are loaded after the server is "done" with starting up while ATO loads tab lists much earlier in the process (probably during its own enable phase).

The best solution for ATO here is to look for the ExpansionsLoadedEvent from PlaceholderAPI which gives a clear indicator of when all expansions got loaded.

Andre601 commented 1 year ago

@cyberkitsune CodeCrafter pushed a change to ATO to hopefully fix the issue. Could you try out the latest dev version and let us know if the issue is resolved by it?

Link to latest dev build: https://ci.codecrafter47.de/job/AdvancedTabOverlay/165/