-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Manually reset attribute map on restoring player instance #11580
Conversation
+ this.attributes.values().forEach(AttributeInstance::removeModifiers); | ||
+ } | ||
+ | ||
+ public void removeAllTransientModifiers() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method scared me for a second, should add a note that we expect the getters to return copies
Spigots reuse of the entity instances causes the server to try to copy a players existing attributes back onto itself, which causes an error. We'll manually clear the applicable attribute modifiers, but, in the long run, we should just revert out of the broken behavior of trying to reuse ServerPlayer instances.
a6c4f1c
to
35bebb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing transient modifiers means armor needs to reapply.
That does not happen because we are not actually a new entity.
Do not break API modifier expectations of lasting through death.
Closing this as the immediate issue has been solved by upstream. The API needs to be fleshed out to support plugins to set attribute modifiers that do/do not persist through death. |
Spigots reuse of the entity instances causes the server to try to copy a players existing attributes back onto itself, which causes an error.
We'll manually clear the applicable attribute modifiers, but, in the long run, we should just revert out of the broken behavior of trying to reuse ServerPlayer instances.
Download the paperclip jar for this pull request: paper-11580.zip