]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blobdiff - src/main/java/com/irtimaled/bbor/client/config/ConfigManager.java
Several fixes
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / config / ConfigManager.java
index d6c301c4e581025e44d3d4d8d04c2bf6b2161ee1..7a53b9c4a291eb7b034b66845506287a64a41d3c 100644 (file)
@@ -18,8 +18,6 @@ public class ConfigManager {
     public static Setting<Boolean> drawNetherFortresses;
     public static Setting<Boolean> drawOceanMonuments;
     public static Setting<Boolean> alwaysVisible;
-    public static Setting<Boolean> drawIronGolemSpawnArea;
-    public static Setting<Boolean> drawVillageDoors;
     public static Setting<Boolean> drawSlimeChunks;
     public static Setting<Integer> slimeChunkMaxY;
     public static Setting<Boolean> keepCacheBetweenSessions;
@@ -37,9 +35,6 @@ public class ConfigManager {
     public static Setting<Boolean> renderMobSpawnerActivationLines;
     public static Setting<Boolean> drawPillagerOutposts;
     public static Setting<Boolean> outerBoxesOnly;
-    public static Setting<Integer> villageSphereDotSize;
-    public static Setting<Integer> villageSphereDensity;
-    public static Setting<Boolean> drawVillageSpheres;
     public static Setting<Boolean> drawAFKSpheres;
     public static Setting<Boolean> renderAFKSpawnableBlocks;
     public static Setting<Integer> afkSpawnableBlocksRenderDistance;
@@ -53,6 +48,64 @@ public class ConfigManager {
     public static Setting<Boolean> drawRuinedPortals;
     public static Setting<Boolean> drawConduits;
     public static Setting<Boolean> renderConduitMobHarmArea;
+    public static Setting<Boolean> drawSpawnableBlocks;
+    public static Setting<Integer> spawnableBlocksRenderWidth;
+    public static Setting<Integer> spawnableBlocksRenderHeight;
+    public static Setting<Boolean> invertBoxColorPlayerInside;
+    public static Setting<Boolean> renderSphereAsDots;
+    public static Setting<Boolean> drawFlowerForests;
+    public static Setting<Integer> flowerForestsRenderDistance;
+    public static Setting<Boolean> drawBedrockCeilingBlocks;
+
+    public static Setting<HexColor> colorWorldSpawn;
+    public static Setting<HexColor> colorLazySpawnChunks;
+    public static Setting<HexColor> colorMobSpawners;
+    public static Setting<HexColor> colorMobSpawnersLineFarAway;
+    public static Setting<HexColor> colorMobSpawnersLineNearby;
+    public static Setting<HexColor> colorMobSpawnersLineActive;
+    public static Setting<HexColor> colorSlimeChunks;
+    public static Setting<HexColor> colorAFKSpheres;
+    public static Setting<HexColor> colorAFKSpheresSafeArea;
+    public static Setting<HexColor> colorBiomeBorders;
+    public static Setting<HexColor> colorBeacons;
+    public static Setting<HexColor> colorCustom;
+    public static Setting<HexColor> colorConduits;
+    public static Setting<HexColor> colorConduitMobHarmArea;
+    public static Setting<HexColor> colorSpawnableBlocks;
+    public static Setting<HexColor> colorJungleTemples;
+    public static Setting<HexColor> colorDesertTemples;
+    public static Setting<HexColor> colorWitchHuts;
+    public static Setting<HexColor> colorOceanMonuments;
+    public static Setting<HexColor> colorShipwrecks;
+    public static Setting<HexColor> colorOceanRuins;
+    public static Setting<HexColor> colorBuriedTreasure;
+    public static Setting<HexColor> colorStrongholds;
+    public static Setting<HexColor> colorMineShafts;
+    public static Setting<HexColor> colorNetherFortresses;
+    public static Setting<HexColor> colorEndCities;
+    public static Setting<HexColor> colorMansions;
+    public static Setting<HexColor> colorIgloos;
+    public static Setting<HexColor> colorPillagerOutposts;
+    public static Setting<HexColor> colorVillages;
+    public static Setting<HexColor> colorNetherFossils;
+    public static Setting<HexColor> colorBastionRemnants;
+    public static Setting<HexColor> colorRuinedPortals;
+    public static Setting<HexColor> colorFlowerForestDandelion;
+    public static Setting<HexColor> colorFlowerForestPoppy;
+    public static Setting<HexColor> colorFlowerForestAllium;
+    public static Setting<HexColor> colorFlowerForestAzureBluet;
+    public static Setting<HexColor> colorFlowerForestRedTulip;
+    public static Setting<HexColor> colorFlowerForestOrangeTulip;
+    public static Setting<HexColor> colorFlowerForestWhiteTulip;
+    public static Setting<HexColor> colorFlowerForestPinkTulip;
+    public static Setting<HexColor> colorFlowerForestOxeyeDaisy;
+    public static Setting<HexColor> colorFlowerForestCornflower;
+    public static Setting<HexColor> colorFlowerForestLilyOfTheValley;
+    public static Setting<HexColor> colorBedrockCeilingBlocks;
+
+    public static Setting<HexColor> buttonOnOverlay;
+
+    public static Setting<Integer> fastRender;
 
     public static void loadConfig() {
         configDir = new File(".", "config");
@@ -63,6 +116,10 @@ public class ConfigManager {
         outerBoxesOnly = setup(config, "general", "outerBoxesOnly", false, "If set to true only the outer bounding boxes are rendered.");
         alwaysVisible = setup(config, "general", "alwaysVisible", false, "If set to true boxes will be visible even through other blocks.");
         keepCacheBetweenSessions = setup(config, "general", "keepCacheBetweenSessions", false, "If set to true bounding box caches will be kept between sessions.");
+        invertBoxColorPlayerInside = setup(config, "general", "invertBoxColorPlayerInside", false, "If set to true the color of any bounding box the player is inside will be inverted.");
+        renderSphereAsDots = setup(config, "general", "renderSphereAsDots", false, "If set to true spheres will be rendered as dots.");
+        buttonOnOverlay = setup(config, "general", "buttonEnabledOverlay", HexColor.from("#3000ff00"), "The color and alpha of the button overlay when a button is on.");
+        fastRender = setup(config, "general", "fastRender", 2, "Fast render settings. Higher value for faster rendering. ");
 
         drawBeacons = setup(config, "beacons", "drawBeacons", true, "If set to true beacon bounding boxes will be drawn.");
 
@@ -74,11 +131,10 @@ public class ConfigManager {
         biomeBordersRenderDistance = setup(config, "biomeBorders", "biomeBordersRenderDistance", 3, "The distance from the player where biome borders will be drawn.");
         biomeBordersMaxY = setup(config, "biomeBorders", "biomeBordersMaxY", -1, "The maximum top of the biome borders. If set to -1 it will use the value when activated, if set to 0 it will always track the players feet.");
 
-        drawVillageSpheres = setup(config, "villages", "drawVillageSpheres", true, "If set to true village bounding spheres are drawn.");
-        drawIronGolemSpawnArea = setup(config, "villages", "drawIronGolemSpawnArea", true, "If set to true the iron golem spawn area of the village will be drawn. (default:true)");
-        drawVillageDoors = setup(config, "villages", "drawVillageDoors", false, "If set to true lines between the village centre and doors will be drawn. (default:false)");
-        villageSphereDotSize = setup(config, "villages", "villageSphereDotSize", 2, "The size of the dots used when rendering village as sphere.");
-        villageSphereDensity = setup(config, "villages", "villageSphereDensity", 3, "The density of the dots used when rendering village as sphere.");
+        drawFlowerForests = setup(config, "flowerForests", "drawFlowerForests", true, "If set to true flower forest flower overlays will be drawn.");
+        flowerForestsRenderDistance = setup(config, "flowerForests", "flowerForestsRenderDistance", 3, "The distance from the player where flower forests will be drawn.");
+
+        drawBedrockCeilingBlocks = setup(config, "bedrockCeiling", "drawBedrockCeilingBlocks", true, "If set to true position with only one layer of bedrock will be drawn.");
 
         drawVillages = setup(config, "structures", "drawVillages", false, "If set to true village bounding boxes will be drawn.");
         drawDesertTemples = setup(config, "structures", "drawDesertTemples", true, "If set to true desert temple bounding boxes are drawn.");
@@ -114,6 +170,55 @@ public class ConfigManager {
         renderAFKSpawnableBlocks = setup(config, "afkSpot", "renderAFKSpawnableBlocks", true, "If set to true boxes to show spawnable blocks within the AFK sphere will be drawn.");
         afkSpawnableBlocksRenderDistance = setup(config, "afkSpot", "afkSpawnableBlocksRenderDistance", 3, "The distance from the player where spawnable blocks within the AFK sphere will be drawn.");
 
+        drawSpawnableBlocks = setup(config, "spawnableBlocks", "drawSpawnableBlocks", false, "If set to true boxes to show spawnable blocks will be drawn.");
+        spawnableBlocksRenderWidth = setup(config, "spawnableBlocks", "spawnableBlocksRenderWidth", 2, "The distance from the player where spawnable blocks will be drawn in X and Z axis.");
+        spawnableBlocksRenderHeight = setup(config, "spawnableBlocks", "spawnableBlocksRenderHeight", 1, "The distance from the player where spawnable blocks will be drawn in Y axis.");
+
+        colorWorldSpawn = setup(config, "colors", "colorWorldSpawn", HexColor.from("#ff0000"), "Color of world spawn and spawn chunks bounding boxes.");
+        colorLazySpawnChunks = setup(config, "colors", "colorLazySpawnChunks", HexColor.from("#ff0000"), "Color of lazy spawn chunks bounding boxes.");
+        colorMobSpawners = setup(config, "colors", "colorMobSpawners", HexColor.from("#00ff00"), "Color of mob spawners.");
+        colorMobSpawnersLineFarAway = setup(config, "colors", "colorMobSpawnersLineFarAway", HexColor.from("#ff0000"), "Color of mob spawner activation line if spawner far away.");
+        colorMobSpawnersLineNearby = setup(config, "colors", "colorMobSpawnersLineNearby", HexColor.from("#ff7f00"), "Color of mob spawners activation line if spawner nearby.");
+        colorMobSpawnersLineActive = setup(config, "colors", "colorMobSpawnersLineActive", HexColor.from("#00ff00"), "Color of mob spawners activation line if spawner active.");
+        colorSlimeChunks = setup(config, "colors", "colorSlimeChunks", HexColor.from("#006000"), "Color of slime chunks bounding boxes.");
+        colorAFKSpheres = setup(config, "colors", "colorAFKSpheres", HexColor.from("#ff0000"), "Color of afk spot spheres.");
+        colorAFKSpheresSafeArea = setup(config, "colors", "colorAFKSpheresSafeArea", HexColor.from("#00ff00"), "Color of afk spot safe area spheres.");
+        colorBiomeBorders = setup(config, "colors", "colorBiomeBorders", HexColor.from("#00ff00"), "Color of biome borders.");
+        colorBeacons = setup(config, "colors", "colorBeacons", HexColor.from("#ffffff"), "Color of beacon bounding boxes.");
+        colorCustom = setup(config, "colors", "colorCustom", HexColor.from("#ffffff"), "Color of all types of custom boxes.");
+        colorConduits = setup(config, "colors", "colorConduits", HexColor.from("#00ffff"), "Color of conduit bounding spheres.");
+        colorConduitMobHarmArea = setup(config, "colors", "colorConduitMobHarmArea", HexColor.from("#ff7f00"), "Color of conduit mob harm bounding boxes.");
+        colorSpawnableBlocks = setup(config, "colors", "colorSpawnableBlocks", HexColor.from("#ff0000"), "Color of spawnable blocks.");
+        colorJungleTemples = setup(config, "colors", "colorJungleTemples", HexColor.from("#006000"), "Color of jungle temple bounding boxes.");
+        colorDesertTemples = setup(config, "colors", "colorDesertTemples", HexColor.from("#ffc800"), "Color of desert temple bounding boxes.");
+        colorWitchHuts = setup(config, "colors", "colorWitchHuts", HexColor.from("#0000ff"), "Color of witch hut bounding boxes.");
+        colorOceanMonuments = setup(config, "colors", "colorOceanMonuments", HexColor.from("#00ffff"), "Color of ocean monument bounding boxes.");
+        colorShipwrecks = setup(config, "colors", "colorShipwrecks", HexColor.from("#00ffff"), "Color of ship wrecks.");
+        colorOceanRuins = setup(config, "colors", "colorOceanRuins", HexColor.from("#00ffff"), "Color of ocean ruins.");
+        colorBuriedTreasure = setup(config, "colors", "colorBuriedTreasure", HexColor.from("#00ffff"), "Color of buried treasure.");
+        colorStrongholds = setup(config, "colors", "colorStrongholds", HexColor.from("#ffff00"), "Color of stronghold bounding boxes.");
+        colorMineShafts = setup(config, "colors", "colorMineShafts", HexColor.from("#c0c0c0"), "Color of mineshaft bounding boxes.");
+        colorNetherFortresses = setup(config, "colors", "colorNetherFortresses", HexColor.from("#ff0000"), "Color of nether fortress bounding boxes.");
+        colorEndCities = setup(config, "colors", "colorEndCities", HexColor.from("#ff00ff"), "Color of end cities.");
+        colorMansions = setup(config, "colors", "colorMansions", HexColor.from("#8b4513"), "Color of woodland mansions.");
+        colorIgloos = setup(config, "colors", "colorIgloos", HexColor.from("#ffffff"), "Color of igloos.");
+        colorPillagerOutposts = setup(config, "colors", "colorPillagerOutposts", HexColor.from("#404040"), "Color of pillager outposts.");
+        colorVillages = setup(config, "colors", "colorVillages", HexColor.from("#800080"), "Color of village bounding boxes.");
+        colorNetherFossils = setup(config, "colors", "colorNetherFossils", HexColor.from("#ffffff"), "Color of nether fossils.");
+        colorBastionRemnants = setup(config, "colors", "colorBastionRemnants", HexColor.from("#c0c0c0"), "Color of bastion remnants.");
+        colorRuinedPortals = setup(config, "colors", "colorRuinedPortals", HexColor.from("#c800ff"), "Color of ruined portals.");
+        colorFlowerForestDandelion = setup(config, "colors", "colorFlowerForestDandelion", HexColor.from("#ffff00"), "Color of Flower Forest Dandelion");
+        colorFlowerForestPoppy = setup(config, "colors", "colorFlowerForestPoppy", HexColor.from("#ff0000"), "Color of Flower Forest Poppy");
+        colorFlowerForestAllium = setup(config, "colors", "colorFlowerForestAllium", HexColor.from("#ff00ff"), "Color of Flower Forest Allium");
+        colorFlowerForestAzureBluet = setup(config, "colors", "colorFlowerForestAzureBluet", HexColor.from("#d3d3d3"), "Color of Flower Forest Azure Bluet");
+        colorFlowerForestRedTulip = setup(config, "colors", "colorFlowerForestRedTulip", HexColor.from("#ff0000"), "Color of Flower Forest Red Tulip");
+        colorFlowerForestOrangeTulip = setup(config, "colors", "colorFlowerForestOrangeTulip", HexColor.from("#ff681f"), "Color of Flower Forest Orange Tulip");
+        colorFlowerForestWhiteTulip = setup(config, "colors", "colorFlowerForestWhiteTulip", HexColor.from("#d3d3d3"), "Color of Flower Forest White Tulip");
+        colorFlowerForestPinkTulip = setup(config, "colors", "colorFlowerForestPinkTulip", HexColor.from("#ff69b4"), "Color of Flower Forest Pink Tulip");
+        colorFlowerForestOxeyeDaisy = setup(config, "colors", "colorFlowerForestOxeyeDaisy", HexColor.from("#d3d3d3"), "Color of Flower Forest Oxeye Daisy");
+        colorFlowerForestCornflower = setup(config, "colors", "colorFlowerForestCornflower", HexColor.from("#0000ff"), "Color of Flower Forest Cornflower");
+        colorFlowerForestLilyOfTheValley = setup(config, "colors", "colorFlowerForestLilyOfTheValley", HexColor.from("#ffffff"), "Color of Flower Forest Lily Of The Valley");
+        colorBedrockCeilingBlocks = setup(config, "colors", "colorBedrockCeilingBlocks", HexColor.from("#00ff00"), "Color of Bedrock Ceiling Blocks");
         config.save();
     }
 
@@ -135,6 +240,9 @@ public class ConfigManager {
         Setting<T> setting = config.get(category, settingName, defaultValue);
         setting.category = category;
         setting.name = settingName;
+        setting.defaultValue = defaultValue;
+        if (setting.get() == null)
+            setting.reset();
         setting.comment = comment + " (default: " + defaultValue.toString() + ")";
         settings.add(setting);
         return setting;