Record Class Consumable1_21_2
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.Consumable1_21_2
- All Implemented Interfaces:
Copyable
,Rewritable
public record Consumable1_21_2(float consumeSeconds, int animationType, Holder<SoundEvent> sound, boolean hasConsumeParticles, Consumable1_21_2.ConsumeEffect<?>[] consumeEffects)
extends Record
implements Copyable, Rewritable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConsumable1_21_2
(float consumeSeconds, int animationType, Holder<SoundEvent> sound, boolean hasConsumeParticles, Consumable1_21_2.ConsumeEffect<?>[] consumeEffects) Creates an instance of aConsumable1_21_2
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of theanimationType
record component.Returns the value of theconsumeEffects
record component.float
Returns the value of theconsumeSeconds
record component.copy()
final boolean
Indicates whether some other object is "equal to" this one.boolean
Returns the value of thehasConsumeParticles
record component.final int
hashCode()
Returns a hash code value for this object.rewrite
(UserConnection connection, Protocol<?, ?, ?, ?> protocol, boolean clientbound) Rewrites the object to a different version, may return self or a new object.sound()
Returns the value of thesound
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
EFFECT_TYPES
-
TYPE
-
-
Constructor Details
-
Consumable1_21_2
public Consumable1_21_2(float consumeSeconds, int animationType, Holder<SoundEvent> sound, boolean hasConsumeParticles, Consumable1_21_2.ConsumeEffect<?>[] consumeEffects) Creates an instance of aConsumable1_21_2
record class.- Parameters:
consumeSeconds
- the value for theconsumeSeconds
record componentanimationType
- the value for theanimationType
record componentsound
- the value for thesound
record componenthasConsumeParticles
- the value for thehasConsumeParticles
record componentconsumeEffects
- the value for theconsumeEffects
record component
-
-
Method Details
-
rewrite
public Consumable1_21_2 rewrite(UserConnection connection, Protocol<?, ?, ?, ?> protocol, boolean clientbound) Description copied from interface:Rewritable
Rewrites the object to a different version, may return self or a new object.- Specified by:
rewrite
in 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
-
copy
-
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 '=='. -
consumeSeconds
public float consumeSeconds()Returns the value of theconsumeSeconds
record component.- Returns:
- the value of the
consumeSeconds
record component
-
animationType
public int animationType()Returns the value of theanimationType
record component.- Returns:
- the value of the
animationType
record component
-
sound
Returns the value of thesound
record component.- Returns:
- the value of the
sound
record component
-
hasConsumeParticles
public boolean hasConsumeParticles()Returns the value of thehasConsumeParticles
record component.- Returns:
- the value of the
hasConsumeParticles
record component
-
consumeEffects
Returns the value of theconsumeEffects
record component.- Returns:
- the value of the
consumeEffects
record component
-