Package org.geysermc.geyser.util
Class SoundUtils
java.lang.Object
org.geysermc.geyser.util.SoundUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.kyori.adventure.key.KeygetKey(org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound) static voidplaySound(GeyserSession session, net.kyori.adventure.key.Key javaSound, org.cloudburstmc.math.vector.Vector3f position, float volume, float pitch) static voidplaySound(GeyserSession session, net.kyori.adventure.key.Key javaSound, Entity entity, float volume, float pitch) static voidplaySound(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound, org.cloudburstmc.math.vector.Vector3f position, float volume, float pitch) Translates and plays a Java sound event for aGeyserSession.static voidplaySound(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound, Entity entity, float volume, float pitch) Translates and plays a Java sound event for aGeyserSession.static Optional<net.kyori.adventure.key.Key> readSoundEvent(org.cloudburstmc.nbt.NbtMap data, String context) static org.cloudburstmc.protocol.bedrock.packet.PlaySoundPackettranslatePlaySound(net.kyori.adventure.key.Key javaIdentifier, org.cloudburstmc.math.vector.Vector3f position, float volume, float pitch) Translates a Java Custom or Builtin Sound to its Bedrock equivalentstatic org.cloudburstmc.protocol.bedrock.packet.PlaySoundPackettranslatePlaySound(net.kyori.adventure.key.Key javaIdentifier, Entity entity, float volume, float pitch) Translates a Java Custom or Builtin Sound to its Bedrock equivalentstatic SoundMappingtranslateSoundEvent(net.kyori.adventure.key.Key javaIdentifier)
-
Method Details
-
getKey
public static net.kyori.adventure.key.Key getKey(org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound) -
translateSoundEvent
-
translatePlaySound
public static org.cloudburstmc.protocol.bedrock.packet.PlaySoundPacket translatePlaySound(net.kyori.adventure.key.Key javaIdentifier, org.cloudburstmc.math.vector.Vector3f position, float volume, float pitch) Translates a Java Custom or Builtin Sound to its Bedrock equivalent- Parameters:
javaIdentifier- the sound to translateposition- the position to play the sound at- Returns:
- a Bedrock sound
-
translatePlaySound
public static org.cloudburstmc.protocol.bedrock.packet.PlaySoundPacket translatePlaySound(net.kyori.adventure.key.Key javaIdentifier, Entity entity, float volume, float pitch) Translates a Java Custom or Builtin Sound to its Bedrock equivalent- Parameters:
javaIdentifier- the sound to translateentity- the entity to play the sound at- Returns:
- a Bedrock sound
-
playSound
public static void playSound(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound, Entity entity, float volume, float pitch) Translates and plays a Java sound event for aGeyserSession.- Parameters:
session- the Bedrock client session.javaSound- the builtin sound to playentity- the entitypitch- the pitch
-
playSound
public static void playSound(GeyserSession session, net.kyori.adventure.key.Key javaSound, Entity entity, float volume, float pitch) -
playSound
public static void playSound(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound, org.cloudburstmc.math.vector.Vector3f position, float volume, float pitch) Translates and plays a Java sound event for aGeyserSession.- Parameters:
session- the Bedrock client session.javaSound- the builtin sound to playposition- the positionpitch- the pitch
-
playSound
public static void playSound(GeyserSession session, net.kyori.adventure.key.Key javaSound, org.cloudburstmc.math.vector.Vector3f position, float volume, float pitch) -
readSoundEvent
-