Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Config {
- public static Config instance = new Config();
- public static Configuration config;
- // Settings world gen
- public static boolean spawnFlowers = true;
- public static boolean spawnTin = true;
- public static boolean spawnCopper = true;
- public static boolean spawnJade = true;
- public static boolean spawnAmethyst = true;
- public static boolean spawnBasalt = true;
- // Setting crafting
- public static boolean duplicatePatterns = true;
- @SubscribeEvent
- public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
- if (eventArgs.getModID().equals(Reference.modid))
- Config.syncConfig();
- }
- public static void init(File file) {
- config = new Configuration(file);
- config.load();
- syncConfig();
- }
- public static void syncConfig() {
- String worldCategory = "World Generaration";
- String craftingCategory = "Crafting";
- config.addCustomCategoryComment(worldCategory, "World Generaration Settings");
- spawnFlowers = config.getBoolean("spawnFlowers", worldCategory, true,
- "Turns on and off flower world generation");
- spawnCopper = config.getBoolean("spawnCopper", worldCategory, true, "Turns on and off copper world generation");
- spawnTin = config.getBoolean("spawnTin", worldCategory, true, "Turns on and off tin world generation");
- spawnJade = config.getBoolean("spawnJade", worldCategory, true, "Turns on and off jade world generation");
- spawnAmethyst = config.getBoolean("spawnAmethyst", worldCategory, true,
- "Turns on and off amethyst world generation");
- spawnBasalt = config.getBoolean("spawnBasalt", worldCategory, true, "Turns on and off basalt world generation");
- config.addCustomCategoryComment(craftingCategory, "Crafting Settings");
- duplicatePatterns = config.getBoolean("duplicatePatterns", craftingCategory, true,
- "Turns on and off duplication of wooden patterns, for example a wooden pattern and a wooden pattern wall crafts 2 wooden pattern walls");
- config.save();
- }
- public static void resetConfig() {
- spawnFlowers = true;
- spawnTin = true;
- spawnCopper = true;
- spawnJade = true;
- spawnAmethyst = true;
- spawnBasalt = true;
- duplicatePatterns = true;
- config.save();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement