Record Class SculkPatchFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.SculkPatchFeature
- All Implemented Interfaces:
Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theamountPerChargerecord component.private final intThe field for thechargeCountrecord component.static final com.mojang.serialization.MapCodec<SculkPatchFeature> private final intThe field for thegrowthRoundsrecord component.private final intThe field for thespreadAttemptsrecord component.private final intThe field for thespreadRoundsrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSculkPatchFeature(int chargeCount, int amountPerCharge, int spreadAttempts, int growthRounds, int spreadRounds) Creates an instance of aSculkPatchFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theamountPerChargerecord component.private booleancanSpreadFrom(LevelAccessor level, BlockPos origin) intReturns the value of thechargeCountrecord component.com.mojang.serialization.MapCodec<SculkPatchFeature> codec()final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thegrowthRoundsrecord component.final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) intReturns the value of thespreadAttemptsrecord component.intReturns the value of thespreadRoundsrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
chargeCount
private final int chargeCountThe field for thechargeCountrecord component. -
amountPerCharge
private final int amountPerChargeThe field for theamountPerChargerecord component. -
spreadAttempts
private final int spreadAttemptsThe field for thespreadAttemptsrecord component. -
growthRounds
private final int growthRoundsThe field for thegrowthRoundsrecord component. -
spreadRounds
private final int spreadRoundsThe field for thespreadRoundsrecord component. -
CODEC
-
-
Constructor Details
-
SculkPatchFeature
public SculkPatchFeature(int chargeCount, int amountPerCharge, int spreadAttempts, int growthRounds, int spreadRounds) Creates an instance of aSculkPatchFeaturerecord class.- Parameters:
chargeCount- the value for thechargeCountrecord componentamountPerCharge- the value for theamountPerChargerecord componentspreadAttempts- the value for thespreadAttemptsrecord componentgrowthRounds- the value for thegrowthRoundsrecord componentspreadRounds- the value for thespreadRoundsrecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
canSpreadFrom
-
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. -
chargeCount
public int chargeCount()Returns the value of thechargeCountrecord component.- Returns:
- the value of the
chargeCountrecord component
-
amountPerCharge
public int amountPerCharge()Returns the value of theamountPerChargerecord component.- Returns:
- the value of the
amountPerChargerecord component
-
spreadAttempts
public int spreadAttempts()Returns the value of thespreadAttemptsrecord component.- Returns:
- the value of the
spreadAttemptsrecord component
-
growthRounds
public int growthRounds()Returns the value of thegrowthRoundsrecord component.- Returns:
- the value of the
growthRoundsrecord component
-
spreadRounds
public int spreadRounds()Returns the value of thespreadRoundsrecord component.- Returns:
- the value of the
spreadRoundsrecord component
-