Package net.minestom.server.registry
Record Class Registry.InstrumentEntry
java.lang.Object
java.lang.Record
net.minestom.server.registry.Registry.InstrumentEntry
- All Implemented Interfaces:
Registry.Entry
- Enclosing class:
Registry
public static record Registry.InstrumentEntry(net.kyori.adventure.key.Key key, SoundEvent soundEvent, float useDuration, float range, Component description, Registry.Properties custom)
extends Record
implements Registry.Entry
-
Constructor Summary
ConstructorsConstructorDescriptionInstrumentEntry(String namespace, Registry.Properties main, Registry.Properties custom) InstrumentEntry(net.kyori.adventure.key.Key key, SoundEvent soundEvent, float useDuration, float range, Component description, Registry.Properties custom) Creates an instance of aInstrumentEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncustom()Returns the value of thecustomrecord component.Returns 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.net.kyori.adventure.key.Keykey()Returns the value of thekeyrecord component.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.
-
Constructor Details
-
InstrumentEntry
-
InstrumentEntry
public InstrumentEntry(net.kyori.adventure.key.Key key, SoundEvent soundEvent, float useDuration, float range, Component description, Registry.Properties custom) Creates an instance of aInstrumentEntryrecord class.- Parameters:
key- the value for thekeyrecord componentsoundEvent- the value for thesoundEventrecord componentuseDuration- the value for theuseDurationrecord componentrange- the value for therangerecord componentdescription- the value for thedescriptionrecord componentcustom- the value for thecustomrecord component
-
-
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 '=='. -
key
public net.kyori.adventure.key.Key key()Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
soundEvent
Returns the value of thesoundEventrecord component.- Returns:
- the value of the
soundEventrecord component
-
useDuration
public float useDuration()Returns the value of theuseDurationrecord component.- Returns:
- the value of the
useDurationrecord component
-
range
public float range()Returns the value of therangerecord component.- Returns:
- the value of the
rangerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
custom
Returns the value of thecustomrecord component.- Specified by:
customin interfaceRegistry.Entry- Returns:
- the value of the
customrecord component
-