Jump to content

1.8 - Remove a world saved data


Blackout

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.