Record Class TestEnvironmentDefinition.SetDifficulty
java.lang.Object
java.lang.Record
net.minecraft.gametest.framework.TestEnvironmentDefinition.SetDifficulty
- All Implemented Interfaces:
TestEnvironmentDefinition<Difficulty>
- Enclosing interface:
TestEnvironmentDefinition<SavedDataType>
public static record TestEnvironmentDefinition.SetDifficulty(Difficulty difficulty)
extends Record
implements TestEnvironmentDefinition<Difficulty>
-
Nested Class Summary
Nested classes/interfaces inherited from interface TestEnvironmentDefinition
TestEnvironmentDefinition.Activation<T>, TestEnvironmentDefinition.AllOf, TestEnvironmentDefinition.ClockTime, TestEnvironmentDefinition.Functions, TestEnvironmentDefinition.SetDifficulty, TestEnvironmentDefinition.SetGameRules, TestEnvironmentDefinition.Timelines, TestEnvironmentDefinition.Weather -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<TestEnvironmentDefinition.SetDifficulty> private final DifficultyThe field for thedifficultyrecord component.Fields inherited from interface TestEnvironmentDefinition
DIRECT_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSetDifficulty(Difficulty difficulty) Creates an instance of aSetDifficultyrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<TestEnvironmentDefinition.SetDifficulty> codec()Returns the value of thedifficultyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.setup(ServerLevel level) voidteardown(ServerLevel level, Difficulty saveData) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
difficulty
The field for thedifficultyrecord component. -
CODEC
public static final com.mojang.serialization.MapCodec<TestEnvironmentDefinition.SetDifficulty> CODEC
-
-
Constructor Details
-
SetDifficulty
Creates an instance of aSetDifficultyrecord class.- Parameters:
difficulty- the value for thedifficultyrecord component
-
-
Method Details
-
setup
- Specified by:
setupin interfaceTestEnvironmentDefinition<Difficulty>
-
teardown
- Specified by:
teardownin interfaceTestEnvironmentDefinition<Difficulty>
-
codec
- Specified by:
codecin interfaceTestEnvironmentDefinition<Difficulty>
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
difficulty
Returns the value of thedifficultyrecord component.- Returns:
- the value of the
difficultyrecord component
-