Record Class WateringSettings
java.lang.Object
java.lang.Record
io.github.pylonmc.pylon.base.content.tools.WateringSettings
public record WateringSettings(int horizontalRange, int verticalRange, double cropChance, double sugarCaneChance, double cactusChance, double saplingChance, double particleChance, @NotNull io.github.pylonmc.pylon.core.util.RandomizedSound sound)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionWateringSettings(int horizontalRange, int verticalRange, double cropChance, double sugarCaneChance, double cactusChance, double saplingChance, double particleChance, @NotNull io.github.pylonmc.pylon.core.util.RandomizedSound sound) Creates an instance of aWateringSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thecactusChancerecord component.doubleReturns the value of thecropChancerecord component.final booleanIndicates whether some other object is "equal to" this one.static WateringSettingsfromConfig(io.github.pylonmc.pylon.core.config.ConfigSection config) final inthashCode()Returns a hash code value for this object.intReturns the value of thehorizontalRangerecord component.doubleReturns the value of theparticleChancerecord component.doubleReturns the value of thesaplingChancerecord component.@NotNull io.github.pylonmc.pylon.core.util.RandomizedSoundsound()Returns the value of thesoundrecord component.doubleReturns the value of thesugarCaneChancerecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of theverticalRangerecord component.
-
Constructor Details
-
WateringSettings
public WateringSettings(int horizontalRange, int verticalRange, double cropChance, double sugarCaneChance, double cactusChance, double saplingChance, double particleChance, @NotNull @NotNull io.github.pylonmc.pylon.core.util.RandomizedSound sound) Creates an instance of aWateringSettingsrecord class.- Parameters:
horizontalRange- the value for thehorizontalRangerecord componentverticalRange- the value for theverticalRangerecord componentcropChance- the value for thecropChancerecord componentsugarCaneChance- the value for thesugarCaneChancerecord componentcactusChance- the value for thecactusChancerecord componentsaplingChance- the value for thesaplingChancerecord componentparticleChance- the value for theparticleChancerecord componentsound- the value for thesoundrecord component
-
-
Method Details
-
fromConfig
-
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 '=='. -
horizontalRange
public int horizontalRange()Returns the value of thehorizontalRangerecord component.- Returns:
- the value of the
horizontalRangerecord component
-
verticalRange
public int verticalRange()Returns the value of theverticalRangerecord component.- Returns:
- the value of the
verticalRangerecord component
-
cropChance
public double cropChance()Returns the value of thecropChancerecord component.- Returns:
- the value of the
cropChancerecord component
-
sugarCaneChance
public double sugarCaneChance()Returns the value of thesugarCaneChancerecord component.- Returns:
- the value of the
sugarCaneChancerecord component
-
cactusChance
public double cactusChance()Returns the value of thecactusChancerecord component.- Returns:
- the value of the
cactusChancerecord component
-
saplingChance
public double saplingChance()Returns the value of thesaplingChancerecord component.- Returns:
- the value of the
saplingChancerecord component
-
particleChance
public double particleChance()Returns the value of theparticleChancerecord component.- Returns:
- the value of the
particleChancerecord component
-
sound
@NotNull public @NotNull io.github.pylonmc.pylon.core.util.RandomizedSound sound()Returns the value of thesoundrecord component.- Returns:
- the value of the
soundrecord component
-