jayhillx

[mystics biomes] fabric config

Jan 14th, 2026 (edited)
116
0
Never
9
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.22 KB | None | 0 0
  1. package com.mysticsbiomes.config;
  2.  
  3. import com.electronwill.nightconfig.core.CommentedConfig;
  4. import com.electronwill.nightconfig.core.io.WritingMode;
  5. import com.electronwill.nightconfig.toml.TomlFormat;
  6. import com.mysticsbiomes.MysticsBiomes;
  7. import net.fabricmc.loader.api.FabricLoader;
  8.  
  9. import java.nio.file.Files;
  10. import java.nio.file.Path;
  11. import java.util.*;
  12.  
  13. public class MysticConfig {
  14.     public static final MysticConfig INSTANCE = new MysticConfig();
  15.     private static final Path PATH = FabricLoader.getInstance().getConfigDir().resolve(MysticsBiomes.modId + "-common.toml");
  16.     private CommentedConfig config;
  17.  
  18.     public static ConfigEntry<Integer> biomeRegionWeight;
  19.     public static ConfigEntry<Boolean> enableExperimentalBiomeGen;
  20.  
  21.     public static ConfigEntry<Boolean> enableStrawberryFields;
  22.     public static ConfigEntry<Boolean> enableLavenderMeadow;
  23.     public static ConfigEntry<Boolean> enableBambooBlossomForest;
  24.     public static ConfigEntry<Boolean> enableAutumnalGrove;
  25.     public static ConfigEntry<Boolean> enableLushOasis;
  26.     public static ConfigEntry<Boolean> enableLagoon;
  27.     public static ConfigEntry<Boolean> enableTropics;
  28.  
  29.     public static ConfigEntry<List<String>> strawberryFieldsBiomeSpawns;
  30.     public static ConfigEntry<List<String>> lavenderMeadowBiomeSpawns;
  31.     public static ConfigEntry<List<String>> bambooBlossomForestBiomeSpawns;
  32.     public static ConfigEntry<List<String>> autumnalGroveBiomeSpawns;
  33.     public static ConfigEntry<List<String>> lushOasisBiomeSpawns;
  34.     public static ConfigEntry<List<String>> lagoonBiomeSpawns;
  35.     public static ConfigEntry<List<String>> tropicsBiomeSpawns;
  36.  
  37.     public static ConfigEntry<List<String>> rainbowChickenBiomeSpawns;
  38.     public static ConfigEntry<Integer> rainbowChickenSpawnChance;
  39.  
  40.     private MysticConfig() {
  41.         this.config = TomlFormat.instance().createConfig();
  42.     }
  43.  
  44.     public void init() {
  45.         if (Files.exists(PATH)) {
  46.             try {
  47.                 String content = Files.readString(PATH);
  48.                 this.config = TomlFormat.instance().createParser().parse(content);
  49.             } catch (Exception e) {
  50.                 MysticsBiomes.logger.warn("Failed to read config file, using defaults.", e);
  51.                 this.config = TomlFormat.instance().createConfig();
  52.             }
  53.         } else {
  54.             this.config = TomlFormat.instance().createConfig();
  55.         }
  56.  
  57.         this.loadDefaults();
  58.         this.write();
  59.     }
  60.  
  61.     private void loadDefaults() {
  62.         biomeRegionWeight = this.build("biome_gen.biome_region_weight", "The higher the number, the more common the biomes will be.\nDefault: 6", 6);
  63.  
  64.         enableExperimentalBiomeGen = this.build("biome_gen.enable_experimental_biome_gen", "Uses the method Biomes O' Plenty uses for generating biomes.\nNot personally recommended but feel free to try it out.", false);
  65.  
  66.         enableStrawberryFields = this.build("biome_toggles.enable_strawberry_fields", "Determine if a biome will generate or not.", true);
  67.         enableLavenderMeadow = this.build("biome_toggles.enable_lavender_meadow", true);
  68.         enableBambooBlossomForest = this.build("biome_toggles.enable_bamboo_blossom_forest", true);
  69.         enableAutumnalGrove = this.build("biome_toggles.enable_autumnal_grove", true);
  70.         enableLushOasis = this.build("biome_toggles.enable_lush_oasis", true);
  71.         enableLagoon = this.build("biome_toggles.enable_lagoon", true);
  72.         enableTropics = this.build("biome_toggles.enable_tropics", true);
  73.  
  74.         strawberryFieldsBiomeSpawns = this.build("biome_spawns.strawberry_fields_spawns", "List of the biomes each biome can replace.\nWhatever biomes are listed, the given biome will have a chance to spawn in place of that biome.\nDefault: minecraft:sunflower_plains", List.of("minecraft:sunflower_plains"));
  75.         lavenderMeadowBiomeSpawns = this.build("biome_spawns.lavender_meadow_spawns", List.of("minecraft:meadow"));
  76.         bambooBlossomForestBiomeSpawns = this.build("biome_spawns.bamboo_blossom_forest_spawns", "Default: minecraft:snowy_taiga", List.of("minecraft:snowy_taiga"));
  77.         autumnalGroveBiomeSpawns = this.build("biome_spawns.autumnal_grove_spawns", "Default: minecraft:taiga", List.of("minecraft:taiga"));
  78.         lushOasisBiomeSpawns = this.build("biome_spawns.lush_oasis_spawns", "Default: minecraft:desert", List.of("minecraft:desert"));
  79.         lagoonBiomeSpawns = this.build("biome_spawns.lagoon_spawns", "Default: minecraft:beach", List.of("minecraft:beach"));
  80.         tropicsBiomeSpawns = this.build("biome_spawns.tropics_spawns", "Default: minecraft:jungle", List.of("minecraft:jungle"));
  81.  
  82.         rainbowChickenBiomeSpawns = this.build("animal_spawns.rainbow_chicken_biome_spawns", "Biomes an animal can spawn in.\nValues can include modded biomes and biome tags. (i.e. \"mysticsbiomes:strawberry_fields\")", biomes("minecraft:plains", "minecraft:forest", "minecraft:flower_forest"));
  83.  
  84.         rainbowChickenSpawnChance = this.build("rainbow_chicken_spawn_chance", "The chance an animal will spawn.\nThe higher the number, the more common the animal will spawn.", 22);
  85.     }
  86.  
  87.     private static List<String> biomes(String... biomes) {
  88.         return new ArrayList<>(Arrays.asList(biomes));
  89.     }
  90.  
  91.     public void write() {
  92.         try {
  93.             TomlFormat.instance().createWriter().write(config, PATH, WritingMode.REPLACE);
  94.         } catch (Exception e) {
  95.             MysticsBiomes.logger.error("Failed to write config file", e);
  96.         }
  97.     }
  98.    
  99.     private <T> ConfigEntry<T> build(String key, T defaultValue) {
  100.         return this.build(key, "" , defaultValue);
  101.     }
  102.  
  103.     private <T> ConfigEntry<T> build(String key, String comment, T defaultValue) {
  104.         T value = this.config.getOrElse(key, defaultValue);
  105.  
  106.         this.config.set(key, value);
  107.         if (!comment.isEmpty()) {
  108.             this.config.setComment(key, comment);
  109.         }
  110.         return new ConfigEntry<>(value);
  111.     }
  112.  
  113.     public static class ConfigEntry<T> {
  114.         private T value;
  115.  
  116.         public ConfigEntry(T value) {
  117.             this.value = value;
  118.         }
  119.  
  120.         public T get() {
  121.             return value;
  122.         }
  123.  
  124.         public void set(T value) {
  125.             this.value = value;
  126.         }
  127.     }
  128.  
  129. }
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Rynjolas
    35 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • User was banned
  • Zenimyd
    11 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=fzymcqsrft
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment