Posted October 3, 201510 yr Hello I want to remove a custom WorldSavedData, how can I do this ? In my mod, I need to store things for each explosion. Each explosion will have an WorldSavedData object. I will replace all block by the explosion, when no more block left, I want to remove the WorldSavedData entry. I don't want to just remove it from Map, I want to remove it from file.
October 3, 201510 yr I think you might be missunderstanding what WorldSavedData is. Its kinda of like IExtendedEntityProperties. Create ONE WorldSavedData per world that is corresponding to your mod. In that WSD hold a MAP or ARRAY of custom objects that store your "explosions". Use whatever you like to remove those "explosions" from map/array. In WSD#write/readNBT use NBTTagList and create NBT-list with your custom "explosion" objects. 1.7.10 is no longer supported by forge, you are on your own.
October 3, 201510 yr Author The problem is that I don't want to load all data in RAM. If I have one WorldSavedData wich contains all my explosion data in a Collection, all will be loaded. How can I solve this problem using the minecraft save system ? I wanted to use ChunkDataEvent to store explosionID wich is my WorldSavedData key.
October 3, 201510 yr That data will be loaded no matter if you have one or several WSD - that's what it is for. (Edit: I feel retarded, for forgetting that). If you want to load-on-demand you need to write your own saving system. Pretty simple. Make your directory with explosions and save them per-date or something using CompressedStreamTools. 1.7.10 is no longer supported by forge, you are on your own.
October 3, 201510 yr Author WorldSavedData is not loaded by default. You should explicitly use MapStorage.loadData(). I will try using my own system, using CompressedSteamTools. Thanks But I still accept alternate solutions
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.