• Recently Browsing

    No registered users viewing this page.

  • Posts

    • 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? public static Configuration config; private static String fileLocation = "config/"+OreUnify.MODID+".cfg"; public static void init() { config = new Configuration(new File(fileLocation)); //TODO default initialisation of config if empty try { config.load(); } catch (Exception e) { System.out.println("Cannot load configuration file!"); } finally { config.save(); } //TODO read data and configure the mod ConfigCategory generalConfig = config.getCategory("general"); someOtherThingIDK( generalConfig.get("enableDebug").getBoolean() ); //anotherThingIteratingOverEntrys( ??? ); }  
    • Have you registered the item form of the blocks?
    • Ah, that makes more sense. I guess that will allow the serialisation of object instances to be coded in a much more high-level (and error-proof) way, rather than hard-coding (eg nbtCompound.putInt(xxx) etc) for each type of serialisation you want.  Sounds like a good idea to me..   It looks like they have written a platform for it and are just dipping their toe in the water for refactoring the existing code, which explains why some of the defined codecs don't appear to be used anywhere yet.   thx for the tip   TGG    
    • Hi   You might find this working example of transparent models useful, just by coincidence it's also a lantern...! https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe05_block_advanced_models https://greyminecraftcoder.blogspot.com/2020/05/minecraft-by-example.html  (mbe05)   Cheers   TGG
  • Topics

  • Who's Online (See full list)