Record Class SurfaceRules.StoneDepthCheck
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.SurfaceRules.StoneDepthCheck
- All Implemented Interfaces:
Function<SurfaceRules.Context, SurfaceRules.Condition>, SurfaceRules.ConditionSource
- Enclosing class:
SurfaceRules
private static record SurfaceRules.StoneDepthCheck(int offset, boolean addSurfaceDepth, int secondaryDepthRange, CaveSurface surfaceType)
extends Record
implements SurfaceRules.ConditionSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theaddSurfaceDepthrecord component.private static final KeyDispatchDataCodec<SurfaceRules.StoneDepthCheck> private final intThe field for theoffsetrecord component.private final intThe field for thesecondaryDepthRangerecord component.private final CaveSurfaceThe field for thesurfaceTyperecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateStoneDepthCheck(int offset, boolean addSurfaceDepth, int secondaryDepthRange, CaveSurface surfaceType) Creates an instance of aStoneDepthCheckrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theaddSurfaceDepthrecord component.apply(SurfaceRules.Context ruleContext) KeyDispatchDataCodec<? extends SurfaceRules.ConditionSource> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intoffset()Returns the value of theoffsetrecord component.intReturns the value of thesecondaryDepthRangerecord component.Returns the value of thesurfaceTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
offset
private final int offsetThe field for theoffsetrecord component. -
addSurfaceDepth
private final boolean addSurfaceDepthThe field for theaddSurfaceDepthrecord component. -
secondaryDepthRange
private final int secondaryDepthRangeThe field for thesecondaryDepthRangerecord component. -
surfaceType
The field for thesurfaceTyperecord component. -
CODEC
-
-
Constructor Details
-
StoneDepthCheck
private StoneDepthCheck(int offset, boolean addSurfaceDepth, int secondaryDepthRange, CaveSurface surfaceType) Creates an instance of aStoneDepthCheckrecord class.- Parameters:
offset- the value for theoffsetrecord componentaddSurfaceDepth- the value for theaddSurfaceDepthrecord componentsecondaryDepthRange- the value for thesecondaryDepthRangerecord componentsurfaceType- the value for thesurfaceTyperecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceSurfaceRules.ConditionSource
-
apply
- Specified by:
applyin interfaceFunction<SurfaceRules.Context, SurfaceRules.Condition>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
offset
public int offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
addSurfaceDepth
public boolean addSurfaceDepth()Returns the value of theaddSurfaceDepthrecord component.- Returns:
- the value of the
addSurfaceDepthrecord component
-
secondaryDepthRange
public int secondaryDepthRange()Returns the value of thesecondaryDepthRangerecord component.- Returns:
- the value of the
secondaryDepthRangerecord component
-
surfaceType
Returns the value of thesurfaceTyperecord component.- Returns:
- the value of the
surfaceTyperecord component
-