Record Class BlockDamage.DamageConfig
java.lang.Object
java.lang.Record
me.deecaad.weaponmechanics.weapon.explode.BlockDamage.DamageConfig
- Record Components:
mode- How the block should be damaged (or not damaged).blockDurability- The maximum number of hits the block can take.mask- if mode == BREAK, the broken block is replaced with this.
- Enclosing class:
BlockDamage
public static record BlockDamage.DamageConfig(BlockDamage.BreakMode mode, int blockDurability, org.bukkit.Material mask)
extends Record
Holds data from config for a material.
-
Constructor Summary
ConstructorsConstructorDescriptionDamageConfig(BlockDamage.BreakMode mode, int blockDurability, org.bukkit.Material mask) Creates an instance of aDamageConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theblockDurabilityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.bukkit.Materialmask()Returns the value of themaskrecord component.mode()Returns the value of themoderecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DamageConfig
Creates an instance of aDamageConfigrecord class.- Parameters:
mode- the value for themoderecord componentblockDurability- the value for theblockDurabilityrecord componentmask- the value for themaskrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-
blockDurability
public int blockDurability()Returns the value of theblockDurabilityrecord component.- Returns:
- the value of the
blockDurabilityrecord component
-
mask
public org.bukkit.Material mask()Returns the value of themaskrecord component.- Returns:
- the value of the
maskrecord component
-