Record Class EnvironmentScanPlacement
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.placement.EnvironmentScanPlacement
- All Implemented Interfaces:
PlacementModifier
public record EnvironmentScanPlacement(Direction directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps)
extends Record
implements PlacementModifier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockPredicateThe field for theallowedSearchConditionrecord component.static final com.mojang.serialization.MapCodec<EnvironmentScanPlacement> private final DirectionThe field for thedirectionOfSearchrecord component.private final intThe field for themaxStepsrecord component.private final BlockPredicateThe field for thetargetConditionrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEnvironmentScanPlacement(Direction directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps) Creates an instance of aEnvironmentScanPlacementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallowedSearchConditionrecord component.com.mojang.serialization.MapCodec<EnvironmentScanPlacement> codec()Returns the value of thedirectionOfSearchrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaxSteps()Returns the value of themaxStepsrecord component.voidmodify(PlacementContext context, RandomSource random, BlockPos origin, Consumer<BlockPos> output) static EnvironmentScanPlacementscanningFor(Direction directionOfSearch, BlockPredicate targetCondition, int maxSteps) static EnvironmentScanPlacementscanningFor(Direction directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps) Returns the value of thetargetConditionrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
directionOfSearch
The field for thedirectionOfSearchrecord component. -
targetCondition
The field for thetargetConditionrecord component. -
allowedSearchCondition
The field for theallowedSearchConditionrecord component. -
maxSteps
private final int maxStepsThe field for themaxStepsrecord component. -
CODEC
-
-
Constructor Details
-
EnvironmentScanPlacement
public EnvironmentScanPlacement(Direction directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps) Creates an instance of aEnvironmentScanPlacementrecord class.- Parameters:
directionOfSearch- the value for thedirectionOfSearchrecord componenttargetCondition- the value for thetargetConditionrecord componentallowedSearchCondition- the value for theallowedSearchConditionrecord componentmaxSteps- the value for themaxStepsrecord component
-
-
Method Details
-
scanningFor
public static EnvironmentScanPlacement scanningFor(Direction directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps) -
scanningFor
public static EnvironmentScanPlacement scanningFor(Direction directionOfSearch, BlockPredicate targetCondition, int maxSteps) -
modify
public void modify(PlacementContext context, RandomSource random, BlockPos origin, Consumer<BlockPos> output) - Specified by:
modifyin interfacePlacementModifier
-
codec
- Specified by:
codecin interfacePlacementModifier
-
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. -
directionOfSearch
Returns the value of thedirectionOfSearchrecord component.- Returns:
- the value of the
directionOfSearchrecord component
-
targetCondition
Returns the value of thetargetConditionrecord component.- Returns:
- the value of the
targetConditionrecord component
-
allowedSearchCondition
Returns the value of theallowedSearchConditionrecord component.- Returns:
- the value of the
allowedSearchConditionrecord component
-
maxSteps
public int maxSteps()Returns the value of themaxStepsrecord component.- Returns:
- the value of the
maxStepsrecord component
-