skeddles Posted September 8, 2018 Posted September 8, 2018 (edited) I'm making a config file with @Config (and to use with the in game editor, which is where I'm looking at it) It seems to sort the fields alphabetically by @Name. Is there a way to set the order or group them? Is there any way to add headings? Also if you know of an example showing how to use the info set in the config file, that would be helpful. Edited September 8, 2018 by skeddles Quote
jt9 Posted September 8, 2018 Posted September 8, 2018 If you really want to set the order, take advantage of the alphabetical ordering of @Name. Like this: @Config.Name("Biomes: Enable Biomes") public boolean enableBiomes = true; @Config.Name("Plants: Enable Overworld Plants") public boolean enableOverworldPlants = true; @Config.Name("Plants: Enable Nether Plants") public boolean enableNetherPlants = true; @Config.Name("Mobs: Enable Passive Mobs") public boolean enablePassiveMobs = true; @Config.Name("Mobs: Enable Neutral Mobs") public boolean enableNeutralMobs = true; @Config.Name("Mobs: Enable Aggressive Mobs") public boolean enableAggressiveMobs = true; This will group them by plants, mobs, etc. Quote
jabelar Posted September 9, 2018 Posted September 9, 2018 While the @Config system is quite convenient, I still prefer the previous system. It works fine. I've recently been playing around with making even more complex config editing GUIs, like for example I have a mod where you can change the color of enchantment glints and so I have it so you can enter the number in hex and it will display a preview even though the actual value being stored is an int type. Basically I like having the full control. I suppose it is possible to get to same level with @Config but since I already have it all working why fix what ain't broke? Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
skeddles Posted September 10, 2018 Author Posted September 10, 2018 Not sure if this is possible, but I want to dynamically add options to my config based on loot tables added by any mods. I thought maybe I could create an arraylist and then convert it to an enum? Doesn't seem to work though. Any advice? ArrayList<String> modLootTables = new ArrayList<String>(); //loot tables @SubscribeEvent public static void lootLoadConfig(LootTableLoadEvent evt) { String name = evt.getName().toString(); System.out.println("loot table in config!!!!" + name); entries.add(name); public static float damageScale = 1; } @Name("Loot Tables") public static Enumeration<String> e = Collections.enumeration(modLootTables); Quote
Draco18s Posted September 10, 2018 Posted September 10, 2018 enum != Enumeration https://stackoverflow.com/a/19445327/1663383 Don't know about what you're trying to do, though. Quote 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.
Recommended Posts
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.