Record Class InstrumentImpl
java.lang.Object
java.lang.Record
net.minestom.server.item.instrument.InstrumentImpl
- All Implemented Interfaces:
Instrument, Holder<Instrument>, Holder.Direct<Instrument>
public record InstrumentImpl(SoundEvent soundEvent, float useDuration, float range, Component description)
extends Record
implements Instrument
-
Nested Class Summary
Nested classes/interfaces inherited from interface Holder
Holder.Direct<T>Nested classes/interfaces inherited from interface Instrument
Instrument.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RegistryKey<Instrument> static final RegistryKey<Instrument> static final RegistryKey<Instrument> static final RegistryKey<Instrument> static final RegistryKey<Instrument> static final RegistryKey<Instrument> static final RegistryKey<Instrument> static final RegistryKey<Instrument> Fields inherited from interface Instrument
CODEC, NETWORK_TYPE, REGISTRY_CODEC, REGISTRY_NETWORK_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionInstrumentImpl(SoundEvent soundEvent, float useDuration, float range, Component description) Creates an instance of aInstrumentImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.Returns the value of thesoundEventrecord component.final StringtoString()Returns a string representation of this record class.floatReturns the value of theuseDurationrecord component.Methods inherited from interface 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
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 component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-