1 package com.irtimaled.bbor.common;
3 import java.util.HashMap;
6 public class BoundingBoxType {
7 private static final Map<Integer, BoundingBoxType> structureTypeMap = new HashMap<>();
9 public static final BoundingBoxType WorldSpawn = register("World_Spawn");
10 public static final BoundingBoxType SpawnChunks = register("Spawn_Chunks");
11 public static final BoundingBoxType LazySpawnChunks = register("Lazy_Chunks");
12 public static final BoundingBoxType MobSpawner = register("Mob_Spawner");
13 public static final BoundingBoxType SlimeChunks = register("Slime_Chunks");
14 public static final BoundingBoxType AFKSphere = register("AFK Sphere");
15 public static final BoundingBoxType BiomeBorder = register("Biome Border");
16 public static final BoundingBoxType Custom = register("Custom");
17 public static final BoundingBoxType Beacon = register("Beacon");
18 public static final BoundingBoxType Conduit = register("Conduit");
19 public static final BoundingBoxType SpawnableBlocks = register("Spawnable Blocks");
20 // public static final BoundingBoxType FlowerForest = register("Flower Forest");
21 public static final BoundingBoxType BedrockCeiling = register("Bedrock Ceiling");
23 public static final BoundingBoxType JungleTemple = register("jungle_pyramid");
24 public static final BoundingBoxType DesertTemple = register("desert_pyramid");
25 public static final BoundingBoxType WitchHut = register("swamp_hut");
26 public static final BoundingBoxType OceanMonument = register("monument");
27 public static final BoundingBoxType Shipwreck = register("shipwreck");
28 public static final BoundingBoxType OceanRuin = register("ocean_ruin");
29 public static final BoundingBoxType BuriedTreasure = register("buried_treasure");
30 public static final BoundingBoxType Stronghold = register("stronghold");
31 public static final BoundingBoxType MineShaft = register("mineshaft");
32 public static final BoundingBoxType NetherFortress = register("fortress");
33 public static final BoundingBoxType EndCity = register("endcity");
34 public static final BoundingBoxType Mansion = register("mansion");
35 public static final BoundingBoxType Igloo = register("igloo");
36 public static final BoundingBoxType PillagerOutpost = register("pillager_outpost");
37 public static final BoundingBoxType Village = register("village");
38 public static final BoundingBoxType NetherFossil = register("nether_fossil");
39 public static final BoundingBoxType BastionRemnant = register("bastion_remnant");
40 public static final BoundingBoxType RuinedPortal = register("ruined_portal");
42 private static BoundingBoxType register(String name) {
43 return structureTypeMap.computeIfAbsent(name.hashCode(), k -> new BoundingBoxType(name));
46 public static void registerTypes() {
47 structureTypeMap.values().forEach(StructureProcessor::registerSupportedStructure);
50 public static BoundingBoxType getByNameHash(Integer nameHash) {
51 return structureTypeMap.get(nameHash);
54 private final String name;
56 private BoundingBoxType(String name) {
60 public String getName() {
65 public int hashCode() {
66 return name.hashCode();
70 public boolean equals(Object obj) {
71 if (this == obj) return true;
72 if (obj == null || getClass() != obj.getClass()) return false;
73 BoundingBoxType other = (BoundingBoxType) obj;
74 return this.name.equals(other.name);