Hatchery

Hatchery

14M Downloads

Animal Net: Save Forge Capabilities

maxanier opened this issue ยท 8 comments

commented

The Animal Net code uses Entity#writeEntityToNBT to store the captured entity as far as I can tell. Unfortunately this does not include any Forge Capabilities attached to that creature.
This causes issues with other mods like Vampirism (TeamLapen/Vampirism#167). Vampirism stores a blood value in a Forge Capability. If the creature is caught in the net and released again that blood value is lost.

Easiest solution might be to use Entity#writeToNBT which stores all relevant information including capabilities, but also a lot of unnecessary information.

commented

I'll take a look into it. Thanks for looking into it.

I was trying to save on the amount of data I saved in the tile entities, but capabilities are kinda important.

commented

I realized why I didn't add this in before because I share code with my eggs, and the eggs dont need any of that information cause it hatches a new entity. but I rewriting it to include all information. which tbh I should have done before, but I wasn't thinking about all that.

commented

@GenDeathrow this issue is still present in some of the most recent builds of the relevant mods, at least as applied to Vampirism's blood data. I have already asked Max to ensure he's done everything he needs to for the NBT to be saved, but he seems fairly certain it's still on your side of the fence. Did you fall into the void while working on this ๐Ÿ˜‰?

commented

I didn't drop into the void, just RL stuff has taken the drivers seat for a bit. Im planing on getting back into things full swing. This is absolutely on my side, I didnt' save all the nbt data because it ran into issues with uuid of the animals getting duped and immediately killing the entity, but some of that code has changed and I will look into it again.

commented

So my bad, it looks like I tried to add this capability in last time, but I missed some old code when I refactored to make future changes easier. so when picking up entities it still wasn't saving full data.

commented

Im doing some final testing on this.. and should have an update soon.

commented

Nice, thank you

commented

Welp it took forever, had some things that got in the way and I never got this update up. So I apologize for the long wait. but it should be working now.