Record Class InstrumentImpl
java.lang.Object
java.lang.Record
net.minestom.server.item.instrument.InstrumentImpl
- All Implemented Interfaces:
Instrument,ProtocolObject
public record InstrumentImpl(@NotNull SoundEvent soundEvent, float useDuration, float range, @NotNull Component description, Registry.InstrumentEntry registry)
extends Record
implements Instrument
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minestom.server.item.instrument.Instrument
Instrument.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DynamicRegistry.Key<Instrument> static final DynamicRegistry.Key<Instrument> static final DynamicRegistry.Key<Instrument> static final DynamicRegistry.Key<Instrument> static final DynamicRegistry.Key<Instrument> static final DynamicRegistry.Key<Instrument> static final DynamicRegistry.Key<Instrument> static final DynamicRegistry.Key<Instrument> Fields inherited from interface net.minestom.server.item.instrument.Instrument
NBT_TYPE, NETWORK_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionInstrumentImpl(Registry.InstrumentEntry registry) InstrumentImpl(@NotNull SoundEvent soundEvent, float useDuration, float range, @NotNull Component description) InstrumentImpl(@NotNull SoundEvent soundEvent, float useDuration, float range, @NotNull Component description, Registry.InstrumentEntry registry) Creates an instance of aInstrumentImplrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull ComponentReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatrange()Returns the value of therangerecord component.registry()Returns the value of theregistryrecord component.@NotNull SoundEventReturns the value of thesoundEventrecord component.final StringtoString()Returns a string representation of this record class.floatReturns the value of theuseDurationrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minestom.server.item.instrument.Instrument
useDurationTicks
-
Field Details
-
ADMIRE_GOAT_HORN
-
SING_GOAT_HORN
-
YEARN_GOAT_HORN
-
SEEK_GOAT_HORN
-
DREAM_GOAT_HORN
-
FEEL_GOAT_HORN
-
CALL_GOAT_HORN
-
PONDER_GOAT_HORN
-
-
Constructor Details
-
InstrumentImpl
public InstrumentImpl(@NotNull @NotNull SoundEvent soundEvent, float useDuration, float range, @NotNull @NotNull Component description, @Nullable Registry.InstrumentEntry registry) Creates an instance of aInstrumentImplrecord class.- Parameters:
soundEvent- the value for thesoundEventrecord componentuseDuration- the value for theuseDurationrecord componentrange- the value for therangerecord componentdescription- the value for thedescriptionrecord componentregistry- the value for theregistryrecord component
-
InstrumentImpl
public InstrumentImpl(@NotNull @NotNull SoundEvent soundEvent, float useDuration, float range, @NotNull @NotNull Component description) -
InstrumentImpl
-
-
Method Details
-
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 '=='. -
soundEvent
Returns the value of thesoundEventrecord component.- Specified by:
soundEventin interfaceInstrument- Returns:
- the value of the
soundEventrecord component
-
useDuration
public float useDuration()Returns the value of theuseDurationrecord component.- Specified by:
useDurationin interfaceInstrument- Returns:
- the value of the
useDurationrecord component
-
range
public float range()Returns the value of therangerecord component.- Specified by:
rangein interfaceInstrument- Returns:
- the value of the
rangerecord component
-
description
Returns the value of thedescriptionrecord component.- Specified by:
descriptionin interfaceInstrument- Returns:
- the value of the
descriptionrecord component
-
registry
Returns the value of theregistryrecord component.- Specified by:
registryin interfaceInstrument- Specified by:
registryin interfaceProtocolObject- Returns:
- the value of the
registryrecord component
-