Record Class BlocksAttacks

java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.BlocksAttacks

public record BlocksAttacks(float blockDelaySeconds, float disableCooldownScale, BlocksAttacks.DamageReduction[] damageReductions, BlocksAttacks.ItemDamageFunction itemDamage, @Nullable String bypassedByTag, @Nullable Holder<SoundEvent> blockSound, @Nullable Holder<SoundEvent> disableSound) extends Record
  • Field Details

  • Constructor Details

    • BlocksAttacks

      public BlocksAttacks(float blockDelaySeconds, float disableCooldownScale, BlocksAttacks.DamageReduction[] damageReductions, BlocksAttacks.ItemDamageFunction itemDamage, @Nullable String bypassedByTag, @Nullable Holder<SoundEvent> blockSound, @Nullable Holder<SoundEvent> disableSound)
      Creates an instance of a BlocksAttacks record class.
      Parameters:
      blockDelaySeconds - the value for the blockDelaySeconds record component
      disableCooldownScale - the value for the disableCooldownScale record component
      damageReductions - the value for the damageReductions record component
      itemDamage - the value for the itemDamage record component
      bypassedByTag - the value for the bypassedByTag record component
      blockSound - the value for the blockSound record component
      disableSound - the value for the disableSound record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • blockDelaySeconds

      public float blockDelaySeconds()
      Returns the value of the blockDelaySeconds record component.
      Returns:
      the value of the blockDelaySeconds record component
    • disableCooldownScale

      public float disableCooldownScale()
      Returns the value of the disableCooldownScale record component.
      Returns:
      the value of the disableCooldownScale record component
    • damageReductions

      public BlocksAttacks.DamageReduction[] damageReductions()
      Returns the value of the damageReductions record component.
      Returns:
      the value of the damageReductions record component
    • itemDamage

      public BlocksAttacks.ItemDamageFunction itemDamage()
      Returns the value of the itemDamage record component.
      Returns:
      the value of the itemDamage record component
    • bypassedByTag

      public @Nullable String bypassedByTag()
      Returns the value of the bypassedByTag record component.
      Returns:
      the value of the bypassedByTag record component
    • blockSound

      public @Nullable Holder<SoundEvent> blockSound()
      Returns the value of the blockSound record component.
      Returns:
      the value of the blockSound record component
    • disableSound

      public @Nullable Holder<SoundEvent> disableSound()
      Returns the value of the disableSound record component.
      Returns:
      the value of the disableSound record component