Record Class PiercingWeapon
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.PiercingWeapon
public record PiercingWeapon(boolean dealsKnockback, boolean dismounts, @Nullable Holder<SoundEvent> sound, @Nullable Holder<SoundEvent> hitSound)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPiercingWeapon(boolean dealsKnockback, boolean dismounts, @Nullable Holder<SoundEvent> sound, @Nullable Holder<SoundEvent> hitSound) Creates an instance of aPiercingWeaponrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thedealsKnockbackrecord component.booleanReturns the value of thedismountsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable Holder<SoundEvent>hitSound()Returns the value of thehitSoundrecord component.@Nullable Holder<SoundEvent>sound()Returns the value of thesoundrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
TYPE
-
-
Constructor Details
-
PiercingWeapon
public PiercingWeapon(boolean dealsKnockback, boolean dismounts, @Nullable Holder<SoundEvent> sound, @Nullable Holder<SoundEvent> hitSound) Creates an instance of aPiercingWeaponrecord class.- Parameters:
dealsKnockback- the value for thedealsKnockbackrecord componentdismounts- the value for thedismountsrecord componentsound- the value for thesoundrecord componenthitSound- the value for thehitSoundrecord 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 '=='. -
dealsKnockback
public boolean dealsKnockback()Returns the value of thedealsKnockbackrecord component.- Returns:
- the value of the
dealsKnockbackrecord component
-
dismounts
public boolean dismounts()Returns the value of thedismountsrecord component.- Returns:
- the value of the
dismountsrecord component
-
sound
Returns the value of thesoundrecord component.- Returns:
- the value of the
soundrecord component
-
hitSound
Returns the value of thehitSoundrecord component.- Returns:
- the value of the
hitSoundrecord component
-