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
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.(package private) static final com.mojang.serialization.Codec<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
ConstructorsConstructorDescriptionStoneDepthCheck(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 p_189755_) com.mojang.serialization.Codec<? 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
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
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
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
-