NBT data loss
lafaipopo opened this issue ยท 13 comments
I encounter an issue with version 1.9 v3.3.6. When a player disconnect the NBT data of mob eggs, potions, banners and shields are lost. For example, potions are replaced by a bottle of water.
This bug occurs with MySQL and SQLite.
I can confirm this issue on a regular Spigot server (latest version) with no other mods loaded apart from MultiInv (latest snapshot) and TuxTwoLib (latest public update), using the default configuration for MI (thus with separateGameInventories set to true)
- Get into creative mode with /gamemode 1
- Put some spawn eggs in your inventory (e.g. screenshot)
- Switch to survival mode
- Reboot the server
- Should be logged in in survival, switch back to creative mode
- Eggs have lost their NBT tags (e.g. screenshot)
I can confirm this with spawn eggs, decorated shields, and potions. Virtually every item which switched to use NBT instead of data values since 1.9 I guess.
I'm not sure whether this bug report belongs to MultiInv or TuxTwoLib. Looking at MI's code, it's using the Attributes class from TuxTwoLib, but from the lib's code it only fetch AttributeModifiers NBT list, which is far from sufficient for most post-1.9 items (spawn egg types and additional data such as the mob's items, standard and custom potions effects, chest contents, pre-written signs, etc.)
I guess the easiest fix would be to store all NBTs in MultiInv's saved inventories. AFAIK as TuxTwoLib already exposes an API to get all NBT tags, the fix should incur to MultiInv.
I can work on a pull request if you're not already into it.
I have confirmed that this is still an issue with the current latest version and normal Spigot.
Currently I use paper spigot:
git-Paper-641 (MC: 1.9.2) (IPA Implementing Version 1.9.2-SNAPSHOT-R0.1)
I tried 5/6 other versions of paper remains similar worries
Have you tried using Spigot itself? I don't test against Paper Spigot. It could be that it is a specific Paper issue.
Thanks strnk - any chance you would be able to look at the banners and shields too? These are the main things my players are complaining about.
AFAIK banners and shields had already been fixed as of version 3.3.8 5 months ago https://dev.bukkit.org/projects/multiinv/files
Strange, I am running 3.3.8 but when we put a banner on a shield and logout and back in the shield no longer has the banner
Pull request #44 should fix the spawn eggs NBT loss when saving/reloading inventories. It does not rely on NMS classes so it's still in the "multiinv spirit".
You are right indeed, I just haven't spotted this issue until now. The pull request is updated and the unofficial 3.3.9 release as well.
An unofficial JAR is available here https://github.com/strnk/MultiInv/releases/tag/v3.3.9-unofficial-banners
I removed the support for importing WorldInventories in this unofficial release since I couldn't get the maven build to work with it.