Inconsistent xp behavior between Sponge and Bukkit
gerzytet opened this issue · 8 comments
In sponge, $xp and #SETXP refer to the total xp a player has, as an integer.
In bukkit, $xp and #SETXP refer the percentage of xp that the player has until the next level
We need to choose a behavior and make both platforms consistent.
I think that the sponge way is more versatile, but the bukkit way is more friendly for using the xp bar as a progress bar.
Since this change is still being tested and hasn’t even made it to beta yet, it needs to stay open.
@gerzytet right.
Resolved in 17a2d11 commit.
#MODIFYPLAYER also has this inconsistency
The documentation currently lists only the bukkit way
I think It's better to modify #SETEXP to act like #MONEY, subtracting or adding specific value.
However, I have no idea how to handle $xp, which need to return total exp. (I heard Player#getTotalExperience() does not work like we want)
maybe this can help handle $xp:
https://gist.github.com/Jikoo/30ec040443a4701b8980#file-experience-java-L40
definitely. I think total one is better, cuz percentage usually used in
Minigame, or something like pastime system, but total experience is generally used in most situations like giving prize for achievement, modifying exp take with an entity killing.. etc.
The biggest problem isn’t that we can’t get the percentage for sponge or that we can’t get the total for Bukkit. Both can be calculated.
We just need to decide which one we would rather have.