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
ConstructorsConstructorDescriptionPlaySoundEventTranslator(String name, float volume, boolean pitchSub, float pitchMul, float pitchAdd, boolean relative)Creates an instance of aPlaySoundEventTranslatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.floatpitchAdd()Returns the value of thepitchAddrecord component.floatpitchMul()Returns the value of thepitchMulrecord component.booleanpitchSub()Returns the value of thepitchSubrecord component.booleanrelative()Returns the value of therelativerecord component.toString()Returns a string representation of this record class.voidtranslate(GeyserSession session, com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelEventPacket packet)Translates the givenClientboundLevelEventPacketinto bedrock and sends it upstream.floatvolume()Returns the value of thevolumerecord component.
-
Constructor Details
-
PlaySoundEventTranslator
public PlaySoundEventTranslator(String name, float volume, boolean pitchSub, float pitchMul, float pitchAdd, boolean relative)Creates an instance of aPlaySoundEventTranslatorrecord class.- Parameters:
name- the value for thenamerecord componentvolume- the value for thevolumerecord componentpitchSub- the value for thepitchSubrecord componentpitchMul- the value for thepitchMulrecord componentpitchAdd- the value for thepitchAddrecord componentrelative- the value for therelativerecord component
-
-
Method Details
-
translate
public void translate(GeyserSession session, com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelEventPacket packet)Description copied from interface:LevelEventTranslatorTranslates the givenClientboundLevelEventPacketinto bedrock and sends it upstream.- Specified by:
translatein 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 thenamerecord component.- Returns:
- the value of the
namerecord component
-
volume
public float volume()Returns the value of thevolumerecord component.- Returns:
- the value of the
volumerecord component
-
pitchSub
public boolean pitchSub()Returns the value of thepitchSubrecord component.- Returns:
- the value of the
pitchSubrecord component
-
pitchMul
public float pitchMul()Returns the value of thepitchMulrecord component.- Returns:
- the value of the
pitchMulrecord component
-
pitchAdd
public float pitchAdd()Returns the value of thepitchAddrecord component.- Returns:
- the value of the
pitchAddrecord component
-
relative
public boolean relative()Returns the value of therelativerecord component.- Returns:
- the value of the
relativerecord component
-