fix(client): preserve vanilla modifier identifiers in synced updates#1997
Open
MarkPLacer wants to merge 3 commits intoPumpkin-MC:masterfrom
Open
fix(client): preserve vanilla modifier identifiers in synced updates#1997MarkPLacer wants to merge 3 commits intoPumpkin-MC:masterfrom
MarkPLacer wants to merge 3 commits intoPumpkin-MC:masterfrom
Conversation
…of Uuid to prevent modifier duplication on client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #1990.
This fixes duplicated client-side stacking for effect-driven attribute modifiers such as Speed by preserving vanilla modifier identifiers during attribute sync, and by properly marking attributes dirty when those modifiers are removed.
Root Cause
Pumpkin currently stores runtime attribute modifier ids as
Uuids derived from the vanilla modifier id string, and then serializes those UUID-based identifiers back to the client.Vanilla uses identifier strings for these modifiers, for example,
minecraft:effect.speed. Because Pumpkin sends a UUID-form string instead, the Java client can treat the synced modifier as distinct from the vanilla effect modifier it already knows about and apply both.There is also a cache invalidation problem on effect removal:
remove_effectcurrently removes modifiers with a directretain()on the vector, which bypassesAttributeInstance::remove_modifier()and never marks the attribute instance as dirty. That can leave stale effective values cached after the effect is gone.Changes
Modifier.idfromUuidtoStringremove_modifier()during effect removal so the attribute is marked dirty and recomputedImpact
Known Limitations
active_effectson joinTesting
cargo check -p pumpkin