Add method to check initialize state in PlatformManager, deny access to registries when uninitialized

This commit is contained in:
Alexander Brandes
2023-05-20 20:52:03 +02:00
parent 85f5006a0b
commit 264185a323
10 changed files with 50 additions and 6 deletions

View File

@ -32,7 +32,7 @@ import com.sk89q.worldedit.registry.NamespacedRegistry;
public class BiomeType implements RegistryItem, Keyed, BiomePattern {
//FAWE end
public static final NamespacedRegistry<BiomeType> REGISTRY = new NamespacedRegistry<>("biome type");
public static final NamespacedRegistry<BiomeType> REGISTRY = new NamespacedRegistry<>("biome type", true);
private final String id;
private int legacyId = -1;

View File

@ -36,7 +36,7 @@ public class BlockCategory extends Category<BlockType> implements Keyed {
//FAWE start
private boolean[] flatMap;
//FAWE end
public static final NamespacedRegistry<BlockCategory> REGISTRY = new NamespacedRegistry<>("block tag");
public static final NamespacedRegistry<BlockCategory> REGISTRY = new NamespacedRegistry<>("block tag", true);
public BlockCategory(final String id) {
super(id);

View File

@ -56,7 +56,7 @@ import static com.google.common.base.Preconditions.checkArgument;
public class BlockType implements Keyed, Pattern {
//FAWE end
public static final NamespacedRegistry<BlockType> REGISTRY = new NamespacedRegistry<>("block type");
public static final NamespacedRegistry<BlockType> REGISTRY = new NamespacedRegistry<>("block type", true);
private static final Logger LOGGER = LogManagerCompat.getLogger();
private final String id;

View File

@ -27,7 +27,7 @@ import com.sk89q.worldedit.registry.NamespacedRegistry;
public class EntityType implements RegistryItem, Keyed {
//FAWE end
public static final NamespacedRegistry<EntityType> REGISTRY = new NamespacedRegistry<>("entity type");
public static final NamespacedRegistry<EntityType> REGISTRY = new NamespacedRegistry<>("entity type", true);
private final String id;

View File

@ -39,7 +39,7 @@ import javax.annotation.Nullable;
public class ItemType implements RegistryItem, Keyed {
//FAWE end
public static final NamespacedRegistry<ItemType> REGISTRY = new NamespacedRegistry<>("item type");
public static final NamespacedRegistry<ItemType> REGISTRY = new NamespacedRegistry<>("item type", true);
private final String id;
@SuppressWarnings("deprecation")