]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blob - src/main/java/com/irtimaled/bbor/common/BoundingBoxType.java
Add: flower forest overlay
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / common / BoundingBoxType.java
1 package com.irtimaled.bbor.common;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 public class BoundingBoxType {
7     private static final Map<Integer, BoundingBoxType> structureTypeMap = new HashMap<>();
8
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
22     public static final BoundingBoxType JungleTemple = register("Jungle_Pyramid");
23     public static final BoundingBoxType DesertTemple = register("Desert_Pyramid");
24     public static final BoundingBoxType WitchHut = register("Swamp_Hut");
25     public static final BoundingBoxType OceanMonument = register("Monument");
26     public static final BoundingBoxType Shipwreck = register("Shipwreck");
27     public static final BoundingBoxType OceanRuin = register("Ocean_Ruin");
28     public static final BoundingBoxType BuriedTreasure = register("Buried_Treasure");
29     public static final BoundingBoxType Stronghold = register("Stronghold");
30     public static final BoundingBoxType MineShaft = register("Mineshaft");
31     public static final BoundingBoxType NetherFortress = register("Fortress");
32     public static final BoundingBoxType EndCity = register("EndCity");
33     public static final BoundingBoxType Mansion = register("Mansion");
34     public static final BoundingBoxType Igloo = register("Igloo");
35     public static final BoundingBoxType PillagerOutpost = register("Pillager_Outpost");
36     public static final BoundingBoxType Village = register("Village");
37     public static final BoundingBoxType NetherFossil = register("Nether_Fossil");
38     public static final BoundingBoxType BastionRemnant = register("Bastion_Remnant");
39     public static final BoundingBoxType RuinedPortal = register("Ruined_Portal");
40
41     private static BoundingBoxType register(String name) {
42         return structureTypeMap.computeIfAbsent(name.hashCode(), k -> new BoundingBoxType(name));
43     }
44
45     public static void registerTypes() {
46         structureTypeMap.values().forEach(StructureProcessor::registerSupportedStructure);
47     }
48
49     public static BoundingBoxType getByNameHash(Integer nameHash) {
50         return structureTypeMap.get(nameHash);
51     }
52
53     private final String name;
54
55     private BoundingBoxType(String name) {
56         this.name = name;
57     }
58
59     public String getName() {
60         return name;
61     }
62
63     @Override
64     public int hashCode() {
65         return name.hashCode();
66     }
67
68     @Override
69     public boolean equals(Object obj) {
70         if (this == obj) return true;
71         if (obj == null || getClass() != obj.getClass()) return false;
72         BoundingBoxType other = (BoundingBoxType) obj;
73         return this.name.equals(other.name);
74     }
75 }