1 package com.irtimaled.bbor.common;
3 import com.irtimaled.bbor.common.models.Colors;
4 import com.irtimaled.bbor.config.ConfigManager;
5 import com.irtimaled.bbor.config.Setting;
8 import java.util.HashMap;
11 public class BoundingBoxType {
12 private static final Map<Integer, BoundingBoxType> structureTypeMap = new HashMap<>();
14 public static final BoundingBoxType JungleTemple = register(Colors.DARK_GREEN, "Jungle_Pyramid", ConfigManager.drawJungleTemples);
15 public static final BoundingBoxType DesertTemple = register(Color.ORANGE, "Desert_Pyramid", ConfigManager.drawDesertTemples);
16 public static final BoundingBoxType WitchHut = register(Color.BLUE, "Swamp_Hut", ConfigManager.drawWitchHuts);
17 public static final BoundingBoxType OceanMonument = register(Color.CYAN, "Monument", ConfigManager.drawOceanMonuments);
18 public static final BoundingBoxType Shipwreck = register(Color.CYAN, "Shipwreck", ConfigManager.drawShipwrecks);
19 public static final BoundingBoxType OceanRuin = register(Color.CYAN, "Ocean_Ruin", ConfigManager.drawOceanRuins);
20 public static final BoundingBoxType BuriedTreasure = register(Color.CYAN, "Buried_Treasure", ConfigManager.drawBuriedTreasure);
21 public static final BoundingBoxType Stronghold = register(Color.YELLOW, "Stronghold", ConfigManager.drawStrongholds);
22 public static final BoundingBoxType MineShaft = register(Color.LIGHT_GRAY, "Mineshaft", ConfigManager.drawMineShafts);
23 public static final BoundingBoxType NetherFortress = register(Color.RED, "Fortress", ConfigManager.drawNetherFortresses);
24 public static final BoundingBoxType EndCity = register(Color.MAGENTA, "EndCity", ConfigManager.drawEndCities);
25 public static final BoundingBoxType Mansion = register(Colors.BROWN, "Mansion", ConfigManager.drawMansions);
26 public static final BoundingBoxType Igloo = register(Color.WHITE, "Igloo", ConfigManager.drawIgloos);
27 public static final BoundingBoxType PillagerOutpost = register(Color.DARK_GRAY, "Pillager_Outpost", ConfigManager.drawPillagerOutposts);
28 public static final BoundingBoxType WorldSpawn = register(Color.RED, "World_Spawn", ConfigManager.drawWorldSpawn);
29 public static final BoundingBoxType SpawnChunks = register(Color.RED, "Spawn_Chunks", ConfigManager.drawWorldSpawn);
30 public static final BoundingBoxType LazySpawnChunks = register(Color.RED, "Lazy_Chunks", ConfigManager.drawLazySpawnChunks);
31 public static final BoundingBoxType MobSpawner = register(Color.GREEN, "Mob_Spawner", ConfigManager.drawMobSpawners);
32 public static final BoundingBoxType SlimeChunks = register(Colors.DARK_GREEN, "Slime_Chunks", ConfigManager.drawSlimeChunks);
33 public static final BoundingBoxType Village = register(Colors.PURPLE, "Village", ConfigManager.drawVillages);
34 public static final BoundingBoxType VillageSpheres = register(null, "Village Sphere", ConfigManager.drawVillageSpheres);
35 public static final BoundingBoxType AFKSphere = register(Color.RED, "AFK Sphere", ConfigManager.drawAFKSpheres);
36 public static final BoundingBoxType BiomeBorder = register(Color.GREEN, "Biome Border", ConfigManager.drawBiomeBorders);
37 public static final BoundingBoxType Beacon = register(Color.WHITE, "Beacon", ConfigManager.drawBeacons);
38 public static final BoundingBoxType NetherFossil = register(Color.WHITE, "Nether_Fossil", ConfigManager.drawNetherFossils);
39 public static final BoundingBoxType BastionRemnant = register(Color.LIGHT_GRAY, "Bastion_Remnant", ConfigManager.drawBastionRemnants);
40 public static final BoundingBoxType RuinedPortal = register(Colors.COOL_PURPLE, "Ruined_Portal", ConfigManager.drawRuinedPortals);
41 public static final BoundingBoxType Custom = register(Color.WHITE, "Custom", ConfigManager.drawCustomBoxes);
43 private static BoundingBoxType register(Color color, String name, Setting<Boolean> shouldRenderSetting) {
44 BoundingBoxType type = structureTypeMap.computeIfAbsent(name.hashCode(), k -> new BoundingBoxType(color, name, shouldRenderSetting));
45 StructureProcessor.registerSupportedStructure(type);
49 public static BoundingBoxType getByNameHash(Integer nameHash) {
50 return structureTypeMap.get(nameHash);
53 private final Color color;
54 private final String name;
55 public final Setting<Boolean> shouldRenderSetting;
57 private BoundingBoxType(Color color, String name, Setting<Boolean> shouldRenderSetting) {
60 this.shouldRenderSetting = shouldRenderSetting;
63 public Color getColor() {
67 public String getName() {
71 public Boolean shouldRender() {
72 return shouldRenderSetting.get();