Class EventImpl<E>

java.lang.Object
journeymap.api.v2.common.event.impl.EventImpl<E>
All Implemented Interfaces:
Event<E>

public class EventImpl<E> extends Object implements Event<E>
  • Constructor Details

    • EventImpl

      public EventImpl(Class<E> clazz)
  • Method Details

    • subscribe

      public void subscribe(String modId, Consumer<E> listener)
      Description copied from interface: Event
      Permanently Registered listeners.
      Specified by:
      subscribe in interface Event<E>
      Parameters:
      modId - - the mod id.
      listener - - the listener.
    • subscribe

      public void subscribe(Object subscriber, String modId, Consumer<E> listener)
      Description copied from interface: Event
      When using this method, you can unsubscribe to this event.
      Specified by:
      subscribe in interface Event<E>
      Parameters:
      subscriber - - the subscribing object, used as the key for unsubscribing.
      modId - - the mod id.
      listener - - the listener.
    • unsubscribe

      public void unsubscribe(Object subscriber, String modId) throws ConcurrentModificationException
      Specified by:
      unsubscribe in interface Event<E>
      Parameters:
      subscriber - - the subscribing object, used as the key for unsubscribing.
      modId - - the mod id.
      Throws:
      ConcurrentModificationException
    • getEventClass

      public Class<E> getEventClass()
    • getListeners

      public List<EventImpl.Listener<E>> getListeners()