Record Class Consumable
java.lang.Object
java.lang.Record
org.geysermc.mcprotocollib.protocol.data.game.item.component.Consumable
public record Consumable(float consumeSeconds, Consumable.ItemUseAnimation animation, Sound sound, boolean hasConsumeParticles, List<ConsumeEffect> onConsumeEffects)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionConsumable(float consumeSeconds, Consumable.ItemUseAnimation animation, Sound sound, boolean hasConsumeParticles, List<ConsumeEffect> onConsumeEffects) Creates an instance of aConsumablerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theanimationrecord component.static @NonNull Consumable.ConsumableBuilderbuilder()floatReturns the value of theconsumeSecondsrecord component.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.Returns the value of theonConsumeEffectsrecord component.sound()Returns the value of thesoundrecord component.@NonNull Consumable.ConsumableBuilderfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Consumable
public Consumable(float consumeSeconds, Consumable.ItemUseAnimation animation, Sound sound, boolean hasConsumeParticles, List<ConsumeEffect> onConsumeEffects) Creates an instance of aConsumablerecord class.- Parameters:
consumeSeconds- the value for theconsumeSecondsrecord componentanimation- the value for theanimationrecord componentsound- the value for thesoundrecord componenthasConsumeParticles- the value for thehasConsumeParticlesrecord componentonConsumeEffects- the value for theonConsumeEffectsrecord component
-
-
Method Details
-
builder
-
toBuilder
-
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
-
animation
Returns the value of theanimationrecord component.- Returns:
- the value of the
animationrecord 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
-
onConsumeEffects
Returns the value of theonConsumeEffectsrecord component.- Returns:
- the value of the
onConsumeEffectsrecord component
-