Fixed the 1.20.1 respawn bug with capabilities issue. Fixes #3747
This request fixes the issues I was having and seeing extensively and causing problems with my players. We've had to spend more time than I care to admit to debug and restore inventories and player data to resolve this issue.
As a result of the headache, we've gone ahead and found what was causing it and issued a local fix ourselves, then forked the repo and submitted the patch to you. Hopefully, this prevents others from having this issue and our headache as well.
thank you :) we we had the same issue on our server
thank you :) we we had the same issue on our server
You're welcome. I'm hopeful that it will help many people and that LuckPerms will accept the PR due to the nature of the bug. If you need a Jar for it please message me privately.
The reason I haven't merged this yet is because I'm not sure whether this is really the correct fix. I think we need to be careful about "revivingCaps" when the player genuinely is in an inactive state. It feels to me like Forge need to fix the capabilities system at their end if it is causing problems. As far as I can tell, LuckPerms' usage of the system is correct.
Maybe we should just switch to a centralised Map<UUID, User> instead of using the capabilities if it is going to continue to be painful
I agree Forge is to blame. We sadly have to work around them sometimes due to the nature of that project. Most will likely move to NeoForge, and I have higher hopes for them. For now, while it's not the ideal fix, I didn't want to re-work your entire plugin for any platform this touches.
Changing it to a map might be better; however, if we go that route vs this patch, you'd have to backport it to 1.20. and 1.20.1 vs. forward porting. The choice is ultimately up to you.
A similar fix was added in https://github.com/LuckPerms/LuckPerms/commit/5c1ea5633ed5986c02d3fa1ccf187638d143c091 which should fix the problem :)