Record Class BiomeResourceConfig.ResourceDrop
java.lang.Object
java.lang.Record
net.chen.legacyLand.resource.BiomeResourceConfig.ResourceDrop
- Enclosing class:
BiomeResourceConfig
public static record BiomeResourceConfig.ResourceDrop(ResourceType resourceType, double probability)
extends Record
资源掉落配置
-
Constructor Summary
ConstructorsConstructorDescriptionResourceDrop(ResourceType resourceType, double probability) Creates an instance of aResourceDroprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theprobabilityrecord component.Returns the value of theresourceTyperecord component.booleanfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ResourceDrop
Creates an instance of aResourceDroprecord class.- Parameters:
resourceType- the value for theresourceTyperecord componentprobability- the value for theprobabilityrecord component
-
-
Method Details
-
shouldDrop
public boolean shouldDrop() -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
resourceType
Returns the value of theresourceTyperecord component.- Returns:
- the value of the
resourceTyperecord component
-
probability
public double probability()Returns the value of theprobabilityrecord component.- Returns:
- the value of the
probabilityrecord component
-