Record Class SoundEventEventTranslator
java.lang.Object
java.lang.Record
org.geysermc.geyser.translator.level.event.SoundEventEventTranslator
- All Implemented Interfaces:
LevelEventTranslator
public record SoundEventEventTranslator(com.nukkitx.protocol.bedrock.data.SoundEvent soundEvent, String identifier, int extraData)
extends Record
implements LevelEventTranslator
-
Constructor Summary
ConstructorDescriptionSoundEventEventTranslator(com.nukkitx.protocol.bedrock.data.SoundEvent soundEvent, String identifier, int extraData)
Creates an instance of aSoundEventEventTranslator
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.int
Returns the value of theextraData
record component.int
hashCode()
Returns a hash code value for this object.Returns the value of theidentifier
record component.com.nukkitx.protocol.bedrock.data.SoundEvent
Returns the value of thesoundEvent
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.
-
Constructor Details
-
SoundEventEventTranslator
public SoundEventEventTranslator(com.nukkitx.protocol.bedrock.data.SoundEvent soundEvent, String identifier, int extraData)Creates an instance of aSoundEventEventTranslator
record class.- Parameters:
soundEvent
- the value for thesoundEvent
record componentidentifier
- the value for theidentifier
record componentextraData
- the value for theextraData
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 '=='. -
soundEvent
public com.nukkitx.protocol.bedrock.data.SoundEvent soundEvent()Returns the value of thesoundEvent
record component.- Returns:
- the value of the
soundEvent
record component
-
identifier
Returns the value of theidentifier
record component.- Returns:
- the value of the
identifier
record component
-
extraData
public int extraData()Returns the value of theextraData
record component.- Returns:
- the value of the
extraData
record component
-