Record Class TestEnvironmentDefinition.Functions
java.lang.Object
java.lang.Record
net.minecraft.gametest.framework.TestEnvironmentDefinition.Functions
- All Implemented Interfaces:
TestEnvironmentDefinition<Unit>
- Enclosing interface:
TestEnvironmentDefinition<SavedDataType>
public static record TestEnvironmentDefinition.Functions(Optional<Identifier> setupFunction, Optional<Identifier> teardownFunction)
extends Record
implements TestEnvironmentDefinition<Unit>
-
Nested Class Summary
Nested classes/interfaces inherited from interface TestEnvironmentDefinition
TestEnvironmentDefinition.Activation<T>, TestEnvironmentDefinition.AllOf, TestEnvironmentDefinition.ClockTime, TestEnvironmentDefinition.Functions, TestEnvironmentDefinition.SetGameRules, TestEnvironmentDefinition.Weather -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<TestEnvironmentDefinition.Functions> private static final org.slf4j.Loggerprivate final Optional<Identifier> The field for thesetupFunctionrecord component.private final Optional<Identifier> The field for theteardownFunctionrecord component.Fields inherited from interface TestEnvironmentDefinition
DIRECT_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionFunctions(Optional<Identifier> setupFunction, Optional<Identifier> teardownFunction) Creates an instance of aFunctionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<TestEnvironmentDefinition.Functions> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.private static voidrun(ServerLevel level, Identifier functionId) setup(ServerLevel level) Returns the value of thesetupFunctionrecord component.voidteardown(ServerLevel level, Unit saveData) Returns the value of theteardownFunctionrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
setupFunction
The field for thesetupFunctionrecord component. -
teardownFunction
The field for theteardownFunctionrecord component. -
LOGGER
private static final org.slf4j.Logger LOGGER -
CODEC
-
-
Constructor Details
-
Functions
Creates an instance of aFunctionsrecord class.- Parameters:
setupFunction- the value for thesetupFunctionrecord componentteardownFunction- the value for theteardownFunctionrecord component
-
-
Method Details
-
setup
- Specified by:
setupin interfaceTestEnvironmentDefinition<Unit>
-
teardown
- Specified by:
teardownin interfaceTestEnvironmentDefinition<Unit>
-
run
-
codec
- Specified by:
codecin interfaceTestEnvironmentDefinition<Unit>
-
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). -
setupFunction
Returns the value of thesetupFunctionrecord component.- Returns:
- the value of the
setupFunctionrecord component
-
teardownFunction
Returns the value of theteardownFunctionrecord component.- Returns:
- the value of the
teardownFunctionrecord component
-