]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/commitdiff
Allow colors to be configured
authorIrtimaled <irtimaled@gmail.com>
Sun, 17 May 2020 09:19:00 +0000 (02:19 -0700)
committerIrtimaled <irtimaled@gmail.com>
Mon, 18 May 2020 04:08:32 +0000 (21:08 -0700)
26 files changed:
src/main/java/com/irtimaled/bbor/client/commands/Arguments.java
src/main/java/com/irtimaled/bbor/client/commands/ConfigCommand.java
src/main/java/com/irtimaled/bbor/client/commands/HexColorArgument.java [new file with mode: 0644]
src/main/java/com/irtimaled/bbor/client/config/BoundingBoxTypeHelper.java
src/main/java/com/irtimaled/bbor/client/config/ColorHelper.java [new file with mode: 0644]
src/main/java/com/irtimaled/bbor/client/config/ConfigManager.java
src/main/java/com/irtimaled/bbor/client/config/Configuration.java
src/main/java/com/irtimaled/bbor/client/config/HexColor.java [new file with mode: 0644]
src/main/java/com/irtimaled/bbor/client/gui/BoolButton.java
src/main/java/com/irtimaled/bbor/client/gui/BoundingBoxTypeButton.java
src/main/java/com/irtimaled/bbor/client/models/BoundingBoxBeacon.java
src/main/java/com/irtimaled/bbor/client/providers/CustomBeaconProvider.java
src/main/java/com/irtimaled/bbor/client/renderers/BeaconRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/BiomeBorderRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/ConduitRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/CuboidRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/LineRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/MobSpawnerRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/SlimeChunkRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/SpawnableBlocksRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/SpawningSphereRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/SphereRenderer.java
src/main/java/com/irtimaled/bbor/client/renderers/WorldSpawnRenderer.java
src/main/java/com/irtimaled/bbor/common/BoundingBoxType.java
src/main/java/com/irtimaled/bbor/common/models/AbstractBoundingBox.java
src/main/java/com/irtimaled/bbor/common/models/Colors.java [deleted file]

index 5a71d2fee3739519161c65aa8cdffb390365c29e..68a0858baa726128cdafe1be063322db1d96d9e9 100644 (file)
@@ -1,11 +1,9 @@
 package com.irtimaled.bbor.client.commands;
 
+import com.irtimaled.bbor.client.config.HexColor;
 import com.irtimaled.bbor.common.models.Coords;
 import com.irtimaled.bbor.common.models.Point;
-import com.mojang.brigadier.arguments.BoolArgumentType;
-import com.mojang.brigadier.arguments.DoubleArgumentType;
-import com.mojang.brigadier.arguments.IntegerArgumentType;
-import com.mojang.brigadier.arguments.StringArgumentType;
+import com.mojang.brigadier.arguments.*;
 import com.mojang.brigadier.context.CommandContext;
 import com.mojang.brigadier.exceptions.CommandSyntaxException;
 import net.minecraft.command.CommandSource;
@@ -43,6 +41,10 @@ public class Arguments {
         return BoolArgumentType.bool();
     }
 
+    public static ArgumentType<HexColor> hexColor() {
+        return new HexColorArgument();
+    }
+
     public static Coords getCoords(CommandContext<CommandSource> context, String name) throws CommandSyntaxException {
         return new Coords(getArgumentValueOrDefault(context, name, Vec3Argument::getVec3, () -> context.getSource().getPos()));
     }
index 00ff4ea4dd53732e96d04f42436f6a7d2348abca..c652c93acb37ae33bf04b968b1b4661b09d7bcb9 100644 (file)
@@ -1,6 +1,7 @@
 package com.irtimaled.bbor.client.commands;
 
 import com.irtimaled.bbor.client.config.ConfigManager;
+import com.irtimaled.bbor.client.config.HexColor;
 import com.irtimaled.bbor.client.config.Setting;
 import com.irtimaled.bbor.client.gui.SettingsScreen;
 import com.mojang.brigadier.Command;
@@ -85,6 +86,9 @@ public class ConfigCommand {
             case 'S':
                 buildSetSettingCommand(command, (Setting<String>) setting, Arguments.string(), String.class);
                 break;
+            case 'H':
+                buildSetSettingCommand(command, (Setting<HexColor>) setting, Arguments.hexColor(), HexColor.class);
+                break;
         }
         return command;
     }
diff --git a/src/main/java/com/irtimaled/bbor/client/commands/HexColorArgument.java b/src/main/java/com/irtimaled/bbor/client/commands/HexColorArgument.java
new file mode 100644 (file)
index 0000000..d7d8900
--- /dev/null
@@ -0,0 +1,50 @@
+package com.irtimaled.bbor.client.commands;
+
+import com.irtimaled.bbor.client.config.HexColor;
+import com.mojang.brigadier.LiteralMessage;
+import com.mojang.brigadier.StringReader;
+import com.mojang.brigadier.arguments.ArgumentType;
+import com.mojang.brigadier.context.CommandContext;
+import com.mojang.brigadier.exceptions.CommandSyntaxException;
+import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
+import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
+import com.mojang.brigadier.suggestion.Suggestions;
+import com.mojang.brigadier.suggestion.SuggestionsBuilder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+
+public class HexColorArgument implements ArgumentType<HexColor> {
+    private static final List<String> EXAMPLES = Arrays.asList("#000000", "#ffffff");
+    public static final DynamicCommandExceptionType INVALID_HEX_COLOR = new DynamicCommandExceptionType(v -> new LiteralMessage("Invalid hex color, expected six digit hex color starting with # but found '" + v + "'"));
+    public static final SimpleCommandExceptionType EXPECTED_HEX_COLOR = new SimpleCommandExceptionType(new LiteralMessage("Expected hex color"));
+
+    @Override
+    public <S> HexColor parse(StringReader reader) throws CommandSyntaxException {
+        String value = reader.getRemaining().split(" ")[0].toLowerCase();
+        if (value.isEmpty()) {
+            throw EXPECTED_HEX_COLOR.createWithContext(reader);
+        }
+
+        HexColor color = HexColor.from(value);
+        if(color != null) {
+            reader.setCursor(reader.getCursor() + 7);
+            return color;
+        }
+
+        throw INVALID_HEX_COLOR.createWithContext(reader, value);
+    }
+
+    @Override
+    public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
+        if (builder.getRemaining().length() == 0) builder.suggest("#");
+        return builder.buildFuture();
+    }
+
+    @Override
+    public Collection<String> getExamples() {
+        return EXAMPLES;
+    }
+}
index 212056ffaf50e875e27e6a3002b747e94b4f1c36..4e663580c7c5c72834e77139f283fffaf6fa45b3 100644 (file)
@@ -2,55 +2,72 @@ package com.irtimaled.bbor.client.config;
 
 import com.irtimaled.bbor.common.BoundingBoxType;
 
+import java.awt.*;
 import java.util.HashMap;
 import java.util.Map;
 
 public class BoundingBoxTypeHelper {
-    private static final Map<String, Setting<Boolean>> structureTypeMap = new HashMap<>();
+    private static final Map<String, BoundingBoxTypeSettings> structureTypeMap = new HashMap<>();
 
-    private static void registerType(BoundingBoxType type, Setting<Boolean> shouldRenderSetting) {
-        structureTypeMap.put(type.getName(), shouldRenderSetting);
+    private static void registerType(BoundingBoxType type, Setting<Boolean> shouldRender, Setting<HexColor> color) {
+        structureTypeMap.put(type.getName(), new BoundingBoxTypeSettings(shouldRender, color));
     }
 
     static {
-        registerType(BoundingBoxType.WorldSpawn, ConfigManager.drawWorldSpawn);
-        registerType(BoundingBoxType.SpawnChunks, ConfigManager.drawWorldSpawn);
-        registerType(BoundingBoxType.LazySpawnChunks, ConfigManager.drawLazySpawnChunks);
-        registerType(BoundingBoxType.MobSpawner, ConfigManager.drawMobSpawners);
-        registerType(BoundingBoxType.SlimeChunks, ConfigManager.drawSlimeChunks);
-        registerType(BoundingBoxType.AFKSphere, ConfigManager.drawAFKSpheres);
-        registerType(BoundingBoxType.BiomeBorder, ConfigManager.drawBiomeBorders);
-        registerType(BoundingBoxType.Beacon, ConfigManager.drawBeacons);
-        registerType(BoundingBoxType.Conduit, ConfigManager.drawConduits);
-        registerType(BoundingBoxType.SpawnableBlocks, ConfigManager.drawSpawnableBlocks);
-
-        registerType(BoundingBoxType.JungleTemple, ConfigManager.drawJungleTemples);
-        registerType(BoundingBoxType.DesertTemple, ConfigManager.drawDesertTemples);
-        registerType(BoundingBoxType.WitchHut, ConfigManager.drawWitchHuts);
-        registerType(BoundingBoxType.OceanMonument, ConfigManager.drawOceanMonuments);
-        registerType(BoundingBoxType.Shipwreck, ConfigManager.drawShipwrecks);
-        registerType(BoundingBoxType.OceanRuin, ConfigManager.drawOceanRuins);
-        registerType(BoundingBoxType.BuriedTreasure, ConfigManager.drawBuriedTreasure);
-        registerType(BoundingBoxType.Stronghold, ConfigManager.drawStrongholds);
-        registerType(BoundingBoxType.MineShaft, ConfigManager.drawMineShafts);
-        registerType(BoundingBoxType.NetherFortress, ConfigManager.drawNetherFortresses);
-        registerType(BoundingBoxType.EndCity, ConfigManager.drawEndCities);
-        registerType(BoundingBoxType.Mansion, ConfigManager.drawMansions);
-        registerType(BoundingBoxType.Igloo, ConfigManager.drawIgloos);
-        registerType(BoundingBoxType.PillagerOutpost, ConfigManager.drawPillagerOutposts);
-        registerType(BoundingBoxType.Village, ConfigManager.drawVillages);
-        registerType(BoundingBoxType.VillageSpheres, ConfigManager.drawVillageSpheres);
-        registerType(BoundingBoxType.NetherFossil, ConfigManager.drawNetherFossils);
-        registerType(BoundingBoxType.BastionRemnant, ConfigManager.drawBastionRemnants);
-        registerType(BoundingBoxType.RuinedPortal, ConfigManager.drawRuinedPortals);
+        registerType(BoundingBoxType.WorldSpawn, ConfigManager.drawWorldSpawn, ConfigManager.colorWorldSpawn);
+        registerType(BoundingBoxType.SpawnChunks, ConfigManager.drawWorldSpawn, ConfigManager.colorWorldSpawn);
+        registerType(BoundingBoxType.LazySpawnChunks, ConfigManager.drawLazySpawnChunks, ConfigManager.colorLazySpawnChunks);
+        registerType(BoundingBoxType.MobSpawner, ConfigManager.drawMobSpawners, ConfigManager.colorMobSpawners);
+        registerType(BoundingBoxType.SlimeChunks, ConfigManager.drawSlimeChunks, ConfigManager.colorSlimeChunks);
+        registerType(BoundingBoxType.AFKSphere, ConfigManager.drawAFKSpheres, ConfigManager.colorAFKSpheres);
+        registerType(BoundingBoxType.BiomeBorder, ConfigManager.drawBiomeBorders, ConfigManager.colorBiomeBorders);
+        registerType(BoundingBoxType.Beacon, ConfigManager.drawBeacons, ConfigManager.colorBeacons);
+        registerType(BoundingBoxType.Custom, ConfigManager.drawConduits, ConfigManager.colorCustom);
+        registerType(BoundingBoxType.Conduit, ConfigManager.drawConduits, ConfigManager.colorConduits);
+        registerType(BoundingBoxType.SpawnableBlocks, ConfigManager.drawSpawnableBlocks, ConfigManager.colorSpawnableBlocks);
+
+        registerType(BoundingBoxType.JungleTemple, ConfigManager.drawJungleTemples, ConfigManager.colorJungleTemples);
+        registerType(BoundingBoxType.DesertTemple, ConfigManager.drawDesertTemples, ConfigManager.colorDesertTemples);
+        registerType(BoundingBoxType.WitchHut, ConfigManager.drawWitchHuts, ConfigManager.colorWitchHuts);
+        registerType(BoundingBoxType.OceanMonument, ConfigManager.drawOceanMonuments, ConfigManager.colorOceanMonuments);
+        registerType(BoundingBoxType.Shipwreck, ConfigManager.drawShipwrecks, ConfigManager.colorShipwrecks);
+        registerType(BoundingBoxType.OceanRuin, ConfigManager.drawOceanRuins, ConfigManager.colorOceanRuins);
+        registerType(BoundingBoxType.BuriedTreasure, ConfigManager.drawBuriedTreasure, ConfigManager.colorBuriedTreasure);
+        registerType(BoundingBoxType.Stronghold, ConfigManager.drawStrongholds, ConfigManager.colorStrongholds);
+        registerType(BoundingBoxType.MineShaft, ConfigManager.drawMineShafts, ConfigManager.colorMineShafts);
+        registerType(BoundingBoxType.NetherFortress, ConfigManager.drawNetherFortresses, ConfigManager.colorNetherFortresses);
+        registerType(BoundingBoxType.EndCity, ConfigManager.drawEndCities, ConfigManager.colorEndCities);
+        registerType(BoundingBoxType.Mansion, ConfigManager.drawMansions, ConfigManager.colorMansions);
+        registerType(BoundingBoxType.Igloo, ConfigManager.drawIgloos, ConfigManager.colorIgloos);
+        registerType(BoundingBoxType.PillagerOutpost, ConfigManager.drawPillagerOutposts, ConfigManager.colorPillagerOutposts);
+        registerType(BoundingBoxType.Village, ConfigManager.drawVillages, ConfigManager.colorVillages);
+        registerType(BoundingBoxType.VillageSpheres, ConfigManager.drawVillageSpheres, ConfigManager.colorVillages);
+        registerType(BoundingBoxType.NetherFossil, ConfigManager.drawNetherFossils, ConfigManager.colorNetherFossils);
+        registerType(BoundingBoxType.BastionRemnant, ConfigManager.drawBastionRemnants, ConfigManager.colorBastionRemnants);
+        registerType(BoundingBoxType.RuinedPortal, ConfigManager.drawRuinedPortals, ConfigManager.colorRuinedPortals);
     }
 
     public static Setting<Boolean> renderSetting(BoundingBoxType type) {
-        return structureTypeMap.get(type.getName());
+        return structureTypeMap.get(type.getName()).shouldRender;
     }
 
     public static boolean shouldRender(BoundingBoxType type) {
-        Setting<Boolean> setting = structureTypeMap.get(type.getName());
-        return setting != null ? setting.get() : false;
+        BoundingBoxTypeSettings settings = structureTypeMap.get(type.getName());
+        return settings != null ? settings.shouldRender.get() : false;
+    }
+
+    public static Color getColor(BoundingBoxType type) {
+        BoundingBoxTypeSettings settings = structureTypeMap.get(type.getName());
+        return settings != null ? ColorHelper.getColor(settings.color) : Color.WHITE;
+    }
+
+    private static class BoundingBoxTypeSettings {
+        private final Setting<Boolean> shouldRender;
+        private final Setting<HexColor> color;
+
+        public BoundingBoxTypeSettings(Setting<Boolean> shouldRender, Setting<HexColor> color) {
+            this.shouldRender = shouldRender;
+            this.color = color;
+        }
     }
 }
diff --git a/src/main/java/com/irtimaled/bbor/client/config/ColorHelper.java b/src/main/java/com/irtimaled/bbor/client/config/ColorHelper.java
new file mode 100644 (file)
index 0000000..b1e0cd9
--- /dev/null
@@ -0,0 +1,32 @@
+package com.irtimaled.bbor.client.config;
+
+import java.awt.*;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ColorHelper {
+    private static final Map<HexColor, Color> colorMap = new HashMap<>();
+
+    private static Color getColor(HexColor value) {
+        return colorMap.computeIfAbsent(value, ColorHelper::decodeColor);
+    }
+
+    private static Color decodeColor(HexColor hexColor) {
+        try {
+            int color = Integer.decode(hexColor.getValue());
+
+            int alpha = (color >> 24) & 0xFF;
+            return new Color(color, hexColor.hasAlpha());
+        }
+        catch (Exception ignored) {
+            return null;
+        }
+    }
+
+    public static Color getColor(Setting<HexColor> value) {
+        if(value == null) return Color.WHITE;
+
+        Color color = getColor(value.get());
+        return color != null ? color : getColor(value.defaultValue);
+    }
+}
index bb0622a22cf3e46cc8397f9d138b02cc67afae9a..80992a9fc52cd6788cf256e4954bd66995dc78a5 100644 (file)
@@ -59,6 +59,42 @@ public class ConfigManager {
     public static Setting<Boolean> invertBoxColorPlayerInside;
     public static Setting<Boolean> renderSphereAsDots;
 
+    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> buttonOnOverlay;
+
     public static void loadConfig() {
         configDir = new File(".", "config");
         configDir.mkdirs();
@@ -70,6 +106,7 @@ public class ConfigManager {
         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.");
 
         drawBeacons = setup(config, "beacons", "drawBeacons", true, "If set to true beacon bounding boxes will be drawn.");
 
@@ -125,6 +162,40 @@ public class ConfigManager {
         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.");
+
         config.save();
     }
 
index 432a076d446ca106427015a7a9969a704bd34616..af4e09cf5583bd6aa750b71d7c8c339f6dc8922c 100644 (file)
@@ -83,6 +83,8 @@ class Configuration {
                 return new Setting<>(type, Integer.parseInt(value));
             case 'B':
                 return new Setting<>(type, value.equals("1") || value.toLowerCase().equals("true"));
+            case 'H':
+                return new Setting<>(type, HexColor.from(value));
         }
         return new Setting<>(type, value);
     }
diff --git a/src/main/java/com/irtimaled/bbor/client/config/HexColor.java b/src/main/java/com/irtimaled/bbor/client/config/HexColor.java
new file mode 100644 (file)
index 0000000..589188e
--- /dev/null
@@ -0,0 +1,47 @@
+package com.irtimaled.bbor.client.config;
+
+public class HexColor {
+    private final String value;
+    private final boolean hasAlpha;
+
+    private HexColor(String value, boolean hasAlpha) {
+        this.value = value;
+        this.hasAlpha = hasAlpha;
+    }
+
+    public static HexColor from(String value) {
+        String lowerValue = value.toLowerCase();
+        if (lowerValue.length() == 7 &&
+                lowerValue.matches("#[0-9a-f]{6}")) return new HexColor(lowerValue, false);
+        if (lowerValue.length() == 9 &&
+                lowerValue.matches("#[0-9a-f]{8}")) return new HexColor(lowerValue, true);
+
+        return null;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public boolean hasAlpha() {
+        return hasAlpha;
+    }
+
+    @Override
+    public String toString() {
+        return getValue();
+    }
+
+    @Override
+    public int hashCode() {
+        return value.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        HexColor hexColor = (HexColor) obj;
+        return value.equals(hexColor.value);
+    }
+}
index df85436de219a6b8b7435acb33af8fcee8774260..c2fded4b65b782bc477315233327aed8ab241e3a 100644 (file)
@@ -1,10 +1,9 @@
 package com.irtimaled.bbor.client.gui;
 
-import java.awt.*;
+import com.irtimaled.bbor.client.config.ColorHelper;
+import com.irtimaled.bbor.client.config.ConfigManager;
 
 public abstract class BoolButton extends AbstractButton {
-    private static final Color OVERLAY_COLOR = new Color(0, 255, 0, 48);
-
     private boolean value;
 
     BoolButton(int width, String label, boolean enabled) {
@@ -35,7 +34,7 @@ public abstract class BoolButton extends AbstractButton {
         int right = left + this.width - 2;
         int bottom = top + this.height - 2;
         if (this.getValue()) {
-            drawRectangle(left, top, right, bottom, OVERLAY_COLOR);
+            drawRectangle(left, top, right, bottom, ColorHelper.getColor(ConfigManager.buttonOnOverlay));
         }
     }
 }
index 7432bf227f0d7733d07a51176fb7af59133da437..8b08dd4462d2aa65bcfc24652d72a31fed907907 100644 (file)
@@ -6,11 +6,11 @@ import com.irtimaled.bbor.common.BoundingBoxType;
 import java.awt.*;
 
 public class BoundingBoxTypeButton extends BoolSettingButton {
-    private final Color color;
+    private final BoundingBoxType type;
 
     BoundingBoxTypeButton(int width, String label, BoundingBoxType type) {
         super(width, label, BoundingBoxTypeHelper.renderSetting(type));
-        color = type.getColor();
+        this.type = type;
     }
 
     @Override
@@ -22,6 +22,8 @@ public class BoundingBoxTypeButton extends BoolSettingButton {
         int right = left + width - 2;
         int bottom = top + height - 2;
 
+        Color color = BoundingBoxTypeHelper.getColor(type);
+
         // top & left
         drawRectangle(left, top, right, top + 1, color);
         drawRectangle(left, top, left + 1, bottom, color);
index 2bdfe8bc2db479e3da42d29c00088329592e51de..f6e11949747179621c019ec39d641a1d1e6e1bf8 100644 (file)
@@ -8,17 +8,22 @@ public class BoundingBoxBeacon extends BoundingBoxCuboid {
     private final Coords coords;
     private final int level;
 
-    private BoundingBoxBeacon(Coords coords, Coords minCoords, Coords maxCoords, int level) {
-        super(minCoords, maxCoords, BoundingBoxType.Beacon);
+    private BoundingBoxBeacon(Coords coords, Coords minCoords, Coords maxCoords, int level, BoundingBoxType beacon) {
+        super(minCoords, maxCoords, beacon);
         this.coords = coords;
         this.level = level;
     }
 
     public static BoundingBoxBeacon from(Coords coords, int level) {
+        BoundingBoxType type = BoundingBoxType.Beacon;
+        return from(coords, level, type);
+    }
+
+    public static BoundingBoxBeacon from(Coords coords, int level, BoundingBoxType type) {
         int range = 10 + (10 * level);
         Coords minCoords = new Coords(coords.getX() - range, coords.getY() - range, coords.getZ() - range);
         Coords maxCoords = new Coords(coords.getX() + range, 324 + range, coords.getZ() + range);
-        return new BoundingBoxBeacon(coords, minCoords, maxCoords, level);
+        return new BoundingBoxBeacon(coords, minCoords, maxCoords, level, type);
     }
 
     @Override
index adba3b5cacb2d75488cd63ed9ee1de72bf436c27..43cec2c66155fcd67173177947558b988d190659 100644 (file)
@@ -2,6 +2,7 @@ package com.irtimaled.bbor.client.providers;
 
 import com.irtimaled.bbor.client.Player;
 import com.irtimaled.bbor.client.models.BoundingBoxBeacon;
+import com.irtimaled.bbor.common.BoundingBoxType;
 import com.irtimaled.bbor.common.models.Coords;
 
 import java.util.HashMap;
@@ -17,7 +18,7 @@ public class CustomBeaconProvider implements IBoundingBoxProvider<BoundingBoxBea
 
     public static void add(Coords coords, int level) {
         int dimensionId = Player.getDimensionId();
-        BoundingBoxBeacon beacon = BoundingBoxBeacon.from(coords, level);
+        BoundingBoxBeacon beacon = BoundingBoxBeacon.from(coords, level, BoundingBoxType.Custom);
         getCache(dimensionId).put(coords, beacon);
     }
 
index 77b8bbd3ce9451129b4730404e61390522388955..1afbc9df41ec545b63b7244c8b6ce716b01c8bc5 100644 (file)
@@ -1,5 +1,6 @@
 package com.irtimaled.bbor.client.renderers;
 
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
 import com.irtimaled.bbor.client.models.BoundingBoxBeacon;
 import com.irtimaled.bbor.common.models.Coords;
 
@@ -9,7 +10,7 @@ public class BeaconRenderer extends AbstractRenderer<BoundingBoxBeacon> {
     @Override
     public void render(BoundingBoxBeacon boundingBox) {
         Coords coords = boundingBox.getCoords();
-        Color color = boundingBox.getColor();
+        Color color = BoundingBoxTypeHelper.getColor(boundingBox.getType());
         renderCuboid(new OffsetBox(coords, coords), color);
         if (boundingBox.getLevel() != 0) {
             renderCuboid(new OffsetBox(boundingBox.getMinCoords(), boundingBox.getMaxCoords()), color);
index 34deb7cf03d434ac5810d4969ecf71a7bb7e2a0a..da19a4688e1b62528a3f76174f10e997f0c632c4 100644 (file)
@@ -1,5 +1,6 @@
 package com.irtimaled.bbor.client.renderers;
 
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
 import com.irtimaled.bbor.client.config.ConfigManager;
 import com.irtimaled.bbor.client.models.BoundingBoxBiomeBorder;
 import com.irtimaled.bbor.common.models.Coords;
@@ -14,7 +15,7 @@ public class BiomeBorderRenderer extends AbstractRenderer<BoundingBoxBiomeBorder
         OffsetPoint northEast = northWest.offset(1, 0, 0);
         OffsetPoint southWest = northWest.offset(0, 0, 1);
 
-        Color color = Color.GREEN;
+        Color color = BoundingBoxTypeHelper.getColor(boundingBox.getType());
         if (boundingBox.renderNorth()) {
             render(northWest, northEast, color);
         }
index c43767522aedbcd8047c65cc0af48070cdd4c7f1..93d40ef29d5d9c18af68d90b5ef72536186c504f 100644 (file)
@@ -1,8 +1,9 @@
 package com.irtimaled.bbor.client.renderers;
 
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
+import com.irtimaled.bbor.client.config.ColorHelper;
 import com.irtimaled.bbor.client.config.ConfigManager;
 import com.irtimaled.bbor.client.models.BoundingBoxConduit;
-import com.irtimaled.bbor.common.models.Colors;
 import com.irtimaled.bbor.common.models.Point;
 
 import java.awt.*;
@@ -11,14 +12,15 @@ public class ConduitRenderer extends AbstractRenderer<BoundingBoxConduit> {
     @Override
     public void render(BoundingBoxConduit boundingBox) {
         int level = boundingBox.getLevel();
-        Color color = boundingBox.getColor();
         Point point = boundingBox.getPoint();
+        Color color = BoundingBoxTypeHelper.getColor(boundingBox.getType());
 
         OffsetPoint center = new OffsetPoint(point);
         OffsetBox centerBox = new OffsetBox(center, center).grow(0.5, 0.5, 0.5);
         renderCuboid(centerBox, color);
         if (level == 6 && ConfigManager.renderConduitMobHarmArea.get()) {
-            renderCuboid(centerBox.grow(8, 8, 8), Colors.DARK_ORANGE);
+            renderCuboid(centerBox.grow(8, 8, 8),
+                    ColorHelper.getColor(ConfigManager.colorConduitMobHarmArea));
         }
         if (level != 0) {
             renderSphere(point, boundingBox.getRadius() + 0.5, color, 5, 5);
index 2a263a2fff022b9f369bb205bb39911d010eb2a1..7042c402827e14755d9d0bf214e7e4b1cce69395 100644 (file)
@@ -1,11 +1,12 @@
 package com.irtimaled.bbor.client.renderers;
 
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
 import com.irtimaled.bbor.common.models.BoundingBoxCuboid;
 
 public class CuboidRenderer extends AbstractRenderer<BoundingBoxCuboid> {
     @Override
     public void render(BoundingBoxCuboid boundingBox) {
         OffsetBox bb = new OffsetBox(boundingBox.getMinCoords(), boundingBox.getMaxCoords());
-        renderCuboid(bb, boundingBox.getColor());
+        renderCuboid(bb, BoundingBoxTypeHelper.getColor(boundingBox.getType()));
     }
 }
index 148bcc432221eae3279c7ebac41f37a73bc6237d..42aa39e2257f7a87f9bdfc3273d6b55d8228cdc7 100644 (file)
@@ -1,5 +1,6 @@
 package com.irtimaled.bbor.client.renderers;
 
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
 import com.irtimaled.bbor.client.config.ConfigManager;
 import com.irtimaled.bbor.client.models.BoundingBoxLine;
 import org.lwjgl.opengl.GL11;
@@ -10,7 +11,7 @@ import java.util.Arrays;
 public class LineRenderer extends AbstractRenderer<BoundingBoxLine> {
     @Override
     public void render(BoundingBoxLine boundingBox) {
-        Color color = boundingBox.getColor();
+        Color color = BoundingBoxTypeHelper.getColor(boundingBox.getType());
 
         if (boundingBox.getWidth() == 0) {
             OffsetPoint startPoint = new OffsetPoint(boundingBox.getMinPoint()).offset(0, 0.001f, 0);
index 2408aca5049b43df807bfcd710b47a6bad945032..9b345805a218c993226fb62458c857634d8da4e4 100644 (file)
@@ -1,9 +1,10 @@
 package com.irtimaled.bbor.client.renderers;
 
 import com.irtimaled.bbor.client.Player;
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
+import com.irtimaled.bbor.client.config.ColorHelper;
 import com.irtimaled.bbor.client.config.ConfigManager;
 import com.irtimaled.bbor.client.models.BoundingBoxMobSpawner;
-import com.irtimaled.bbor.common.models.Colors;
 import com.irtimaled.bbor.common.models.Coords;
 
 import java.awt.*;
@@ -12,7 +13,7 @@ public class MobSpawnerRenderer extends AbstractRenderer<BoundingBoxMobSpawner>
     @Override
     public void render(BoundingBoxMobSpawner boundingBox) {
         Coords coords = boundingBox.getCoords();
-        Color color = boundingBox.getColor();
+        Color color = BoundingBoxTypeHelper.getColor(boundingBox.getType());
 
         renderCuboid(new OffsetBox(coords, coords), color);
 
@@ -30,10 +31,15 @@ public class MobSpawnerRenderer extends AbstractRenderer<BoundingBoxMobSpawner>
         OffsetPoint playerPos = new OffsetPoint(Player.getPoint());
         double distance = centerPoint.getDistance(playerPos);
         if (distance <= 20) {
-            Color color = distance > 18 ? Color.RED : distance > 16 ? Colors.DARK_ORANGE : Color.GREEN;
 
             OffsetPoint playerPoint = playerPos.offset(0, 0.1, 0);
-            renderLine(centerPoint, playerPoint, color);
+            renderLine(centerPoint, playerPoint, getColor(distance));
         }
     }
+
+    private Color getColor(double distance) {
+        if (distance > 18) return ColorHelper.getColor(ConfigManager.colorMobSpawnersLineFarAway);
+        if (distance > 16) return ColorHelper.getColor(ConfigManager.colorMobSpawnersLineNearby);
+        return ColorHelper.getColor(ConfigManager.colorMobSpawnersLineActive);
+    }
 }
index 8fd38cb0188a755394f5d656c9f6b87a90ab0fbc..ff93e2d757428780c091f2fbcb633f98e15b19f5 100644 (file)
@@ -1,6 +1,7 @@
 package com.irtimaled.bbor.client.renderers;
 
 import com.irtimaled.bbor.client.Player;
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
 import com.irtimaled.bbor.client.config.ConfigManager;
 import com.irtimaled.bbor.client.models.BoundingBoxSlimeChunk;
 
@@ -10,7 +11,7 @@ public class SlimeChunkRenderer extends AbstractRenderer<BoundingBoxSlimeChunk>
     @Override
     public void render(BoundingBoxSlimeChunk boundingBox) {
         OffsetBox bb = new OffsetBox(boundingBox.getMinCoords(), boundingBox.getMaxCoords());
-        Color color = boundingBox.getColor();
+        Color color = BoundingBoxTypeHelper.getColor(boundingBox.getType());
         renderCuboid(bb, color);
 
         double maxY = Player.getMaxY(ConfigManager.slimeChunkMaxY.get());
index 504ce3fcec2743310130495975467df4e44fd706..7cb1577ec5eae8514b64fbc711d1a2cdcd34a9e2 100644 (file)
@@ -1,16 +1,20 @@
 package com.irtimaled.bbor.client.renderers;
 
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
 import com.irtimaled.bbor.client.models.BoundingBoxSpawnableBlocks;
 
+import java.awt.*;
+
 public class SpawnableBlocksRenderer extends AbstractRenderer<BoundingBoxSpawnableBlocks> {
     @Override
     public void render(BoundingBoxSpawnableBlocks boundingBox) {
-        boundingBox.getBlocks().forEach(c ->        {
+        Color color = BoundingBoxTypeHelper.getColor(boundingBox.getType());
+        boundingBox.getBlocks().forEach(c -> {
             int x = c.getX();
             int y = c.getY();
             int z = c.getZ();
             OffsetBox offsetBox = new OffsetBox(x, y, z, x + 1, y, z + 1);
-            renderCuboid(offsetBox, boundingBox.getColor());
+            renderCuboid(offsetBox, color);
         });
     }
 }
index 8ff4e6a3acc217ef8f686196a1ee0dccb4b74cb0..63080aeaaf40fd9d37af6c70a9b1cf53e10f7a03 100644 (file)
@@ -1,8 +1,11 @@
 package com.irtimaled.bbor.client.renderers;
 
 import com.irtimaled.bbor.client.Player;
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
+import com.irtimaled.bbor.client.config.ColorHelper;
 import com.irtimaled.bbor.client.config.ConfigManager;
 import com.irtimaled.bbor.client.models.BoundingBoxSpawningSphere;
+import com.irtimaled.bbor.common.BoundingBoxType;
 import com.irtimaled.bbor.common.models.Point;
 import net.minecraft.client.resources.I18n;
 
@@ -15,7 +18,8 @@ public class SpawningSphereRenderer extends AbstractRenderer<BoundingBoxSpawning
         OffsetPoint sphereCenter = new OffsetPoint(point);
 
         OffsetBox offsetBox = new OffsetBox(sphereCenter, sphereCenter).grow(0.5, 0, 0.5);
-        renderCuboid(offsetBox, Color.GREEN);
+        Color safeAreaColor = ColorHelper.getColor(ConfigManager.colorAFKSpheresSafeArea);
+        renderCuboid(offsetBox, safeAreaColor);
 
         Integer spawnableSpacesCount = boundingBox.getSpawnableSpacesCount();
         if (spawnableSpacesCount != null) {
@@ -25,21 +29,28 @@ public class SpawningSphereRenderer extends AbstractRenderer<BoundingBoxSpawning
                             String.format("%,d", spawnableSpacesCount));
         }
 
-        renderSphere(point, BoundingBoxSpawningSphere.SAFE_RADIUS, Color.GREEN, 5, 5);
-        renderSphere(point, BoundingBoxSpawningSphere.SPAWN_RADIUS, Color.RED, 5, 5);
+        renderSphere(point, BoundingBoxSpawningSphere.SAFE_RADIUS, safeAreaColor, 5, 5);
+
+        renderOuterSphere(boundingBox, point);
 
         if (ConfigManager.renderAFKSpawnableBlocks.get() && boundingBox.isWithinSphere(Player.getPoint())) {
             renderSpawnableSpaces(boundingBox);
         }
     }
 
+    private void renderOuterSphere(BoundingBoxSpawningSphere boundingBox, Point point) {
+        Color color = BoundingBoxTypeHelper.getColor(boundingBox.getType());
+        renderSphere(point, BoundingBoxSpawningSphere.SPAWN_RADIUS, color, 5, 5);
+    }
+
     private void renderSpawnableSpaces(BoundingBoxSpawningSphere boundingBox) {
+        Color color = BoundingBoxTypeHelper.getColor(BoundingBoxType.SpawnableBlocks);
         boundingBox.getBlocks().forEach(c -> {
             int x = c.getX();
             int y = c.getY();
             int z = c.getZ();
             OffsetBox offsetBox = new OffsetBox(x, y, z, x + 1, y, z + 1);
-            renderCuboid(offsetBox, boundingBox.getColor());
+            renderCuboid(offsetBox, color);
         });
     }
 }
index 97cceaf8555d5805dff0641b58c868a31c97efe6..0144becc0f85c3d48fbe8447ebee2ca75c57e9ed 100644 (file)
@@ -1,5 +1,6 @@
 package com.irtimaled.bbor.client.renderers;
 
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
 import com.irtimaled.bbor.common.models.BoundingBoxSphere;
 import com.irtimaled.bbor.common.models.Point;
 
@@ -8,6 +9,6 @@ public class SphereRenderer extends AbstractRenderer<BoundingBoxSphere> {
     public void render(BoundingBoxSphere boundingBox) {
         Point point = boundingBox.getPoint();
         double radius = boundingBox.getRadius();
-        renderSphere(point, radius, boundingBox.getColor(), 5, 5);
+        renderSphere(point, radius, BoundingBoxTypeHelper.getColor(boundingBox.getType()), 5, 5);
     }
 }
index 91aadbeff323b716066b2d46c4fa12b5b58a5d7f..2eba30a4c6255b10e3701d794eb9868553e4e1cb 100644 (file)
@@ -1,22 +1,20 @@
 package com.irtimaled.bbor.client.renderers;
 
 import com.irtimaled.bbor.client.Player;
+import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
 import com.irtimaled.bbor.client.config.ConfigManager;
 import com.irtimaled.bbor.client.models.BoundingBoxWorldSpawn;
 import com.irtimaled.bbor.common.models.Coords;
 
-import java.awt.*;
-
 public class WorldSpawnRenderer extends AbstractRenderer<BoundingBoxWorldSpawn> {
     @Override
     public void render(BoundingBoxWorldSpawn boundingBox) {
-        Color color = boundingBox.getColor();
         Coords minCoords = boundingBox.getMinCoords();
         Coords maxCoords = boundingBox.getMaxCoords();
 
         double y = Player.getMaxY(ConfigManager.worldSpawnMaxY.get());
 
         OffsetBox offsetBox = new OffsetBox(minCoords.getX(), y, minCoords.getZ(), maxCoords.getX(), y, maxCoords.getZ());
-        renderOutlinedCuboid(offsetBox.nudge(), color);
+        renderOutlinedCuboid(offsetBox.nudge(), BoundingBoxTypeHelper.getColor(boundingBox.getType()));
     }
 }
index 51fe9b67e80ccefccbf9f1371920f4d705a37269..ea3902cf3ad2caff8355414b79682faa710358d6 100644 (file)
@@ -1,48 +1,45 @@
 package com.irtimaled.bbor.common;
 
-import com.irtimaled.bbor.common.models.Colors;
-
-import java.awt.*;
 import java.util.HashMap;
 import java.util.Map;
 
 public class BoundingBoxType {
     private static final Map<Integer, BoundingBoxType> structureTypeMap = new HashMap<>();
 
-    public static final BoundingBoxType WorldSpawn = register(Color.RED, "World_Spawn");
-    public static final BoundingBoxType SpawnChunks = register(Color.RED, "Spawn_Chunks");
-    public static final BoundingBoxType LazySpawnChunks = register(Color.RED, "Lazy_Chunks");
-    public static final BoundingBoxType MobSpawner = register(Color.GREEN, "Mob_Spawner");
-    public static final BoundingBoxType SlimeChunks = register(Colors.DARK_GREEN, "Slime_Chunks");
-    public static final BoundingBoxType AFKSphere = register(Color.RED, "AFK Sphere");
-    public static final BoundingBoxType BiomeBorder = register(Color.GREEN, "Biome Border");
-    public static final BoundingBoxType Custom = register(Color.WHITE, "Custom");
-    public static final BoundingBoxType Beacon = register(Color.WHITE, "Beacon");
-    public static final BoundingBoxType Conduit = register(Color.CYAN, "Conduit");
-    public static final BoundingBoxType SpawnableBlocks = register(Color.RED, "Spawnable Blocks");
+    public static final BoundingBoxType WorldSpawn = register("World_Spawn");
+    public static final BoundingBoxType SpawnChunks = register("Spawn_Chunks");
+    public static final BoundingBoxType LazySpawnChunks = register("Lazy_Chunks");
+    public static final BoundingBoxType MobSpawner = register("Mob_Spawner");
+    public static final BoundingBoxType SlimeChunks = register("Slime_Chunks");
+    public static final BoundingBoxType AFKSphere = register("AFK Sphere");
+    public static final BoundingBoxType BiomeBorder = register("Biome Border");
+    public static final BoundingBoxType Custom = register("Custom");
+    public static final BoundingBoxType Beacon = register("Beacon");
+    public static final BoundingBoxType Conduit = register("Conduit");
+    public static final BoundingBoxType SpawnableBlocks = register("Spawnable Blocks");
 
-    public static final BoundingBoxType JungleTemple = register(Colors.DARK_GREEN, "Jungle_Pyramid");
-    public static final BoundingBoxType DesertTemple = register(Color.ORANGE, "Desert_Pyramid");
-    public static final BoundingBoxType WitchHut = register(Color.BLUE, "Swamp_Hut");
-    public static final BoundingBoxType OceanMonument = register(Color.CYAN, "Monument");
-    public static final BoundingBoxType Shipwreck = register(Color.CYAN, "Shipwreck");
-    public static final BoundingBoxType OceanRuin = register(Color.CYAN, "Ocean_Ruin");
-    public static final BoundingBoxType BuriedTreasure = register(Color.CYAN, "Buried_Treasure");
-    public static final BoundingBoxType Stronghold = register(Color.YELLOW, "Stronghold");
-    public static final BoundingBoxType MineShaft = register(Color.LIGHT_GRAY, "Mineshaft");
-    public static final BoundingBoxType NetherFortress = register(Color.RED, "Fortress");
-    public static final BoundingBoxType EndCity = register(Color.MAGENTA, "EndCity");
-    public static final BoundingBoxType Mansion = register(Colors.BROWN, "Mansion");
-    public static final BoundingBoxType Igloo = register(Color.WHITE, "Igloo");
-    public static final BoundingBoxType PillagerOutpost = register(Color.DARK_GRAY, "Pillager_Outpost");
-    public static final BoundingBoxType Village = register(Colors.PURPLE, "Village");
-    public static final BoundingBoxType VillageSpheres = register(null, "Village Sphere");
-    public static final BoundingBoxType NetherFossil = register(Color.WHITE, "Nether_Fossil");
-    public static final BoundingBoxType BastionRemnant = register(Color.LIGHT_GRAY, "Bastion_Remnant");
-    public static final BoundingBoxType RuinedPortal = register(Colors.COOL_PURPLE, "Ruined_Portal");
+    public static final BoundingBoxType JungleTemple = register("Jungle_Pyramid");
+    public static final BoundingBoxType DesertTemple = register("Desert_Pyramid");
+    public static final BoundingBoxType WitchHut = register("Swamp_Hut");
+    public static final BoundingBoxType OceanMonument = register("Monument");
+    public static final BoundingBoxType Shipwreck = register("Shipwreck");
+    public static final BoundingBoxType OceanRuin = register("Ocean_Ruin");
+    public static final BoundingBoxType BuriedTreasure = register("Buried_Treasure");
+    public static final BoundingBoxType Stronghold = register("Stronghold");
+    public static final BoundingBoxType MineShaft = register("Mineshaft");
+    public static final BoundingBoxType NetherFortress = register("Fortress");
+    public static final BoundingBoxType EndCity = register("EndCity");
+    public static final BoundingBoxType Mansion = register("Mansion");
+    public static final BoundingBoxType Igloo = register("Igloo");
+    public static final BoundingBoxType PillagerOutpost = register("Pillager_Outpost");
+    public static final BoundingBoxType Village = register("Village");
+    public static final BoundingBoxType VillageSpheres = register("Village Sphere");
+    public static final BoundingBoxType NetherFossil = register("Nether_Fossil");
+    public static final BoundingBoxType BastionRemnant = register("Bastion_Remnant");
+    public static final BoundingBoxType RuinedPortal = register("Ruined_Portal");
 
-    private static BoundingBoxType register(Color color, String name) {
-        BoundingBoxType type = structureTypeMap.computeIfAbsent(name.hashCode(), k -> new BoundingBoxType(color, name));
+    private static BoundingBoxType register(String name) {
+        BoundingBoxType type = structureTypeMap.computeIfAbsent(name.hashCode(), k -> new BoundingBoxType(name));
         StructureProcessor.registerSupportedStructure(type);
         return type;
     }
@@ -51,18 +48,12 @@ public class BoundingBoxType {
         return structureTypeMap.get(nameHash);
     }
 
-    private final Color color;
     private final String name;
 
-    private BoundingBoxType(Color color, String name) {
-        this.color = color;
+    private BoundingBoxType(String name) {
         this.name = name;
     }
 
-    public Color getColor() {
-        return color;
-    }
-
     public String getName() {
         return name;
     }
index 2c1bae244d7c9061cdaeea02296326eabf13cbe9..76a3f0b7348e20ba7e9b14d337776cf9f78cf553 100644 (file)
@@ -2,8 +2,6 @@ package com.irtimaled.bbor.common.models;
 
 import com.irtimaled.bbor.common.BoundingBoxType;
 
-import java.awt.*;
-
 public abstract class AbstractBoundingBox {
     private final BoundingBoxType type;
 
@@ -11,10 +9,6 @@ public abstract class AbstractBoundingBox {
         this.type = type;
     }
 
-    public Color getColor() {
-        return type.getColor();
-    }
-
     public abstract Boolean intersectsBounds(int minX, int minZ, int maxX, int maxZ);
 
     public BoundingBoxType getType() {
diff --git a/src/main/java/com/irtimaled/bbor/common/models/Colors.java b/src/main/java/com/irtimaled/bbor/common/models/Colors.java
deleted file mode 100644 (file)
index 6fd0f69..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.irtimaled.bbor.common.models;
-
-import java.awt.*;
-
-public class Colors {
-    public static final Color DARK_ORANGE = new Color(255, 127, 0);
-    public static final Color DARK_GREEN = new Color(0, 96, 0);
-    public static final Color BROWN = new Color(139, 69, 19);
-    public static final Color PURPLE = new Color(128, 0, 128);
-    public static final Color COOL_PURPLE = new Color(200, 0, 255);
-}