Class EventRegistration<KeyType, EventType extends IBaseEvent<KeyType>>

java.lang.Object
com.hypixel.hytale.registry.Registration
com.hypixel.hytale.event.EventRegistration<KeyType, EventType>
Type Parameters:
KeyType - The key type filter for this event call.
EventType - The event type.

public class EventRegistration<KeyType, EventType extends IBaseEvent<KeyType>> extends Registration
An event registration that can be unregistered.
  • Constructor Details

    • EventRegistration

      public EventRegistration(@Nonnull Class<EventType> eventClass, @Nonnull BooleanSupplier isEnabled, @Nonnull Runnable unregister)
      Default Constructor for an EventRegistration instance.
      Parameters:
      eventClass - The event class for this registration.
      isEnabled - The enabled condition for this registration.
      unregister - The unregister action for this registration.
    • EventRegistration

      public EventRegistration(@Nonnull EventRegistration<KeyType, EventType> registration, @Nonnull BooleanSupplier isEnabled, @Nonnull Runnable unregister)
      Copy Constructor for an EventRegistration instance.
      Parameters:
      registration - The registration to copy.
      isEnabled - The enabled condition for this registration.
      unregister - The unregister action for this registration.
  • Method Details

    • getEventClass

      @Nonnull public Class<EventType> getEventClass()
      Returns:
      the event class for this registration.
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Registration
    • combine

      @Nonnull @SafeVarargs public static <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> combine(@Nonnull EventRegistration<KeyType, EventType> thisRegistration, @Nonnull EventRegistration<KeyType, EventType>... containerRegistrations)
      Called to combine multiple event registrations into one.
      Type Parameters:
      KeyType - The key type filter for this event call.
      EventType - The event type.
      Parameters:
      thisRegistration - The first event registration.
      containerRegistrations - The other event registrations.
      Returns:
      the combined event registration.