类 TimedRegisteredListener

java.lang.Object
org.bukkit.plugin.RegisteredListener
org.bukkit.plugin.TimedRegisteredListener

public class TimedRegisteredListener extends RegisteredListener
扩展 RegisteredListener 以包含计时信息.
  • 构造器详细资料

  • 方法详细资料

    • callEvent

      public void callEvent(@NotNull @NotNull Event event) throws EventException
      从类复制的说明: RegisteredListener
      调用事件执行器.

      原文: Calls the event executor

      覆盖:
      callEvent 在类中 RegisteredListener
      参数:
      event - 事件对象
      抛出:
      EventException - 如果事件处理器抛出异常
    • reset

      public void reset()
      重置此监听器的调用计数和总时间.

      原文: Resets the call count and total time for this listener

    • getCount

      public int getCount()
      获取此监听器被调用的总次数.

      原文: Gets the total times this listener has been called

      返回:
      此监听器被调用的次数
    • getTotalTime

      public long getTotalTime()
      获取此监听器所有调用所花费的总时间.

      原文: Gets the total time calls to this listener have taken

      返回:
      此监听器所有调用的总时间
    • getEventClass

      @Nullable public @Nullable Class<? extends Event> getEventClass()
      获取此监听器处理的事件类. 如果处理了多个事件类, 将返回最近的共享超类, 使得对于此监听器处理的任何事件, this.getEventClass().isAssignableFrom(event.getClass()) 成立, 并且不存在 this.getEventClass().isAssignableFrom(clazz) && this.getEventClass() != clazz && event.getClass().isAssignableFrom(clazz) 的类.

      原文: Gets the class of the events this listener handled. If it handled multiple classes of event, the closest shared superclass will be returned, such that for any event this listener has handled, this.getEventClass().isAssignableFrom(event.getClass()) and no class this.getEventClass().isAssignableFrom(clazz) && this.getEventClass() != clazz && event.getClass().isAssignableFrom(clazz) for all handled events.

      返回:
      此 RegisteredListener 处理的事件类
    • hasMultiple

      public boolean hasMultiple()
      获取此监听器是否处理了多个事件, 即存在两个事件使得 eventA.getClass() != eventB.getClass().

      原文: Gets whether this listener has handled multiple events, such that for some two events, eventA.getClass() != eventB.getClass().

      返回:
      如果此监听器处理了多个事件则返回 true