Record Class HeightRangePredicate
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.blockpredicates.HeightRangePredicate
- All Implemented Interfaces:
BiPredicate<LevelAccessor, BlockPos>, BlockPredicate
public record HeightRangePredicate(VerticalAnchor minInclusive, VerticalAnchor maxInclusive)
extends Record
implements BlockPredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<HeightRangePredicate> private final VerticalAnchorThe field for themaxInclusiverecord component.private final VerticalAnchorThe field for theminInclusiverecord component.Fields inherited from interface BlockPredicate
ONLY_IN_AIR_OR_WATER_PREDICATE, ONLY_IN_AIR_PREDICATE -
Constructor Summary
ConstructorsConstructorDescriptionHeightRangePredicate(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) Creates an instance of aHeightRangePredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themaxInclusiverecord component.Returns the value of theminInclusiverecord component.booleantest(LevelAccessor level, BlockPos pos) final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface BiPredicate
and, negate, or
-
Field Details
-
minInclusive
The field for theminInclusiverecord component. -
maxInclusive
The field for themaxInclusiverecord component. -
CODEC
-
-
Constructor Details
-
HeightRangePredicate
Creates an instance of aHeightRangePredicaterecord class.- Parameters:
minInclusive- the value for theminInclusiverecord componentmaxInclusive- the value for themaxInclusiverecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceBlockPredicate
-
test
- Specified by:
testin interfaceBiPredicate<LevelAccessor, BlockPos>
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
minInclusive
Returns the value of theminInclusiverecord component.- Returns:
- the value of the
minInclusiverecord component
-
maxInclusive
Returns the value of themaxInclusiverecord component.- Returns:
- the value of the
maxInclusiverecord component
-