Botania flower bag contents are lost
Created by: bluelightning32
Issue Description:
On logoff, InvSync is not persisting the contents of the botania flower bag, when the bag is directly in the player's inventory. The player.dat file has the bag contents. When the player logs back in, their inventory is loaded from the InvSync database, and the bag contents are lost.
The flower bag contents are not lost if it is inside of a backpack.
Steps to reproduce:
- Install botania
- Get a flower bag
- Put a flower in the flower bag
- Log off
- Log in.
Affected Versions (Do not use "latest"):
- Minecraft: forge-1.12.2-14.23.5.2807-universal.jar
- InvSync: InvSync-0.6.19.280-DEV.jar
- Sponge: aaaa-spongeforge-1.12.2-2768-7.1.6-RC3596.jar
- Modpack: DD&SS version 4.7
- Other related mods:
> /sponge plugins
[02:36:10] [Server thread/INFO] [minecraft/DedicatedServer]: Plugins (9): Minecraft, Minecraft Coder Pack, SpongeAPI, Sponge, Inventory Sync, JdaLibraryLoader, LuckPerms, UltimateChat, spark
Your most recent log or stack trace file where the issue was present:
In this log, you can see the player logs off, then a server backup is started.
I copied the hex data from the mysql database:
$ mysql --binary-as-hex -uminecraft -p
MariaDB [dd_ss_invsync]> use dd_ss_invsync;
MariaDB [dd_ss_invsync]> SELECT * FROM invsync_inventories where UUID=0x8189ca6f92524683ac29556125d44470\G
I converted the hex string into a binary file:
$ xxd -r -p 2019-03-16-00\:04\:42.txt > 2019-03-16-00\:04\:42.dat
I dumped the nbt data from inside it, and it shows the flower bag is empty:
$ cat ~/.local/bin/nbtutil
#!/bin/bash
TERM=xterm mono $HOME/nbtexplorer/NBTUtil.exe "$@"
$ nbtutil --path 2019-03-16-00:04:42.dat --printtree
...
| + 2 entries
| | + slot: 4
| | + stack: 4 entries
| | + ContentVersion: 1
| | + Count: 1
| | + UnsafeDamage: 0
| | + ItemType: botania:flowerbag
| + 2 entries
However the player.dat file I restored from the backup shows the bag is non-empty:
$ nbtutil --path 8189ca6f-9252-4683-ac29-556125d44470.dat --printtree
| + 5 entries
| | + Count: 1
| | + Slot: 4
| | + Damage: 0
| | + id: botania:flowerbag
| | + ForgeCaps: 2 entries
| | + Parent: 16 entries
| | | + 4 entries
| | | | + Count: 4
| | | | + Damage: 0
| | | | + Slot: 0
| | | | + id: botania:flower
| | | + 4 entries
| | | | + Count: 12
| | | | + Damage: 1
| | | | + Slot: 1
| | | | + id: botania:flower
...
Later the player was able to reproduce the problem with just the flower bag in their inventory.