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 recordstatic 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_2record class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theanimationTyperecord component.Returns the value of theconsumeEffectsrecord component.floatReturns the value of theconsumeSecondsrecord component.copy()final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thehasConsumeParticlesrecord component.final inthashCode()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 thesoundrecord component.final StringtoString()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_2record class.- Parameters:
consumeSeconds- the value for theconsumeSecondsrecord componentanimationType- the value for theanimationTyperecord componentsound- the value for thesoundrecord componenthasConsumeParticles- the value for thehasConsumeParticlesrecord componentconsumeEffects- the value for theconsumeEffectsrecord component
-
-
Method Details
-
rewrite
public Consumable1_21_2 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
-
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 theconsumeSecondsrecord component.- Returns:
- the value of the
consumeSecondsrecord component
-
animationType
public int animationType()Returns the value of theanimationTyperecord component.- Returns:
- the value of the
animationTyperecord component
-
sound
Returns the value of thesoundrecord component.- Returns:
- the value of the
soundrecord component
-
hasConsumeParticles
public boolean hasConsumeParticles()Returns the value of thehasConsumeParticlesrecord component.- Returns:
- the value of the
hasConsumeParticlesrecord component
-
consumeEffects
Returns the value of theconsumeEffectsrecord component.- Returns:
- the value of the
consumeEffectsrecord component
-