Record Class Equippable
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.Equippable
- All Implemented Interfaces:
Rewritable
public record Equippable(int equipmentSlot, Holder<SoundEvent> soundEvent, @Nullable String model, @Nullable String cameraOverlay, @Nullable HolderSet allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract, boolean canBeSheared, Holder<SoundEvent> shearingSound)
extends Record
implements Rewritable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Type<Equippable>static final Type<Equippable>static final Type<Equippable> -
Constructor Summary
ConstructorsConstructorDescriptionEquippable(int equipmentSlot, Holder<SoundEvent> soundEvent, @Nullable String model, @Nullable String cameraOverlay, @Nullable HolderSet allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt) Equippable(int equipmentSlot, Holder<SoundEvent> soundEvent, @Nullable String model, @Nullable String cameraOverlay, @Nullable HolderSet allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract) Equippable(int equipmentSlot, Holder<SoundEvent> soundEvent, @Nullable String model, @Nullable String cameraOverlay, @Nullable HolderSet allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract, boolean canBeSheared, Holder<SoundEvent> shearingSound) Creates an instance of aEquippablerecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable HolderSetReturns the value of theallowedEntitiesrecord component.@Nullable StringReturns the value of thecameraOverlayrecord component.booleanReturns the value of thecanBeShearedrecord component.booleanReturns the value of thedamageOnHurtrecord component.booleanReturns the value of thedispensablerecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theequipmentSlotrecord component.booleanReturns the value of theequipOnInteractrecord component.final inthashCode()Returns a hash code value for this object.@Nullable Stringmodel()Returns the value of themodelrecord component.rewrite(UserConnection connection, Protocol<?, ?, ?, ?> protocol, boolean clientbound) Rewrites the object to a different version, may return self or a new object.Returns the value of theshearingSoundrecord component.Returns the value of thesoundEventrecord component.booleanReturns the value of theswappablerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
TYPE1_21_2
-
TYPE1_21_5
-
TYPE1_21_6
-
-
Constructor Details
-
Equippable
public Equippable(int equipmentSlot, Holder<SoundEvent> soundEvent, @Nullable String model, @Nullable String cameraOverlay, @Nullable HolderSet allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt) -
Equippable
public Equippable(int equipmentSlot, Holder<SoundEvent> soundEvent, @Nullable String model, @Nullable String cameraOverlay, @Nullable HolderSet allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract) -
Equippable
public Equippable(int equipmentSlot, Holder<SoundEvent> soundEvent, @Nullable String model, @Nullable String cameraOverlay, @Nullable HolderSet allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract, boolean canBeSheared, Holder<SoundEvent> shearingSound) Creates an instance of aEquippablerecord class.- Parameters:
equipmentSlot- the value for theequipmentSlotrecord componentsoundEvent- the value for thesoundEventrecord componentmodel- the value for themodelrecord componentcameraOverlay- the value for thecameraOverlayrecord componentallowedEntities- the value for theallowedEntitiesrecord componentdispensable- the value for thedispensablerecord componentswappable- the value for theswappablerecord componentdamageOnHurt- the value for thedamageOnHurtrecord componentequipOnInteract- the value for theequipOnInteractrecord componentcanBeSheared- the value for thecanBeShearedrecord componentshearingSound- the value for theshearingSoundrecord component
-
-
Method Details
-
rewrite
public Equippable 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 '=='. -
equipmentSlot
public int equipmentSlot()Returns the value of theequipmentSlotrecord component.- Returns:
- the value of the
equipmentSlotrecord component
-
soundEvent
Returns the value of thesoundEventrecord component.- Returns:
- the value of the
soundEventrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
cameraOverlay
Returns the value of thecameraOverlayrecord component.- Returns:
- the value of the
cameraOverlayrecord component
-
allowedEntities
Returns the value of theallowedEntitiesrecord component.- Returns:
- the value of the
allowedEntitiesrecord component
-
dispensable
public boolean dispensable()Returns the value of thedispensablerecord component.- Returns:
- the value of the
dispensablerecord component
-
swappable
public boolean swappable()Returns the value of theswappablerecord component.- Returns:
- the value of the
swappablerecord component
-
damageOnHurt
public boolean damageOnHurt()Returns the value of thedamageOnHurtrecord component.- Returns:
- the value of the
damageOnHurtrecord component
-
equipOnInteract
public boolean equipOnInteract()Returns the value of theequipOnInteractrecord component.- Returns:
- the value of the
equipOnInteractrecord component
-
canBeSheared
public boolean canBeSheared()Returns the value of thecanBeShearedrecord component.- Returns:
- the value of the
canBeShearedrecord component
-
shearingSound
Returns the value of theshearingSoundrecord component.- Returns:
- the value of the
shearingSoundrecord component
-