Jump to content

Built-in support for unique config files for each world


Recommended Posts

Posted

As far as I am aware, right now for each installation of minecraft forge only supports a global config file for each mod. Each world will have to use the same config settings since there is only a 'global' config file for each mod. With the implementation of the config gui for forge mods, I think it would be a good idea if on the world creation screen there was a button that would take us to the mod config guis. We could then adjust the config settings for each mod to our liking and these settings would be saved specifically to the world we created. This would allow us to have different worlds with different settings. I now this is possibly to do currently, but it requires a lot work for each modder and there isn't a standard way to handle it.

Posted

It doesn't require a lot of work for each modders.

They simply have to load their configs at world load instead of init.

The only thing that doesn't exist is the on-world-create button.

Which world types do have access to.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Hey LexManos, thanks for replying! I understand if you think this shouldn't be added, I agree modders have the tools to implement this for their mods already. The thing is, if a modder doesn't implement this for their mod there is no way for a player to have separate configs for separate worlds. If the default forge behavior changed to having configs be saved for each world players would not have to worry about modders not implementing this feature. If I was a better / more confident programmer I would whip something up myself, and I understand that this is by no means a high priority addition to Forge, I just want to put the idea out there.

Posted

Sounds like an issue for the mod author to take up. You know how annoying it would be to have to change the world options each time we make a new world if we don't want the feature?

I think its my java of the variables.

Posted

Again, Forge does not control WHERE config files are stored

Forge does not control WHEN config files are read

This is all up to the modders we can't do anything about it.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Ok, I think I understand where you are coming from LexManos: there is not a standard way of dealing with configs in forge. I might try to make a library for unique configs per world, but I doubt there would be much adoption. One can dream though.

  • 1 month later...
Posted

You want per-world configs?  This is Java, use your FileIO.  All the tools you need already exist.

The hard one to figure out was "DimensionManager.getCurrentSaveRootDirectory()" and I found that just by poking around with the classes I knew about, knowing that one of them had to know where the world's save directory was.

 

		File folder = new File(DimensionManager.getCurrentSaveRootDirectory(), "myPerWorldStorage");
    	folder.mkdir();
	try {
			FileInputStream fis = new FileInputStream(new File(folder, s));
			DataInputStream instream = new DataInputStream(fis);
			//read/write file
			instream.close();
			fis.close();
	}
	catch (IOException e) {
			//error handling
	}

 

BAM.

 

And proof that I'm not talking out of my ass:

 

save.png

 

Mind, I'm saving nbt files that store run-time data not configs, but that's the rough outline of what you need.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

I'll take a look, but really what I need for it is a better runtime data structure.  The data is constructed during chunk generation and is heavily accessed.  It's just ever so slightly too slow for my liking to use NBT, but I can't figure out a better way to structure the data such that the data that's needed is held in ram and offloaded to the drive as needed; similar to chunk data, just not that much of it (I've got only a dozen or so values that need to be tracked per chunk, but it needs to be keyed by both location and string-name).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

You might look into ChunkDataEvent then.

 

Like I said, nbt is performing "well enough" for the moment, so I've been focusing on other tasks.  But I'll look into it.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

I reckon this is more up to modders than anyone else. And a library probably would not be used too much by modders as it is easy to implement yourself if you are experienced enough ;)

Posted

Like I said before, WE DO NOT control when modders load there configs, what are in the configs, where they store them. Or anything like that.

In order for modders to support per-world configs, they simply have to do it.

There is nothing needed on Forge's end, there is no 'library' needed, this is purely a modder issue.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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