Class Registry<T extends Registration>

java.lang.Object
com.hypixel.hytale.registry.Registry<T>
Type Parameters:
T - the type of registration.
Direct Known Subclasses:
ClientFeatureRegistry, CommandRegistry, EntityRegistry, EventRegistry, TaskRegistry

public abstract class Registry<T extends Registration> extends Object
A registry containing Registration's
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Returns:
      true if this registry is enabled, false otherwise.
    • enable

      public void enable()
      Called to enable this registry.
    • shutdown

      public void shutdown()
      Called to shut down this registry and unregister all Registration's
    • shutdownAndCleanup

      public void shutdownAndCleanup(boolean shutdown)
      Shuts down this registry and unregisters all registrations in reverse order.

      Unlike shutdown(), which only disables the registry, this method also executes and clears all registration cleanup tasks. Use this for registries that own their registrations list rather than sharing it with other registries.

      Parameters:
      shutdown - whether the registry is being shut down or just disabled
    • register

      public T register(@Nonnull T registration)
      Register a registration with this registry.
      Parameters:
      registration - the registration
      Returns:
      a registration for the passed registration within this registry
    • getRegistrations

      @Nonnull public List<BooleanConsumer> getRegistrations()
      Returns:
      the unmodifiable list of registrations in this registry.
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object