Class NewFrozenRegistry<T extends RegistryKey<K>,K>

Type Parameters:
T - The type of objects stored in the registry, which must implement RegistryKey.
K - The key type used to identify objects in the registry.
All Implemented Interfaces:
Registry<T,K>

public class NewFrozenRegistry<T extends RegistryKey<K>,K> extends WriteableRegistry<T,K>
A registry that can be frozen, preventing any further registrations. This is useful for registries that should not change after a certain point.
  • Constructor Details

    • NewFrozenRegistry

      public NewFrozenRegistry(Supplier<Map<K,T>> registrySupplier)
    • NewFrozenRegistry

      public NewFrozenRegistry()
  • Method Details

    • freeze

      public void freeze()
    • register

      public boolean register(@NotNull T object)
      Description copied from class: WriteableRegistry
      Registers an object within the registry
      Overrides:
      register in class WriteableRegistry<T extends RegistryKey<K>,K>
      Parameters:
      object - the object to register
      Returns:
      true if the value was successfully registered, otherwise false.