Cannibalism

Cannibalism

1M Downloads

Player data corruption on death

LemADEC opened this issue ยท 10 comments

commented

As of Cannibalism-3.1.1-1.10.2, player data gets corrupted/deleted when dying.

Case 1: with gamerule keepInventory = true, player's inventory gets deleted when adding the meat item.

Case 2: with a gravestone mod, whether keepInventory is true or false, the player's inventory always gets deleted (i.e. gravestone only contains the meat item).

Those are reproduced in single player with Sponge.

On the server, we also have deletion of ProjectE researches when player dies, so this might be related too.

commented

I'll check it out, but I don't think it is caused by Cannibalism directly. For one, it doesn't touch the player's data file, instead it saves its data in an different file under an different format.

Did the problem continue after you remove Cannibalism? And does it happen when you run it without Sponge installed? And, just in case, what kind of operating system does your machine uses?

commented

Single player is Windows 10. Dedicated server is Linux.
I need both Cannibalism and Sponge to reproduce the issue.

commented

Issue is reproduced in single player with Windows 7, Cannibalism 5.1.1-1.12.2, and spongeforge-1.12.2-2611-7.1.0-BETA-2931.

commented

From the looks of it, the cause is Sponge and not Cannibalism. Especially if I consider that Sponge is still in development, and that bug only happens when it is included.

I'm going leave this open for the time being just in case something else pops.

commented

Sponge is released and considered stable on 1.12.
Handling death events and inventory is a bit tricky in Forge, many mods have messed it up.

commented

I did not know that, but I still think it's something to do with sponge or spongeforge. Like I said before, Cannibalism don't touch the player's data, it saves its info on an separate file.

Although the possibility is still there, so I'll see if I can find anything. Could you provide an log?

commented

It could be the player object being 'held' in memory, directly or indirectly.
We'll rebuild the setup to get logs, as far as I remember there isn't much during death.

commented

There's really no specific logs in console https://gist.github.com/LemADEC/6ac6629d4aecc207db9d47d08ec0d552
That's in Single player, Windows 10, fresh new modpack with just Cannibalism and latest stable Sponge. Created a new creative world, set keepInventory gamerule to true, added some blocks to my inventory, then /kill myself.
Inventory got deleted, the meat item is on the floor.

commented

Everything looks fine, the next update for 1.12.2 will have that fix and the backport for 1.10.2 should come soon after.

The transmutation table forgetting what it learned (I'm assuming that's what you meant by ProjectE research) don't appear to be caused by this mod as it continued to happen on its own after I removed Cannibalism.

commented

Alright, looks like I was looking at the wrong place. The player data don't seem to be the problem but rather it was how the player's meat drops was handled. I used entityDropItem(), which didn't cause a problem in an non-Sponge environment but I'm assuming that Sponge changed the method to where it caused the inventory bug when my mod called it.

Although, I still need to test it with ProjectE and Gravestone before I would push the fix out.