package com.irtimaled.bbor.common;
+import it.unimi.dsi.fastutil.objects.Object2ObjectMaps;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+
import java.util.HashMap;
import java.util.Map;
public class BoundingBoxType {
- private static final Map<Integer, BoundingBoxType> structureTypeMap = new HashMap<>();
+ private static final Map<Integer, BoundingBoxType> structureTypeMap = Object2ObjectMaps.synchronize(new Object2ObjectOpenHashMap<>());
public static final BoundingBoxType WorldSpawn = register("World_Spawn");
public static final BoundingBoxType SpawnChunks = register("Spawn_Chunks");
public static final BoundingBoxType FlowerForest = register("Flower Forest");
public static final BoundingBoxType BedrockCeiling = register("Bedrock Ceiling");
- 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 NetherFossil = register("nether_fossil");
- public static final BoundingBoxType BastionRemnant = register("bastion_remnant");
- public static final BoundingBoxType RuinedPortal = register("ruined_portal");
+ public static final Map<String, BoundingBoxType> structures = new HashMap<>();
- private static BoundingBoxType register(String name) {
+ public static BoundingBoxType register(String name) {
return structureTypeMap.computeIfAbsent(name.hashCode(), k -> new BoundingBoxType(name));
}