java.lang.Object
java.lang.Enum<DifficultyGate>
johnsmith.enchantingoverhauled.api.enchantment.spellfield.DifficultyGate
All Implemented Interfaces:
Serializable, Comparable<DifficultyGate>, Constable, net.minecraft.util.StringRepresentable

public enum DifficultyGate extends Enum<DifficultyGate> implements net.minecraft.util.StringRepresentable
Defines the minimum world Difficulty required for an AI entity to select and cast an AiSpellField.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>

    Nested classes/interfaces inherited from interface net.minecraft.util.StringRepresentable

    net.minecraft.util.StringRepresentable.EnumCodec<E extends Enum<E> & net.minecraft.util.StringRepresentable>, net.minecraft.util.StringRepresentable.StringRepresentableCodec<S extends net.minecraft.util.StringRepresentable>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The spell can be cast on Easy, Normal, and Hard difficulties.
    The spell can only be cast on Hard difficulty.
    The spell can only be cast on Normal and Hard difficulties.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<DifficultyGate>
    The serialization codec for encoding and decoding DifficultyGate values by name.

    Fields inherited from interface net.minecraft.util.StringRepresentable

    PRE_BUILT_MAP_THRESHOLD
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.Difficulty
    Retrieves the minimum world Difficulty required for this gate.
    @NotNull String
    Retrieves the serialized string representation of this difficulty gate.
    boolean
    isMet(@Nullable net.minecraft.world.Difficulty difficulty)
    Checks whether the given Difficulty meets or exceeds this gate's minimum difficulty.
    boolean
    isMet(@Nullable net.minecraft.world.level.Level level)
    Checks whether the difficulty of the given Level meets or exceeds this gate's minimum difficulty.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • EASY

      public static final DifficultyGate EASY
      The spell can be cast on Easy, Normal, and Hard difficulties.
    • NORMAL

      public static final DifficultyGate NORMAL
      The spell can only be cast on Normal and Hard difficulties.
    • HARD

      public static final DifficultyGate HARD
      The spell can only be cast on Hard difficulty.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<DifficultyGate> CODEC
      The serialization codec for encoding and decoding DifficultyGate values by name.
  • Method Details

    • values

      public static DifficultyGate[] 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 DifficultyGate 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
    • getMinimumDifficulty

      public net.minecraft.world.Difficulty getMinimumDifficulty()
      Retrieves the minimum world Difficulty required for this gate.
      Returns:
      The minimum Difficulty.
    • isMet

      public boolean isMet(@Nullable @Nullable net.minecraft.world.Difficulty difficulty)
      Checks whether the given Difficulty meets or exceeds this gate's minimum difficulty.
      Parameters:
      difficulty - The Difficulty to evaluate, or null.
      Returns:
      true if difficulty is non-null and its ID is at least minimumDifficulty; false otherwise.
    • isMet

      public boolean isMet(@Nullable @Nullable net.minecraft.world.level.Level level)
      Checks whether the difficulty of the given Level meets or exceeds this gate's minimum difficulty.
      Parameters:
      level - The Level whose difficulty should be evaluated, or null.
      Returns:
      true if the level's difficulty satisfies this gate; false otherwise.
    • getSerializedName

      @NotNull public @NotNull String getSerializedName()
      Retrieves the serialized string representation of this difficulty gate.
      Specified by:
      getSerializedName in interface net.minecraft.util.StringRepresentable
      Returns:
      The serialized name string.