Record Class SoundEffectPacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.SoundEffectPacket
- All Implemented Interfaces:
NetworkBuffer.Writer,SendablePacket,ServerPacket
public record SoundEffectPacket(@Nullable SoundEvent soundEvent, @Nullable String soundName, @Nullable Float range, @NotNull net.kyori.adventure.sound.Sound.Source source, int x, int y, int z, float volume, float pitch, long seed)
extends Record
implements ServerPacket
-
Constructor Summary
ConstructorsConstructorDescriptionSoundEffectPacket(@NotNull String soundName, @Nullable Float range, @NotNull net.kyori.adventure.sound.Sound.Source source, @NotNull Point position, float volume, float pitch, long seed) SoundEffectPacket(@NotNull NetworkBuffer reader) SoundEffectPacket(@NotNull SoundEvent soundEvent, @Nullable Float range, @NotNull net.kyori.adventure.sound.Sound.Source source, @NotNull Point position, float volume, float pitch, long seed) SoundEffectPacket(@Nullable SoundEvent soundEvent, @Nullable String soundName, @Nullable Float range, @NotNull net.kyori.adventure.sound.Sound.Source source, int x, int y, int z, float volume, float pitch, long seed) Creates an instance of aSoundEffectPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intgetId(@NotNull ConnectionState state) Gets the id of this packet.final inthashCode()Returns a hash code value for this object.floatpitch()Returns the value of thepitchrecord component.@Nullable Floatrange()Returns the value of therangerecord component.longseed()Returns the value of theseedrecord component.@Nullable SoundEventReturns the value of thesoundEventrecord component.@Nullable StringReturns the value of thesoundNamerecord component.@NotNull net.kyori.adventure.sound.Sound.Sourcesource()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.floatvolume()Returns the value of thevolumerecord component.voidwrite(@NotNull NetworkBuffer writer) intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.intz()Returns the value of thezrecord component.
-
Constructor Details
-
SoundEffectPacket
public SoundEffectPacket(@Nullable @Nullable SoundEvent soundEvent, @Nullable @Nullable String soundName, @Nullable @Nullable Float range, @NotNull @NotNull net.kyori.adventure.sound.Sound.Source source, int x, int y, int z, float volume, float pitch, long seed) Creates an instance of aSoundEffectPacketrecord class.- Parameters:
soundEvent- the value for thesoundEventrecord componentsoundName- the value for thesoundNamerecord componentrange- the value for therangerecord componentsource- the value for thesourcerecord componentx- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentvolume- the value for thevolumerecord componentpitch- the value for thepitchrecord componentseed- the value for theseedrecord component
-
SoundEffectPacket
public SoundEffectPacket(@NotNull @NotNull SoundEvent soundEvent, @Nullable @Nullable Float range, @NotNull @NotNull net.kyori.adventure.sound.Sound.Source source, @NotNull @NotNull Point position, float volume, float pitch, long seed) -
SoundEffectPacket
-
SoundEffectPacket
-
-
Method Details
-
write
- Specified by:
writein interfaceNetworkBuffer.Writer
-
getId
Description copied from interface:ServerPacketGets the id of this packet.Written in the final buffer header so it needs to match the client id.
- Specified by:
getIdin interfaceServerPacket- Returns:
- the id of this packet
-
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.- Returns:
- the value of the
soundEventrecord component
-
soundName
Returns the value of thesoundNamerecord component.- Returns:
- the value of the
soundNamerecord component
-
range
Returns the value of therangerecord component.- Returns:
- the value of the
rangerecord component
-
source
@NotNull public @NotNull net.kyori.adventure.sound.Sound.Source source()Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
volume
public float volume()Returns the value of thevolumerecord component.- Returns:
- the value of the
volumerecord component
-
pitch
public float pitch()Returns the value of thepitchrecord component.- Returns:
- the value of the
pitchrecord component
-
seed
public long seed()Returns the value of theseedrecord component.- Returns:
- the value of the
seedrecord component
-