MultiInv

359k Downloads

NBT data loss

lafaipopo opened this issue ยท 13 comments

commented

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.

commented

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.

Edit: Also, #36 and #21 are cleary duplicates of this issue

commented

@strnk I'm struggeling with the same problem. Unfortunately I don't think that @Tux2 will look into it soon. Could you try to design a PR if you know what's wrong here?

commented

I have confirmed that this is still an issue with the current latest version and normal Spigot.

commented

What version of Spigot are you using?

commented

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

commented

Have you tried using Spigot itself? I don't test against Paper Spigot. It could be that it is a specific Paper issue.

commented

This is still an issue.

commented

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.

commented

AFAIK banners and shields had already been fixed as of version 3.3.8 5 months ago https://dev.bukkit.org/projects/multiinv/files

commented

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

commented

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".

commented

Awesome, thanks very much - I can confirm that the issue is resolved :)

commented

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.