Enum Class DifficultyGate
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DifficultyGate> The serialization codec for encoding and decodingDifficultyGatevalues by name.Fields inherited from interface net.minecraft.util.StringRepresentable
PRE_BUILT_MAP_THRESHOLD -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.DifficultyRetrieves the minimum worldDifficultyrequired for this gate.@NotNull StringRetrieves the serialized string representation of this difficulty gate.booleanisMet(@Nullable net.minecraft.world.Difficulty difficulty) Checks whether the givenDifficultymeets or exceeds this gate's minimum difficulty.booleanisMet(@Nullable net.minecraft.world.level.Level level) Checks whether the difficulty of the givenLevelmeets or exceeds this gate's minimum difficulty.static DifficultyGateReturns the enum constant of this class with the specified name.static DifficultyGate[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EASY
The spell can be cast on Easy, Normal, and Hard difficulties. -
NORMAL
The spell can only be cast on Normal and Hard difficulties. -
HARD
The spell can only be cast on Hard difficulty.
-
-
Field Details
-
CODEC
The serialization codec for encoding and decodingDifficultyGatevalues by name.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getMinimumDifficulty
public net.minecraft.world.Difficulty getMinimumDifficulty()Retrieves the minimum worldDifficultyrequired for this gate.- Returns:
- The minimum
Difficulty.
-
isMet
public boolean isMet(@Nullable @Nullable net.minecraft.world.Difficulty difficulty) Checks whether the givenDifficultymeets or exceeds this gate's minimum difficulty.- Parameters:
difficulty- TheDifficultyto evaluate, ornull.- Returns:
trueifdifficultyis non-null and its ID is at leastminimumDifficulty;falseotherwise.
-
isMet
public boolean isMet(@Nullable @Nullable net.minecraft.world.level.Level level) Checks whether the difficulty of the givenLevelmeets or exceeds this gate's minimum difficulty.- Parameters:
level- TheLevelwhose difficulty should be evaluated, ornull.- Returns:
trueif the level's difficulty satisfies this gate;falseotherwise.
-
getSerializedName
Retrieves the serialized string representation of this difficulty gate.- Specified by:
getSerializedNamein interfacenet.minecraft.util.StringRepresentable- Returns:
- The serialized name string.
-