Enum Class Phase

java.lang.Object
java.lang.Enum<Phase>
com.blamejared.crafttweaker.api.event.Phase
All Implemented Interfaces:
Serializable, Comparable<Phase>, Constable

public enum Phase extends Enum<Phase>
Represents the phase at which a specific event is being posted.

The exact meaning of Phase differs between implementations, but it is usually used to provide some sort of time frame for the invocation of the various event listeners. Generally, event listeners will be invoked from lowest phase to higher phase (i.e. EARLIEST, NORMAL, LATEST), but some particular implementations might choose a different order if it makes sense to do so.

The default phase of an event is always mapped to NORMAL by contract, though, allowing for general handlers to always behave correctly.

Since:
11.0.0
  • Enum Constant Details

    • EARLIEST

      public static final Phase EARLIEST
      Represents the earliest phase of event dispatching.
      Since:
      11.0.0
    • NORMAL

      public static final Phase NORMAL
      Represents the normal phase of event dispatching, also known as the default phase.
      Since:
      11.0.0
    • LATEST

      public static final Phase LATEST
      Represents the latest phase of event dispatching.
      Since:
      11.0.0
  • Method Details

    • values

      public static Phase[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Phase valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null