java.lang.Object
net.darkhax.bookshelf.api.data.sound.Sound
All Implemented Interfaces:
ISound

public final class Sound extends Object implements ISound
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static com.mojang.serialization.Codec<Sound>
     
    static com.mojang.serialization.Codec<Sound>
     
    static com.mojang.serialization.Codec<Sound>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Sound(net.minecraft.sounds.SoundEvent sound)
     
    Sound(net.minecraft.sounds.SoundEvent sound, net.minecraft.sounds.SoundSource category, float pitch, float volume)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    static Sound
    fromByteBuf(net.minecraft.network.FriendlyByteBuf buffer)
     
    net.minecraft.sounds.SoundSource
     
    float
     
    net.minecraft.sounds.SoundEvent
     
    float
     
    int
     
    void
    playSoundAt(net.minecraft.world.level.Level level, @Nullable net.minecraft.world.entity.player.Player originator, double posX, double posY, double posZ)
     
    static void
    toByteBuf(net.minecraft.network.FriendlyByteBuf buffer, Sound toWrite)
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.darkhax.bookshelf.api.data.sound.ISound

    playSoundAt, playSoundAt
  • Field Details

    • CODEC_SIMPLE

      public static com.mojang.serialization.Codec<Sound> CODEC_SIMPLE
    • CODEC_OBJECT

      public static com.mojang.serialization.Codec<Sound> CODEC_OBJECT
    • CODEC

      public static com.mojang.serialization.Codec<Sound> CODEC
  • Constructor Details

    • Sound

      public Sound(net.minecraft.sounds.SoundEvent sound)
    • Sound

      public Sound(net.minecraft.sounds.SoundEvent sound, net.minecraft.sounds.SoundSource category, float pitch, float volume)
  • Method Details

    • playSoundAt

      public void playSoundAt(net.minecraft.world.level.Level level, @Nullable @Nullable net.minecraft.world.entity.player.Player originator, double posX, double posY, double posZ)
      Specified by:
      playSoundAt in interface ISound
    • getSound

      public net.minecraft.sounds.SoundEvent getSound()
    • getCategory

      public net.minecraft.sounds.SoundSource getCategory()
    • getPitch

      public float getPitch()
    • getVolume

      public float getVolume()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • fromByteBuf

      public static Sound fromByteBuf(net.minecraft.network.FriendlyByteBuf buffer)
    • toByteBuf

      public static void toByteBuf(net.minecraft.network.FriendlyByteBuf buffer, Sound toWrite)