TriggerReactor

TriggerReactor

24.6k Downloads

Inconsistent xp behavior between Sponge and Bukkit

gerzytet opened this issue · 8 comments

commented

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.

commented

Since this change is still being tested and hasn’t even made it to beta yet, it needs to stay open.

commented

@gerzytet right.

commented

Resolved in 17a2d11 commit.

commented

#MODIFYPLAYER also has this inconsistency
The documentation currently lists only the bukkit way

commented

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

commented

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.

commented

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.

commented

It would be unadvisable to change the Bukkit behavior though. I’ll just change sponge to use the percentage xp, for the sake of consistency with the docs. Later, we can add new executors and placeholders for both that use the total xp.