Record Class RandomPatchConfiguration
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.configurations.RandomPatchConfiguration
- All Implemented Interfaces:
FeatureConfiguration
public record RandomPatchConfiguration(int tries, int xzSpread, int ySpread, Holder<PlacedFeature> feature)
extends Record
implements FeatureConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RandomPatchConfiguration> private final Holder<PlacedFeature> The field for thefeaturerecord component.private final intThe field for thetriesrecord component.private final intThe field for thexzSpreadrecord component.private final intThe field for theySpreadrecord component.Fields inherited from interface net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration
NONE -
Constructor Summary
ConstructorsConstructorDescriptionRandomPatchConfiguration(int tries, int xzSpread, int ySpread, Holder<PlacedFeature> feature) Creates an instance of aRandomPatchConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.feature()Returns the value of thefeaturerecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.inttries()Returns the value of thetriesrecord component.intxzSpread()Returns the value of thexzSpreadrecord component.intySpread()Returns the value of theySpreadrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration
getFeatures
-
Field Details
-
tries
private final int triesThe field for thetriesrecord component. -
xzSpread
private final int xzSpreadThe field for thexzSpreadrecord component. -
ySpread
private final int ySpreadThe field for theySpreadrecord component. -
feature
The field for thefeaturerecord component. -
CODEC
-
-
Constructor Details
-
RandomPatchConfiguration
public RandomPatchConfiguration(int tries, int xzSpread, int ySpread, Holder<PlacedFeature> feature) Creates an instance of aRandomPatchConfigurationrecord class.- Parameters:
tries- the value for thetriesrecord componentxzSpread- the value for thexzSpreadrecord componentySpread- the value for theySpreadrecord componentfeature- the value for thefeaturerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
tries
public int tries()Returns the value of thetriesrecord component.- Returns:
- the value of the
triesrecord component
-
xzSpread
public int xzSpread()Returns the value of thexzSpreadrecord component.- Returns:
- the value of the
xzSpreadrecord component
-
ySpread
public int ySpread()Returns the value of theySpreadrecord component.- Returns:
- the value of the
ySpreadrecord component
-
feature
Returns the value of thefeaturerecord component.- Returns:
- the value of the
featurerecord component
-