Record Class UnderwaterMagmaFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.UnderwaterMagmaFeature
- All Implemented Interfaces:
Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<UnderwaterMagmaFeature> private final intThe field for thefloorSearchRangerecord component.private final floatThe field for theplacementProbabilityPerValidPositionrecord component.private final intThe field for theplacementRadiusAroundFloorrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionUnderwaterMagmaFeature(int floorSearchRange, int placementRadiusAroundFloor, float placementProbabilityPerValidPosition) Creates an instance of aUnderwaterMagmaFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<UnderwaterMagmaFeature> codec()final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefloorSearchRangerecord component.private OptionalIntgetFloorY(WorldGenLevel level, BlockPos origin) final inthashCode()Returns a hash code value for this object.private booleanisValidPlacement(WorldGenLevel level, BlockPos pos) private booleanisVisibleFromOutside(LevelAccessor level, BlockPos pos, Direction coveredDirection) private static booleanisWaterOrAir(BlockState state) booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) floatReturns the value of theplacementProbabilityPerValidPositionrecord component.intReturns the value of theplacementRadiusAroundFloorrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
floorSearchRange
private final int floorSearchRangeThe field for thefloorSearchRangerecord component. -
placementRadiusAroundFloor
private final int placementRadiusAroundFloorThe field for theplacementRadiusAroundFloorrecord component. -
placementProbabilityPerValidPosition
private final float placementProbabilityPerValidPositionThe field for theplacementProbabilityPerValidPositionrecord component. -
CODEC
-
-
Constructor Details
-
UnderwaterMagmaFeature
public UnderwaterMagmaFeature(int floorSearchRange, int placementRadiusAroundFloor, float placementProbabilityPerValidPosition) Creates an instance of aUnderwaterMagmaFeaturerecord class.- Parameters:
floorSearchRange- the value for thefloorSearchRangerecord componentplacementRadiusAroundFloor- the value for theplacementRadiusAroundFloorrecord componentplacementProbabilityPerValidPosition- the value for theplacementProbabilityPerValidPositionrecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
getFloorY
-
isValidPlacement
-
isWaterOrAir
-
isVisibleFromOutside
-
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 with thecomparemethod from their corresponding wrapper classes. -
floorSearchRange
public int floorSearchRange()Returns the value of thefloorSearchRangerecord component.- Returns:
- the value of the
floorSearchRangerecord component
-
placementRadiusAroundFloor
public int placementRadiusAroundFloor()Returns the value of theplacementRadiusAroundFloorrecord component.- Returns:
- the value of the
placementRadiusAroundFloorrecord component
-
placementProbabilityPerValidPosition
public float placementProbabilityPerValidPosition()Returns the value of theplacementProbabilityPerValidPositionrecord component.- Returns:
- the value of the
placementProbabilityPerValidPositionrecord component
-