Class SoundUtils

java.lang.Object
org.geysermc.geyser.util.SoundUtils

public final class SoundUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.kyori.adventure.key.Key
    getKey(org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound)
     
    static void
    playSound(GeyserSession session, net.kyori.adventure.key.Key javaSound, org.cloudburstmc.math.vector.Vector3f position, float volume, float pitch)
     
    static void
    playSound(GeyserSession session, net.kyori.adventure.key.Key javaSound, Entity entity, float volume, float pitch)
     
    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 a GeyserSession.
    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 a GeyserSession.
    static Optional<net.kyori.adventure.key.Key>
    readSoundEvent(org.cloudburstmc.nbt.NbtMap data, String context)
     
    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
    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
    translateSoundEvent(net.kyori.adventure.key.Key javaIdentifier)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getKey

      public static net.kyori.adventure.key.Key getKey(org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound)
    • translateSoundEvent

      public static SoundMapping translateSoundEvent(net.kyori.adventure.key.Key javaIdentifier)
    • 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 translate
      position - 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 translate
      entity - 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 a GeyserSession.
      Parameters:
      session - the Bedrock client session.
      javaSound - the builtin sound to play
      entity - the entity
      pitch - 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 a GeyserSession.
      Parameters:
      session - the Bedrock client session.
      javaSound - the builtin sound to play
      position - the position
      pitch - 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

      public static Optional<net.kyori.adventure.key.Key> readSoundEvent(org.cloudburstmc.nbt.NbtMap data, String context)