Proper handling for mobs with identical names in the Dark Resurrection ritual
Shinoow opened this issue ยท 0 comments
Description:
Currently the handling for the Dark Resurrection ritual only allows a single mob with a specific name to be stored, which causes numerous conflicts if multiple different mobs who has been given the same name dies. Right now the currently stored size (used to determine what crystal should be used) gets overridden by the second mob, but then the actual data used to recreate the mob doesn't get stored (judging by the questionable code past me has written).
Proposition:
Keep some of the old stuff for legacy reasons, but tweak the data structure by either:
- Store the size inside the Entity NBT tag
- Alter the structure of the NBT tag (create a parent tag that holds the Entity tag and the size tag, separated from each other)
Either one gets the job done, but option one is the lazier version, while option two increases the additional code required for backwards compatibility with previously stored data. Then again, there are no datafixers for WorldSavedData. Probably sticking with option one.
As for storing multiple mobs with the same name, change the serialization when writing to disk so that rather than storing the Entity data in a tag named after the mob, then effectively overriding that if a second mob with the same name is stored, use a NBTTagList
instead of a NBTTagCompound
, then just append additional mobs with the same name to that list.
Lastly, version the data to easily distinguish if whatever is stored needs to be remapped to the new format, or if the stored data already is in the new format (also a standard thing to do when changing the data format).
Affected versions ("latest" is NOT a version):
- Minecraft: 1.12.2
- Forge: 14.23.4.2747
- AbyssalCraft: 1.9.16
Note to self: create more issue templates for different things