Auxilor / libreforge

Powerful yaml-based 'scripting' library for spigot
https://plugins.auxilor.io/effects/configuring-an-effect
Other
55 stars 51 forks source link

Fix add_stat AuraSkills integration #162

Closed ErikSzabo closed 2 months ago

ErikSzabo commented 2 months ago

New overrides for onEnable and onDisable to properly detect a reload. It calls the old ones so existing Effects are not affected. Other effects, like add_stat that needs the information whether the disable/enable happens because of a reload or not, can properly override the new methods.

This is needed so for example health stat won't get removed then readded instantly on an effect reload which would cause the player constant damage.

If only the value changes, you can add a new modifier with the same key and the new value, which will be handled accordingly. This is mainly for fixing the health bug, but it is also better in general for every stat, because it will reduce many extra calls if the values are not changing.

Will fix:

ErikSzabo commented 2 months ago

And this will probably solve the issue with the wisdom stat mana regeneration as well. That suffers from the same problem like health. Extra mana removed then added right after instantly. Thats why it couldn't be regenerated.

WillFP commented 2 months ago

Has been done differently, adding new methods to Effect generally won't be accepted