Record Class Equippable
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.Equippable
-
Field Summary
-
Constructor Summary
ConstructorDescriptionEquippable
(int equipmentSlot, Holder<SoundEvent> soundEvent, @Nullable String model, @Nullable String cameraOverlay, @Nullable HolderSet allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt) Creates an instance of aEquippable
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable HolderSet
Returns the value of theallowedEntities
record component.@Nullable String
Returns the value of thecameraOverlay
record component.boolean
Returns the value of thedamageOnHurt
record component.boolean
Returns the value of thedispensable
record component.final boolean
Indicates whether some other object is "equal to" this one.int
Returns the value of theequipmentSlot
record component.final int
hashCode()
Returns a hash code value for this object.@Nullable String
model()
Returns the value of themodel
record component.rewrite
(it.unimi.dsi.fastutil.ints.Int2IntFunction soundIdRewriter) Returns the value of thesoundEvent
record component.boolean
Returns the value of theswappable
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
TYPE
-
-
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) Creates an instance of aEquippable
record class.- Parameters:
equipmentSlot
- the value for theequipmentSlot
record componentsoundEvent
- the value for thesoundEvent
record componentmodel
- the value for themodel
record componentcameraOverlay
- the value for thecameraOverlay
record componentallowedEntities
- the value for theallowedEntities
record componentdispensable
- the value for thedispensable
record componentswappable
- the value for theswappable
record componentdamageOnHurt
- the value for thedamageOnHurt
record component
-
-
Method Details
-
rewrite
-
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 theequipmentSlot
record component.- Returns:
- the value of the
equipmentSlot
record component
-
soundEvent
Returns the value of thesoundEvent
record component.- Returns:
- the value of the
soundEvent
record component
-
model
Returns the value of themodel
record component.- Returns:
- the value of the
model
record component
-
cameraOverlay
Returns the value of thecameraOverlay
record component.- Returns:
- the value of the
cameraOverlay
record component
-
allowedEntities
Returns the value of theallowedEntities
record component.- Returns:
- the value of the
allowedEntities
record component
-
dispensable
public boolean dispensable()Returns the value of thedispensable
record component.- Returns:
- the value of the
dispensable
record component
-
swappable
public boolean swappable()Returns the value of theswappable
record component.- Returns:
- the value of the
swappable
record component
-
damageOnHurt
public boolean damageOnHurt()Returns the value of thedamageOnHurt
record component.- Returns:
- the value of the
damageOnHurt
record component
-