Record Class SurfaceRules.TestRuleSource
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.SurfaceRules.TestRuleSource
- All Implemented Interfaces:
Function<SurfaceRules.Context,
,SurfaceRules.SurfaceRule> SurfaceRules.RuleSource
- Enclosing class:
- SurfaceRules
static record SurfaceRules.TestRuleSource(SurfaceRules.ConditionSource ifTrue, SurfaceRules.RuleSource thenRun)
extends Record
implements SurfaceRules.RuleSource
-
Field Summary
Modifier and TypeFieldDescription(package private) static final KeyDispatchDataCodec<SurfaceRules.TestRuleSource>
private final SurfaceRules.ConditionSource
The field for theifTrue
record component.private final SurfaceRules.RuleSource
The field for thethenRun
record component. -
Constructor Summary
ConstructorDescriptionTestRuleSource
(SurfaceRules.ConditionSource ifTrue, SurfaceRules.RuleSource thenRun) Creates an instance of aTestRuleSource
record class. -
Method Summary
Modifier and TypeMethodDescriptionapply
(SurfaceRules.Context p_189819_) KeyDispatchDataCodec<? extends SurfaceRules.RuleSource>
codec()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.ifTrue()
Returns the value of theifTrue
record component.thenRun()
Returns the value of thethenRun
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
ifTrue
The field for theifTrue
record component. -
thenRun
The field for thethenRun
record component. -
CODEC
-
-
Constructor Details
-
TestRuleSource
TestRuleSource(SurfaceRules.ConditionSource ifTrue, SurfaceRules.RuleSource thenRun) Creates an instance of aTestRuleSource
record class.- Parameters:
ifTrue
- the value for theifTrue
record componentthenRun
- the value for thethenRun
record component
-
-
Method Details
-
codec
- Specified by:
codec
in interfaceSurfaceRules.RuleSource
-
apply
- Specified by:
apply
in interfaceFunction<SurfaceRules.Context,
SurfaceRules.SurfaceRule>
-
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)
. -
ifTrue
Returns the value of theifTrue
record component.- Returns:
- the value of the
ifTrue
record component
-
thenRun
Returns the value of thethenRun
record component.- Returns:
- the value of the
thenRun
record component
-