Jump to content

[1.6.4] Set Value in Config File


Rhonim

Recommended Posts

Alright, so basically I'm trying to set a value in the config file through a command. Problem is, I can't find any function that would allow me to do this, anything that I want to access in order to do it is all private. Trying to avoid having to individually write in about 100+ things for the config file, and instead be able to go into the game and use a command to be able to set it to those value for me.

 

I know how to do the command, just need to know how to set the value again once the default one has been set.

Link to comment
Share on other sites

Here's an example from my mod, dealing with integer arrays:

 

                        int[] white = config.get("WorldGen","dimensionWhitelistList", new int[] {0}).getIntList();
                        int[] black = config.get("WorldGen","dimensionBlacklistList", new int[] {-1,1}).getIntList();
                        
                        Arrays.sort(white);
                        Arrays.sort(black);
                        
                        String a=Arrays.toString(white);
                        String whitestring[]=a.substring(1,a.length()-1).split(", ");
                        String b=Arrays.toString(black);
                        String blackstring[]=b.substring(1,b.length()-1).split(", ");
                        config.get("WorldGen","dimensionWhitelistList", new int[] {0}).set(whitestring);
                        config.get("WorldGen","dimensionBlacklistList", new int[] {-1,1}).set(blackstring);

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.

Link to comment
Share on other sites

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.