Record Class SoundEffectPacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.SoundEffectPacket
- All Implemented Interfaces:
SendablePacket
,ServerPacket
,Writeable
public record SoundEffectPacket(int soundId, @NotNull Sound.Source source, int x, int y, int z, float volume, float pitch)
extends Record
implements ServerPacket
-
Constructor Summary
ConstructorsConstructorDescriptionSoundEffectPacket
(int soundId, @NotNull Sound.Source source, int x, int y, int z, float volume, float pitch) Creates an instance of aSoundEffectPacket
record class.SoundEffectPacket
(@NotNull SoundEvent sound, @NotNull Sound.Source source, @NotNull Point position, float volume, float pitch) SoundEffectPacket
(BinaryReader reader) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.int
getId()
Gets the id of this packet.final int
hashCode()
Returns a hash code value for this object.float
pitch()
Returns the value of thepitch
record component.int
soundId()
Returns the value of thesoundId
record component.@NotNull Sound.Source
source()
Returns the value of thesource
record component.final String
toString()
Returns a string representation of this record class.float
volume()
Returns the value of thevolume
record component.void
write
(@NotNull BinaryWriter writer) Writes into aBinaryWriter
.int
x()
Returns the value of thex
record component.int
y()
Returns the value of they
record component.int
z()
Returns the value of thez
record component.
-
Constructor Details
-
SoundEffectPacket
-
SoundEffectPacket
public SoundEffectPacket(@NotNull @NotNull SoundEvent sound, @NotNull @NotNull Sound.Source source, @NotNull @NotNull Point position, float volume, float pitch) -
SoundEffectPacket
public SoundEffectPacket(int soundId, @NotNull @NotNull Sound.Source source, int x, int y, int z, float volume, float pitch) Creates an instance of aSoundEffectPacket
record class.- Parameters:
soundId
- the value for thesoundId
record componentsource
- the value for thesource
record componentx
- the value for thex
record componenty
- the value for they
record componentz
- the value for thez
record componentvolume
- the value for thevolume
record componentpitch
- the value for thepitch
record component
-
-
Method Details
-
write
Description copied from interface:Writeable
Writes into aBinaryWriter
. -
getId
public int getId()Description copied from interface:ServerPacket
Gets the id of this packet.Written in the final buffer header so it needs to match the client id.
- Specified by:
getId
in 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 '=='. -
soundId
public int soundId()Returns the value of thesoundId
record component.- Returns:
- the value of the
soundId
record component
-
source
Returns the value of thesource
record component.- Returns:
- the value of the
source
record component
-
x
public int x()Returns the value of thex
record component.- Returns:
- the value of the
x
record component
-
y
public int y()Returns the value of they
record component.- Returns:
- the value of the
y
record component
-
z
public int z()Returns the value of thez
record component.- Returns:
- the value of the
z
record component
-
volume
public float volume()Returns the value of thevolume
record component.- Returns:
- the value of the
volume
record component
-
pitch
public float pitch()Returns the value of thepitch
record component.- Returns:
- the value of the
pitch
record component
-