-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When giving Levels directly (with /xp <level>L) player.get(Keys.TOTAL_EXPERIENCE) isn't updated #1322
Comments
Also I noticed that when enchanting or repairing the value doesn't decrease. |
Does receiving experience by an orb, after gaining it with the command, give you the correct total? |
@ryantheleach no it does not. |
When I tried to reproduce @BrainStone's bug report on SpongeVanilla I noticed that the total experience and the experience levels are tracked separately (and also saved separately) in the internal Minecraft server. I'm not entirely sure in which cases it converts between these values (I haven't checked yet). |
Any updates so far? |
I know what the issue is, I'm just unsure as to whether something should be done about it, and if so, whether it should be optional, because it's fundamentally a Vanilla issue - if indeed, it is an issue (and I'll explain my thinking in a moment). The problem is, as stated, that the Minecraft server tracks total experience and levels (and the current fraction of experience between two levels) separately. When changing a player's total experience via the The issue is that the method on the The fix I have would be to ensure that, when levels are changed outside of the method that adds experience points, is to check to see if there is a mismatch between the current experience and the current level, and, if so, recalculate the total experience (using the current percentage to the next level as a guide). To be clear, I have this ready to go - but I don't know whether this patch should be in an optional mixin. |
@dualspiral I don't see a point of it being optional. When would there be a need to control them separately. It just causes confusion for you as a plugin developer but also other plugins manipulating experience. Having it as an optional mixin makes plugin developers not know what functionality to expect and is harder to develop for. If Minecraft has these insurances we should too. I think this would be a great addition, just not optionally :) |
…levels. This will also recalculate the XP whenever the player data is loaded. This should repair any broken calls from the past. Fixes SpongePowered#1322.
…levels. This will also recalculate the XP whenever the player data is loaded. This should repair any broken calls from the past. Fixes SpongePowered#1322.
…levels. This will also recalculate the XP whenever the player data is loaded. This should repair any broken calls from the past. Fixes SpongePowered#1322.
…levels. This will also recalculate the XP whenever the player data is loaded. This should repair any broken calls from the past. Fixes SpongePowered#1322.
…levels. This will also recalculate the XP whenever the player data is loaded. This should repair any broken calls from the past. Fixes #1322.
When players recieve levels directly via the
/xp <level>L [player]
command the value ofplayer.get(Keys.TOTAL_EXPERIENCE)
remains unchanged. However the value is correct when reciving XP orbs or using the/xp <experience> [player]
command.I am currently running...
What is the expected result?
That the value of total experience is increased when giving levels directly.
What is the current result?
The value remains unchanged.
See also: SpongePowered/SpongeVanilla#312
The text was updated successfully, but these errors were encountered: