Record Class LeafSettingsEntry
java.lang.Object
java.lang.Record
de.cheaterpaul.fallingleaves.config.LeafSettingsEntry
public record LeafSettingsEntry(net.minecraft.resources.ResourceLocation id, double spawnRateFactor, net.minecraft.resources.ResourceLocation leafType, boolean considerAsConifer)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionLeafSettingsEntry(net.minecraft.resources.ResourceLocation id, double spawnRateFactor) LeafSettingsEntry(net.minecraft.resources.ResourceLocation id, double spawnRateFactor, boolean isConiferBlock) LeafSettingsEntry(net.minecraft.resources.ResourceLocation id, double spawnRateFactor, net.minecraft.resources.ResourceLocation leafType, boolean considerAsConifer) Creates an instance of aLeafSettingsEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theconsiderAsConiferrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()Returns the value of theidrecord component.net.minecraft.resources.ResourceLocationleafType()Returns the value of theleafTyperecord component.com.google.gson.JsonObjectdoubleReturns the value of thespawnRateFactorrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LeafSettingsEntry
public LeafSettingsEntry(net.minecraft.resources.ResourceLocation id, double spawnRateFactor, boolean isConiferBlock) -
LeafSettingsEntry
public LeafSettingsEntry(net.minecraft.resources.ResourceLocation id, double spawnRateFactor) -
LeafSettingsEntry
public LeafSettingsEntry(net.minecraft.resources.ResourceLocation id, double spawnRateFactor, net.minecraft.resources.ResourceLocation leafType, boolean considerAsConifer) Creates an instance of aLeafSettingsEntryrecord class.- Parameters:
id- the value for theidrecord componentspawnRateFactor- the value for thespawnRateFactorrecord componentleafType- the value for theleafTyperecord componentconsiderAsConifer- the value for theconsiderAsConiferrecord component
-
-
Method Details
-
serializeToJson
public com.google.gson.JsonObject serializeToJson() -
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 '=='. -
id
public net.minecraft.resources.ResourceLocation id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
spawnRateFactor
public double spawnRateFactor()Returns the value of thespawnRateFactorrecord component.- Returns:
- the value of the
spawnRateFactorrecord component
-
leafType
public net.minecraft.resources.ResourceLocation leafType()Returns the value of theleafTyperecord component.- Returns:
- the value of the
leafTyperecord component
-
considerAsConifer
public boolean considerAsConifer()Returns the value of theconsiderAsConiferrecord component.- Returns:
- the value of the
considerAsConiferrecord component
-