Package net.minecraft.world.item
Record Class CrossbowItem.ChargingSounds
java.lang.Object
java.lang.Record
net.minecraft.world.item.CrossbowItem.ChargingSounds
- Enclosing class:
CrossbowItem
public static record CrossbowItem.ChargingSounds(Optional<Holder<SoundEvent>> start, Optional<Holder<SoundEvent>> mid, Optional<Holder<SoundEvent>> end)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<CrossbowItem.ChargingSounds> private final Optional<Holder<SoundEvent>> The field for theendrecord component.private final Optional<Holder<SoundEvent>> The field for themidrecord component.private final Optional<Holder<SoundEvent>> The field for thestartrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionChargingSounds(Optional<Holder<SoundEvent>> start, Optional<Holder<SoundEvent>> mid, Optional<Holder<SoundEvent>> end) Creates an instance of aChargingSoundsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.mid()Returns the value of themidrecord component.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
start
The field for thestartrecord component. -
mid
The field for themidrecord component. -
end
The field for theendrecord component. -
CODEC
-
-
Constructor Details
-
ChargingSounds
public ChargingSounds(Optional<Holder<SoundEvent>> start, Optional<Holder<SoundEvent>> mid, Optional<Holder<SoundEvent>> end) Creates an instance of aChargingSoundsrecord class.- Parameters:
start- the value for thestartrecord componentmid- the value for themidrecord componentend- the value for theendrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
mid
Returns the value of themidrecord component.- Returns:
- the value of the
midrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-