Record Class BlocksAttacks
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.BlocksAttacks
- All Implemented Interfaces:
Rewritable
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
implements Rewritable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBlocksAttacks(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 aBlocksAttacksrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of theblockDelaySecondsrecord component.@Nullable Holder<SoundEvent>Returns the value of theblockSoundrecord component.@Nullable StringReturns the value of thebypassedByTagrecord component.Returns the value of thedamageReductionsrecord component.floatReturns the value of thedisableCooldownScalerecord component.@Nullable Holder<SoundEvent>Returns the value of thedisableSoundrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theitemDamagerecord component.rewrite(UserConnection connection, Protocol<?, ?, ?, ?> protocol, boolean clientbound) Rewrites the object to a different version, may return self or a new object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
TYPE
-
-
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 aBlocksAttacksrecord class.- Parameters:
blockDelaySeconds- the value for theblockDelaySecondsrecord componentdisableCooldownScale- the value for thedisableCooldownScalerecord componentdamageReductions- the value for thedamageReductionsrecord componentitemDamage- the value for theitemDamagerecord componentbypassedByTag- the value for thebypassedByTagrecord componentblockSound- the value for theblockSoundrecord componentdisableSound- the value for thedisableSoundrecord component
-
-
Method Details
-
rewrite
public BlocksAttacks rewrite(UserConnection connection, Protocol<?, ?, ?, ?> protocol, boolean clientbound) Description copied from interface:RewritableRewrites the object to a different version, may return self or a new object.- Specified by:
rewritein interfaceRewritable- Parameters:
connection- user connectionprotocol- protocolclientbound- whether it should be rewritten client- or serverbound- Returns:
- rewritten object, may be (modified or unmodified) self or a new object
-
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 '=='. -
blockDelaySeconds
public float blockDelaySeconds()Returns the value of theblockDelaySecondsrecord component.- Returns:
- the value of the
blockDelaySecondsrecord component
-
disableCooldownScale
public float disableCooldownScale()Returns the value of thedisableCooldownScalerecord component.- Returns:
- the value of the
disableCooldownScalerecord component
-
damageReductions
Returns the value of thedamageReductionsrecord component.- Returns:
- the value of the
damageReductionsrecord component
-
itemDamage
Returns the value of theitemDamagerecord component.- Returns:
- the value of the
itemDamagerecord component
-
bypassedByTag
Returns the value of thebypassedByTagrecord component.- Returns:
- the value of the
bypassedByTagrecord component
-
blockSound
Returns the value of theblockSoundrecord component.- Returns:
- the value of the
blockSoundrecord component
-
disableSound
Returns the value of thedisableSoundrecord component.- Returns:
- the value of the
disableSoundrecord component
-