Archy-X / AuraSkills

The ultra-versatile RPG skills plugin
https://aurelium.dev/auraskills
GNU General Public License v3.0
235 stars 88 forks source link

Treecapitator skill breaks the plugin if it is removed #272

Closed Leomelonseeds closed 3 months ago

Leomelonseeds commented 3 months ago

Server software and version

git-Paper-448 (MC: 1.20.4)

Expected behavior

After removing any mana_ability entry containing 'auraskills/treecapitator`, the plugin will break upon loading, with the following error:

[20:05:53] [Server thread/WARN]: [AuraSkills] Task #148 for AuraSkills v2.0.9 generated an exception
java.lang.IllegalArgumentException: Mana ability auraskills/treecapitator is not loaded!
    at dev.aurelium.auraskills.common.mana.ManaAbilityManager.getManaAbility(ManaAbilityManager.java:45) ~[AuraSkills-2.0.9.jar:?]
    at dev.aurelium.auraskills.common.mana.ManaAbilitySupplier.get(ManaAbilitySupplier.java:26) ~[AuraSkills-2.0.9.jar:?]
    at dev.aurelium.auraskills.common.mana.ManaAbilitySupplier.getOptions(ManaAbilitySupplier.java:124) ~[AuraSkills-2.0.9.jar:?]
    at dev.aurelium.auraskills.common.mana.ManaAbilitySupplier.getOptions(ManaAbilitySupplier.java:15) ~[AuraSkills-2.0.9.jar:?]
    at dev.aurelium.auraskills.common.registry.OptionSupplier.optionBoolean(OptionSupplier.java:19) ~[AuraSkills-2.0.9.jar:?]
    at dev.aurelium.auraskills.api.mana.ManaAbilities.optionBoolean(ManaAbilities.java:128) ~[AuraSkills-2.0.9.jar:?]
    at dev.aurelium.auraskills.bukkit.skills.foraging.Treecapitator.<init>(Treecapitator.java:32) ~[AuraSkills-2.0.9.jar:?]
    at dev.aurelium.auraskills.bukkit.mana.BukkitManaAbilityManager.registerProviders(BukkitManaAbilityManager.java:42) ~[AuraSkills-2.0.9.jar:?]
    at dev.aurelium.auraskills.bukkit.AuraSkills.lambda$onEnable$0(AuraSkills.java:248) ~[AuraSkills-2.0.9.jar:?]
...

This is because the GIVE_XP variable in the TreeCapitator class requires that the ability be registered with the ManaAbilityManager class, which doesn't happen if the ability is not placed somewhere in the skills config.

This error causes, among other things, all the menus to be broken, as they are loaded after the mana abilities. A temporary workaround is putting the skill in, but disabling it in the mana ability configs.

Actual behavior

Server should start normally.

How to reproduce

As described above, simply remove any mention of the auraskills/treecapitator mana ability from skills.yml, and restart the server.

Additional information

No response

Agreements

Archy-X commented 3 months ago

Should be fixed in c14e55960a7c22efe0cc047e4594d7a4f7809b9e

Can you test the latest dev build? https://aurelium.dev/auraskills/download?channel=dev

Leomelonseeds commented 3 months ago

Looks to be fixed, thank you for the incredibly fast response!