Class PriorityCalculationEvent

  • All Implemented Interfaces:
    Event

    public class PriorityCalculationEvent
    extends java.lang.Object
    implements Event
    Event that is called when priorities are calculated. You can provide dynamic priorities for your players based on your own criteria instead of just permissions

    Just listen to this event, and use the addPriority method to add a priority. If it is higher than a player's other priorities, it will be used.

    If running ajQueue (not ajQueuePlus), then any number bigger than 0 will count as priority
    • Constructor Detail

      • PriorityCalculationEvent

        public PriorityCalculationEvent​(AdaptedPlayer player,
                                        int highestPriority)
    • Method Detail

      • getHighestPriority

        public int getHighestPriority()
        Gets the current highest priority
        Returns:
        The highest priority number
      • addPriority

        public void addPriority​(int priority)
        Adds a priority. Does nothing if the priority is lower than the player already has
        Parameters:
        priority - the priority to add