Record Class BlocksAttacks.ItemDamageFunction
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.BlocksAttacks.ItemDamageFunction
- Enclosing class:
- BlocksAttacks
public static record BlocksAttacks.ItemDamageFunction(float threshold, float base, float factor)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionItemDamageFunction
(float threshold, float base, float factor) Creates an instance of aItemDamageFunction
record class. -
Method Summary
Modifier and TypeMethodDescriptionfloat
base()
Returns the value of thebase
record component.final boolean
Indicates whether some other object is "equal to" this one.float
factor()
Returns the value of thefactor
record component.final int
hashCode()
Returns a hash code value for this object.float
Returns the value of thethreshold
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
TYPE
-
-
Constructor Details
-
ItemDamageFunction
public ItemDamageFunction(float threshold, float base, float factor) Creates an instance of aItemDamageFunction
record class.- Parameters:
threshold
- the value for thethreshold
record componentbase
- the value for thebase
record componentfactor
- the value for thefactor
record 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. All components in this record class are compared with '=='. -
threshold
public float threshold()Returns the value of thethreshold
record component.- Returns:
- the value of the
threshold
record component
-
base
public float base()Returns the value of thebase
record component.- Returns:
- the value of the
base
record component
-
factor
public float factor()Returns the value of thefactor
record component.- Returns:
- the value of the
factor
record component
-