Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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.

  • 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.

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.

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.