Enum Class GrantMode

java.lang.Object
java.lang.Enum<GrantMode>
io.github.lambdaphoenix.advancementLib.GrantMode
All Implemented Interfaces:
Serializable, Comparable<GrantMode>, Constable

public enum GrantMode extends Enum<GrantMode>
Specifies how criteria for a custom advancement should be granted.

Used by AdvancementAPI to determine whether to grant all criteria at once when the target value is reached, or to grant criteria one by one as the player progresses.

Since:
0.2.0
Version:
0.3.2
Author:
lambdaphoenix
  • Enum Constant Details

    • ALL_AT_ONCE

      public static final GrantMode ALL_AT_ONCE
      All remaining criteria for the advancement are granted at once when the progress reaches or exceeds the target value.

      Use this mode for advancements that should be completed in a single step.

    • STEP_BY_STEP

      public static final GrantMode STEP_BY_STEP
      Only the next uncompleted criterion is granted each time the progress reaches the target value. Progress is then reset for the next step.

      Use this mode for advancements that should be completed over multiple steps, with a progress bar shown in the advancements tab.

  • Method Details

    • values

      public static GrantMode[] 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 GrantMode 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