TrainerGuy22 / Reliquary

The source code of Reliquary! That mod, with the magical swag, and a weapon, and stuff.
Other
42 stars 24 forks source link

Possible Solution to Our NBT Item woes #124

Closed MercuriusXeno closed 9 years ago

MercuriusXeno commented 9 years ago

Create a UUID for the NBT tag of all of our items and link that to a reliquary save file that stores the item's NBT data in a list of other item's nbt stack tags. This way, the item nbt tag never changes (except when first created) and all the item data is stored off-site, meaning the item won't flicker/cycle when the nbt tag changes, and the name won't popup.

This will require a somewhat elaborate server-to-client update handler to take care of syncing the clientside NBT to server, and will also change the way we save our NBT data. Also, we'll need a method to "garbage collect" any items which can be potentially destroyed so that we're not storing invalid UUIDs in the list (mostly for cleanliness, saving negligible space).

MercuriusXeno commented 9 years ago

Here's some examples of using WorldSaveData to create an "NBT Driver" similar to what I'm envisioning, courtesy of chylex:

https://github.com/chylex/Hardcore-Ender-Expansion/blob/master/src/main/java/chylex/hee/system/savedata/WorldDataHandler.java

https://github.com/chylex/Hardcore-Ender-Expansion/blob/master/src/main/java/chylex/hee/system/savedata/types/DragonSavefile.java

MercuriusXeno commented 9 years ago

This was a tremendous success. I will now begin converting all our items to using it.

MercuriusXeno commented 9 years ago

Items are all converted, needs testing, but code-complete.