Jump to content

[1.7.10] How to save config into the server before world is loaded?


Abastro

Recommended Posts

Hi, I'm Abastro, developing Stellarium mod.

 

Currently I'm working on config load/save part from World.

So I set up some code with WorldSavedData, and I confronted a vital problem.

 

The problem was:

The dimensions(providers) should be changed via the content of the config.

but the World instance does not exist when dimensions can be changed, so WorldSavedData is invalid on that moment.

As a result, loading/saving with WorldSavedData is incompatible with changing dimensions.

 

I want to know whether I'm wrong somewhere or there are the best solutions for this problem.

Is there any breakthrough for this problem? I'm looking forward to it!

Any help would appreciated!

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

Would you only have to do it once before loading a world and then after that the world could use world save data? In that case I think you could use a Config -- use Config unless there is world save data then use that, and you can change the config based on what is happening in the game. If you need to keep track of multiple saves with different information, you could potentially make your own ID system for the world saves mapping to config info.

 

But otherwise, file operations in Java aren't too hard. So you can take the configuration file path (there is one suggested passed into the pre init event) and make your own files there.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Would you only have to do it once before loading a world and then after that the world could use world save data? In that case I think you could use a Config -- use Config unless there is world save data then use that, and you can change the config based on what is happening in the game. If you need to keep track of multiple saves with different information, you could potentially make your own ID system for the world saves mapping to config info.

 

But otherwise, file operations in Java aren't too hard. So you can take the configuration file path (there is one suggested passed into the pre init event) and make your own files there.

Thanks for the reply. I have to use config information to determine which dimension exists or not, and change the provider of Overworld. So is there any other way to do this without direct file operations?

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

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.

×
×
  • Create New...

Important Information

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