Since the server doesn't keep track of the serial network NBT of items anymore, it's possible for floating-point errors to slightly alter the decoded result, which leads to a false negative comparison.
This is problematic because it leads to items not being considered equivalent even though they are, for all intents and purposes, the same item. This causes problems with inventory transactions, amongst other things.
Steps to reproduce the issue
Use the following code in a plugin
public function onPlayerChat(PlayerChatEvent $event) : void{
$event->getPlayer()->getInventory()->setItem($event->getPlayer()->getInventory()->getHeldItemIndex(), VanillaItems::LAPIS_LAZULI()->setNamedTag(
CompoundTag::create()->setFloat("myfloat", 0.3)
));
}
Chat (you'll get a lapis-lazuli item)
Try to move the item in your inventory. You'll notice it doesn't want to move.
Issue description
Since the server doesn't keep track of the serial network NBT of items anymore, it's possible for floating-point errors to slightly alter the decoded result, which leads to a false negative comparison.
This is problematic because it leads to items not being considered equivalent even though they are, for all intents and purposes, the same item. This causes problems with inventory transactions, amongst other things.
Steps to reproduce the issue
OS and versions