Record Class PlaySoundEventTranslator
java.lang.Object
java.lang.Record
org.geysermc.geyser.translator.level.event.PlaySoundEventTranslator
- All Implemented Interfaces:
LevelEventTranslator
public record PlaySoundEventTranslator(String name, float volume, boolean pitchSub, float pitchMul, float pitchAdd, boolean relative)
extends Record
implements LevelEventTranslator
-
Constructor Summary
ConstructorDescriptionPlaySoundEventTranslator(String name, float volume, boolean pitchSub, float pitchMul, float pitchAdd, boolean relative)
Creates an instance of aPlaySoundEventTranslator
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.float
pitchAdd()
Returns the value of thepitchAdd
record component.float
pitchMul()
Returns the value of thepitchMul
record component.boolean
pitchSub()
Returns the value of thepitchSub
record component.boolean
relative()
Returns the value of therelative
record component.toString()
Returns a string representation of this record class.void
translate(GeyserSession session, com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelEventPacket packet)
Translates the givenClientboundLevelEventPacket
into bedrock and sends it upstream.float
volume()
Returns the value of thevolume
record component.
-
Constructor Details
-
PlaySoundEventTranslator
public PlaySoundEventTranslator(String name, float volume, boolean pitchSub, float pitchMul, float pitchAdd, boolean relative)Creates an instance of aPlaySoundEventTranslator
record class.- Parameters:
name
- the value for thename
record componentvolume
- the value for thevolume
record componentpitchSub
- the value for thepitchSub
record componentpitchMul
- the value for thepitchMul
record componentpitchAdd
- the value for thepitchAdd
record componentrelative
- the value for therelative
record component
-
-
Method Details
-
translate
public void translate(GeyserSession session, com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelEventPacket packet)Description copied from interface:LevelEventTranslator
Translates the givenClientboundLevelEventPacket
into bedrock and sends it upstream.- Specified by:
translate
in interfaceLevelEventTranslator
- Parameters:
session
- GeyserConnectionpacket
- the effect packet to handle
-
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 '=='. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
volume
public float volume()Returns the value of thevolume
record component.- Returns:
- the value of the
volume
record component
-
pitchSub
public boolean pitchSub()Returns the value of thepitchSub
record component.- Returns:
- the value of the
pitchSub
record component
-
pitchMul
public float pitchMul()Returns the value of thepitchMul
record component.- Returns:
- the value of the
pitchMul
record component
-
pitchAdd
public float pitchAdd()Returns the value of thepitchAdd
record component.- Returns:
- the value of the
pitchAdd
record component
-
relative
public boolean relative()Returns the value of therelative
record component.- Returns:
- the value of the
relative
record component
-