Package org.bukkit.event

Examples of org.bukkit.event.EventPriority


    for (RegisteredListener registration : listeners)
    {
      try
      {
        EventPriority thisPriority = (EventPriority) fieldRegisteredListenerDotPriority.get(registration);
        if (thisPriority != priority) continue;
      }
      catch (Exception e)
      {
        e.printStackTrace();
View Full Code Here


      }
      else
      {
        try
        {
          EventPriority thisPriority = (EventPriority) fieldRegisteredListenerDotPriority.get(registration);
          Listener thisListener = (Listener) fieldRegisteredListenerDotListener.get(registration);
          if (thisListener == listener && thisPriority == priority) run = true;
        }
        catch (Exception e)
        {
View Full Code Here

            if(!event.getClass().isInstance(event)) {
                throw new IllegalArgumentException(type.asString().toUpperCase() + " is not of type Event");
            }
            Class<? extends Event> realtype = (Class<? extends Event>)event;
            EventPriority realpriority = EventPriority.valueOf(priority.upper());
            registerEvent(handler, realtype, realpriority);

        } catch (ClassNotFoundException e) {
            Bukkit.getLogger().log(Level.SEVERE, "Could not register event " + type +" because the event could not be found", e);
        }
View Full Code Here

    setListenerOrder(listener, eventClass, true);
  }

  private static void setListenerOrder(Listener listener, Class<?> eventClass, boolean first) {
    HandlerList list = getEventHandlerList(eventClass);
    final EventPriority prio = first ? EventPriority.LOWEST : EventPriority.MONITOR;
    synchronized (list) {
      EnumMap<EventPriority, ArrayList<RegisteredListener>> handlerSlots = SafeField.get(list, "handlerslots");
      ArrayList<RegisteredListener> registeredListenerList = handlerSlots.get(prio);
      int requestedIndex = first ? 0 : (registeredListenerList.size() - 1);
View Full Code Here

TOP

Related Classes of org.bukkit.event.EventPriority

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.