Reapply Patch Optimize hasItemMeta (remove getItemMeta call)#13928
Open
MelodyYuuka wants to merge 2 commits into
Open
Reapply Patch Optimize hasItemMeta (remove getItemMeta call)#13928MelodyYuuka wants to merge 2 commits into
MelodyYuuka wants to merge 2 commits into
Conversation
Contributor
|
Given this already break since 1.20.6, i'm not sure the damage exclusion is really needed now (which will break things again). |
Author
We could replace this damage check by iterating over DataComponentPatch#entrySet() and comparing it with the ItemStack prototype. However, I feel like just checking the damage value would be enough, no one has opened an issue about for (final Map.Entry<DataComponentType<?>, Optional<?>> entry : this.handle.getComponentsPatch().entrySet()) {
if (!Objects.equals(this.handle.getPrototype().get(entry.getKey()), entry.getValue().orElse(null))) {
return true;
}
}
return false; |
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.
Reapply Patch #1279
Lastly, in Paper 1.20.4 there was still this patch: https://github.com/PaperMC/Paper-archive/blob/ver/1.20.4/patches/server/0221-Don-t-call-getItemMeta-on-hasItemMeta.patch, probably just did not survive the component rewrite