PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.66k stars 2.25k forks source link

ArmorStand with meta deserialized by bukkit not saveable. #11105

Closed minion325 closed 2 weeks ago

minion325 commented 1 month ago

Expected behavior

Usually, you would be able to get and set items to/from a config and they should work as normal items and be saved by minecraft

Observed/Actual behavior

ArmorStands with any meta (name only, lore only) cannot be saved by minecraft IF the steps below are done. The issue seems to lie in the deserialized item having a nbt compound called "entity-tag". This tag does not seem to be saveable by minecraft nbt. /paper dumpitem also errors for this deserialized item.

Steps/models to reproduce

Steps to replicate

1) Get an armorstand with any meta (name changed or any lore) 2) Serialize using Bukkit(via config, BukkitObjectOutputStream etc) 3) Deserialized using Bukkit(the opposite of how you serialized) 4) Add this deserialized item to inv 5) This item is unsaveable, causing an error. Inventories with this item, chunks etc won't save

Plugin and Datapack List

Not necessary.

Paper version

version 1.21-50-master@20889d0 (2024-07-10T16:28:03Z) (Implementing API version 1.21-R0.1-SNAPSHOT)

Other

https://pastebin.com/adS1NMnR

Stacktrace seen when leaving server with item in inventory.

lynxplay commented 1 month ago

The entity-tag paper emits does not include the id, eventho it should. This is (from my first look) not an issue on other ItemMeta implementations, because they do not allow messing with the entity tag directly.

minion325 commented 1 month ago

https://github.com/PaperMC/Paper/pull/11107

Pull request by electronicboy addressing this.