Record Class BlocksAttacks.ItemDamageFunction
java.lang.Object
java.lang.Record
net.minestom.server.item.component.BlocksAttacks.ItemDamageFunction
- Enclosing class:
BlocksAttacks
public static record BlocksAttacks.ItemDamageFunction(float threshold, float base, float factor)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<BlocksAttacks.ItemDamageFunction> static final BlocksAttacks.ItemDamageFunctionstatic final NetworkBuffer.Type<BlocksAttacks.ItemDamageFunction> -
Constructor Summary
ConstructorsConstructorDescriptionItemDamageFunction(float threshold, float base, float factor) Creates an instance of aItemDamageFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatbase()Returns the value of thebaserecord component.final booleanIndicates whether some other object is "equal to" this one.floatfactor()Returns the value of thefactorrecord component.final inthashCode()Returns a hash code value for this object.floatReturns the value of thethresholdrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
-
NETWORK_TYPE
-
CODEC
-
-
Constructor Details
-
ItemDamageFunction
public ItemDamageFunction(float threshold, float base, float factor) Creates an instance of aItemDamageFunctionrecord class.- Parameters:
threshold- the value for thethresholdrecord componentbase- the value for thebaserecord componentfactor- the value for thefactorrecord component
-
-
Method Details
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
threshold
public float threshold()Returns the value of thethresholdrecord component.- Returns:
- the value of the
thresholdrecord component
-
base
public float base()Returns the value of thebaserecord component.- Returns:
- the value of the
baserecord component
-
factor
public float factor()Returns the value of thefactorrecord component.- Returns:
- the value of the
factorrecord component
-