Skip to content
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

[1.19.2] XP Stats are not presistently saved #19

Open
Jonathing opened this issue Dec 13, 2024 · 1 comment · May be fixed by #20
Open

[1.19.2] XP Stats are not presistently saved #19

Jonathing opened this issue Dec 13, 2024 · 1 comment · May be fixed by #20

Comments

@Jonathing
Copy link

Jonathing commented Dec 13, 2024

Sortilege saves XP stats of a living entity to a static map XPHelper.XP_STATS. While this is fine, this map is never persistently saved. So if die, click on "Title Screen", then close the game (or crash), when you reload the world the ModEvents.xpRefill event listener fails with a null pointer, since the XP stat it's trying to get doesn't exist for the UUID you saved it for.

The 1.19.2 version is written in Forge, so this can easily be solved by making a LivingEntity capability and attaching XP stats to it (this can even work with Players, but you'd need to watch out for this issue: MinecraftForge/MinecraftForge#9311). Even though the 1.20.1 version is written in Fabric, I'm sure there is some sort of similar solution to persistently save XP stats.

In any case, it's not a high priority issue since players will usually immediately respawn after their death, but it's something to point out. It's probably the root cause for issue #12.

@Jonathing
Copy link
Author

Edited out the error since it's irrelevant to the issue (I was using an outdated version of the mod), but the root issue is still present in the current code-base.

@Jonathing Jonathing linked a pull request Dec 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant