Package net.minecraft.gametest.framework
Record Class TestEnvironmentDefinition.Functions
java.lang.Object
java.lang.Record
net.minecraft.gametest.framework.TestEnvironmentDefinition.Functions
- All Implemented Interfaces:
TestEnvironmentDefinition
- Enclosing interface:
TestEnvironmentDefinition
public static record TestEnvironmentDefinition.Functions(Optional<ResourceLocation> setupFunction, Optional<ResourceLocation> teardownFunction)
extends Record
implements TestEnvironmentDefinition
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.gametest.framework.TestEnvironmentDefinition
TestEnvironmentDefinition.AllOf, TestEnvironmentDefinition.Functions, TestEnvironmentDefinition.SetGameRules, TestEnvironmentDefinition.TimeOfDay, TestEnvironmentDefinition.Weather
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<TestEnvironmentDefinition.Functions> private static final org.slf4j.Logger
private final Optional
<ResourceLocation> The field for thesetupFunction
record component.private final Optional
<ResourceLocation> The field for theteardownFunction
record component.Fields inherited from interface net.minecraft.gametest.framework.TestEnvironmentDefinition
DIRECT_CODEC
-
Constructor Summary
ConstructorsConstructorDescriptionFunctions
(Optional<ResourceLocation> setupFunction, Optional<ResourceLocation> teardownFunction) Creates an instance of aFunctions
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<TestEnvironmentDefinition.Functions> codec()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.private static void
run
(ServerLevel p_397011_, ResourceLocation p_397867_) void
setup
(ServerLevel p_397955_) Returns the value of thesetupFunction
record component.void
teardown
(ServerLevel p_397731_) Returns the value of theteardownFunction
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
setupFunction
The field for thesetupFunction
record component. -
teardownFunction
The field for theteardownFunction
record component. -
LOGGER
private static final org.slf4j.Logger LOGGER -
CODEC
-
-
Constructor Details
-
Functions
public Functions(Optional<ResourceLocation> setupFunction, Optional<ResourceLocation> teardownFunction) Creates an instance of aFunctions
record class.- Parameters:
setupFunction
- the value for thesetupFunction
record componentteardownFunction
- the value for theteardownFunction
record component
-
-
Method Details
-
setup
- Specified by:
setup
in interfaceTestEnvironmentDefinition
-
teardown
- Specified by:
teardown
in interfaceTestEnvironmentDefinition
-
run
-
codec
- Specified by:
codec
in interfaceTestEnvironmentDefinition
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 thesetupFunction
record component.- Returns:
- the value of the
setupFunction
record component
-
teardownFunction
Returns the value of theteardownFunction
record component.- Returns:
- the value of the
teardownFunction
record component
-