[SPIGOT-6333] CraftItemMeta comparing bad Created: 27/Jan/21 Updated: 27/Jan/21 |
|
Status: | Open |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | SkytAsul | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 0 |
Labels: | None |
Attachments: |
![]() ![]() |
Version: | 1.16.5 |
Guidelines Read: | Yes |
Description |
Comparing this item: To this one: with item.equals(otherItem) returns false, whereas the items are literally the same, the only thing that changes is the order of the tags in its lore NBT representation. The problem is that when comparing two CraftItemMeta, it compares the lore of the two metas not as NBT compounds, but as Strings, so even if the NBT are the same, the String are different and comparing leads to false value. Sorry if I'm not really comprehensible :/ |
Comments |
Comment by blablubbabc [ 27/Jan/21 ] |
> curious if the first ping notified you or I have to add you as a watcher like I normally do Yeah, I got a notification for both of them. > So does Minecraft. These two items will not stack with each other, therefore the behaviour seems correct to me. They are not strictly equal. I agree: As long as Minecraft doesn't consider them equal, we should stick to that. We could however consider adding a config option to automatically normalize all items to a common representation, as outlined in |
Comment by md_5 [ 27/Jan/21 ] |
blablubbabc curious if the first ping notified you or I have to add you as a watcher like I normally do |
Comment by md_5 [ 27/Jan/21 ] |
So does Minecraft. |