Record Class StoneDepthCondition
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.material.condition.StoneDepthCondition
- All Implemented Interfaces:
MaterialCondition
public record StoneDepthCondition(int offset, boolean addSurfaceDepth, int secondaryDepthRange, CaveSurface surfaceType)
extends Record
implements MaterialCondition
-
Nested Class Summary
Nested classes/interfaces inherited from interface MaterialCondition
MaterialCondition.HolderHolder -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theaddSurfaceDepthrecord component.static final com.mojang.serialization.MapCodec<StoneDepthCondition> private final intThe field for theoffsetrecord component.private final intThe field for thesecondaryDepthRangerecord component.private final CaveSurfaceThe field for thesurfaceTyperecord component.Fields inherited from interface MaterialCondition
DIRECT_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionStoneDepthCondition(int offset, boolean addSurfaceDepth, int secondaryDepthRange, CaveSurface surfaceType) Creates an instance of aStoneDepthConditionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theaddSurfaceDepthrecord component.com.mojang.serialization.MapCodec<StoneDepthCondition> codec()compile(MaterialRuleContext ruleContext) 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
-
StoneDepthCondition
public StoneDepthCondition(int offset, boolean addSurfaceDepth, int secondaryDepthRange, CaveSurface surfaceType) Creates an instance of aStoneDepthConditionrecord 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 interfaceMaterialCondition
-
compile
- Specified by:
compilein interfaceMaterialCondition
-
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
-