Im new to Forge modding, Im currently trying to create a config that follows a structure like, or equivalent to this:
# Configuration file
materials [# some default comment that describes what these values do{
S:ore=thermalfoundation:ore:0
S:ingot=thermalfoundation:material:128
S:dust=thermalfoundation:material:64}{
S:ore=thermalfoundation:ore:1
S:ingot=thermalfoundation:material:129
S:dust=thermalfoundation:material:65}{
S:ore=thermalfoundation:ore:2
S:ingot=thermalfoundation:material:130
S:dust=thermalfoundation:material:66}## ... etc]
general {
B:enableDebug=true
I:stuffidk=100## etc etc}
I want my mod to be standalone in sense of only having to have a forge installation. Im quite reluctant to create custom scripts that parse and serialize raw text from files, and would like to keep using forge's provided configutation manager. I want the amount of entry's in materials to be variable, with each having no name if possible.
Right now my code is fairly simple. How would I go about achieving the above?
publicstaticConfiguration config;privatestaticString fileLocation ="config/"+OreUnify.MODID+".cfg";publicstaticvoid init(){
config =newConfiguration(newFile(fileLocation));//TODO default initialisation of config if emptytry{
config.load();}catch(Exception e){System.out.println("Cannot load configuration file!");} finally {
config.save();}//TODO read data and configure the modConfigCategory generalConfig = config.getCategory("general");
someOtherThingIDK( generalConfig.get("enableDebug").getBoolean());//anotherThingIteratingOverEntrys( ??? );}
[1.12.2] Nested ConfigCategorys in arrays
in Modder Support
Posted
Im new to Forge modding, Im currently trying to create a config that follows a structure like, or equivalent to this:
I want my mod to be standalone in sense of only having to have a forge installation. Im quite reluctant to create custom scripts that parse and serialize raw text from files, and would like to keep using forge's provided configutation manager. I want the amount of entry's in materials to be variable, with each having no name if possible.
Right now my code is fairly simple. How would I go about achieving the above?