Class SoundMotifSoundType

java.lang.Object
net.minecraft.world.level.block.SoundType
net.minecraftforge.common.util.ForgeSoundType
team.lodestar.lodestone.systems.sound.ExtendedSoundType
team.lodestar.lodestone.systems.sound.SoundMotifSoundType

public class SoundMotifSoundType extends ExtendedSoundType
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Supplier<net.minecraft.sounds.SoundEvent>
     

    Fields inherited from class net.minecraft.world.level.block.SoundType

    AMETHYST, AMETHYST_CLUSTER, ANCIENT_DEBRIS, ANVIL, AZALEA, AZALEA_LEAVES, BAMBOO, BAMBOO_SAPLING, BAMBOO_WOOD, BAMBOO_WOOD_HANGING_SIGN, BASALT, BIG_DRIPLEAF, BONE_BLOCK, CALCITE, CANDLE, CAVE_VINES, CHAIN, CHERRY_LEAVES, CHERRY_SAPLING, CHERRY_WOOD, CHERRY_WOOD_HANGING_SIGN, CHISELED_BOOKSHELF, COPPER, CORAL_BLOCK, CROP, DECORATED_POT, DECORATED_POT_CRACKED, DEEPSLATE, DEEPSLATE_BRICKS, DEEPSLATE_TILES, DRIPSTONE_BLOCK, EMPTY, FLOWERING_AZALEA, FROGLIGHT, FROGSPAWN, FUNGUS, GILDED_BLACKSTONE, GLASS, GLOW_LICHEN, GRASS, GRAVEL, HANGING_ROOTS, HANGING_SIGN, HARD_CROP, HONEY_BLOCK, LADDER, LANTERN, LARGE_AMETHYST_BUD, LILY_PAD, LODESTONE, MANGROVE_ROOTS, MEDIUM_AMETHYST_BUD, METAL, MOSS, MOSS_CARPET, MUD, MUD_BRICKS, MUDDY_MANGROVE_ROOTS, NETHER_BRICKS, NETHER_GOLD_ORE, NETHER_ORE, NETHER_SPROUTS, NETHER_WART, NETHER_WOOD, NETHER_WOOD_HANGING_SIGN, NETHERITE_BLOCK, NETHERRACK, NYLIUM, PACKED_MUD, PINK_PETALS, pitch, POINTED_DRIPSTONE, POLISHED_DEEPSLATE, POWDER_SNOW, ROOTED_DIRT, ROOTS, SAND, SCAFFOLDING, SCULK, SCULK_CATALYST, SCULK_SENSOR, SCULK_SHRIEKER, SCULK_VEIN, SHROOMLIGHT, SLIME_BLOCK, SMALL_AMETHYST_BUD, SMALL_DRIPLEAF, SNOW, SOUL_SAND, SOUL_SOIL, SPORE_BLOSSOM, STEM, STONE, SUSPICIOUS_GRAVEL, SUSPICIOUS_SAND, SWEET_BERRY_BUSH, TUFF, TWISTING_VINES, VINE, volume, WART_BLOCK, WEEPING_VINES, WET_GRASS, WOOD, WOOL
  • Constructor Summary

    Constructors
    Constructor
    Description
    SoundMotifSoundType(Supplier<net.minecraft.sounds.SoundEvent> motifSound, float volumeIn, float pitchIn, Supplier<net.minecraft.sounds.SoundEvent> breakSoundIn, Supplier<net.minecraft.sounds.SoundEvent> stepSoundIn, Supplier<net.minecraft.sounds.SoundEvent> placeSoundIn, Supplier<net.minecraft.sounds.SoundEvent> hitSoundIn, Supplier<net.minecraft.sounds.SoundEvent> fallSoundIn)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
     
    float
     
    void
    onPlayBreakSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Called by mixin injection when the block broken sound plays in
    void
    onPlayFallSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.sounds.SoundSource category)
    Called by mixin injection when an entity plays the fall sound in
    void
    onPlayHitSound(net.minecraft.core.BlockPos pos)
    Called by mixin injection when the block breaking progress sound is played in
    void
    onPlayPlaceSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
    Called by mixin injection when a player triggers the block place sound in
    void
    onPlayStepSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.sounds.SoundSource category)
    Called by mixin injection when an entity triggers the block step sound in

    Methods inherited from class net.minecraftforge.common.util.ForgeSoundType

    getBreakSound, getFallSound, getHitSound, getPlaceSound, getStepSound

    Methods inherited from class net.minecraft.world.level.block.SoundType

    getPitch, getVolume

    Methods inherited from class java.lang.Object

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

    • motifSound

      public final Supplier<net.minecraft.sounds.SoundEvent> motifSound
  • Constructor Details

    • SoundMotifSoundType

      public SoundMotifSoundType(Supplier<net.minecraft.sounds.SoundEvent> motifSound, float volumeIn, float pitchIn, Supplier<net.minecraft.sounds.SoundEvent> breakSoundIn, Supplier<net.minecraft.sounds.SoundEvent> stepSoundIn, Supplier<net.minecraft.sounds.SoundEvent> placeSoundIn, Supplier<net.minecraft.sounds.SoundEvent> hitSoundIn, Supplier<net.minecraft.sounds.SoundEvent> fallSoundIn)
  • Method Details

    • getMotifPitch

      public float getMotifPitch()
    • getMotifVolume

      public float getMotifVolume()
    • onPlayBreakSound

      public void onPlayBreakSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Description copied from class: ExtendedSoundType
      Called by mixin injection when the block broken sound plays in

      LevelRenderer.levelEvent(int, BlockPos, int)

      Example Implementation, matches the original logic of the parent sound being played:

      level.playLocalSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, getBreakSound(), SoundSource.BLOCKS, (getVolume() + 1.0F) / 2.0F, getPitch() * 0.8F, false);
      Overrides:
      onPlayBreakSound in class ExtendedSoundType
    • onPlayStepSound

      public void onPlayStepSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.sounds.SoundSource category)
      Description copied from class: ExtendedSoundType
      Called by mixin injection when an entity triggers the block step sound in

      Entity.playStepSound(BlockPos, BlockState)

      Example Implementation, matches the original logic of the parent sound being played:

      level.playSound(null, pos.getX(), pos.getY(), pos.getZ(), getStepSound(), category, getVolume() * 0.15F, getPitch());
      Overrides:
      onPlayStepSound in class ExtendedSoundType
    • onPlayPlaceSound

      public void onPlayPlaceSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
      Description copied from class: ExtendedSoundType
      Called by mixin injection when a player triggers the block place sound in

      BlockItem.place(BlockPlaceContext)

      Example Implementation, matches the original logic of the parent sound being played:

      level.playSound(player, pos, getPlaceSound(), SoundSource.BLOCKS, (getVolume() + 1.0F) / 2.0F, getPitch() * 0.8F);
      Overrides:
      onPlayPlaceSound in class ExtendedSoundType
    • onPlayHitSound

      public void onPlayHitSound(net.minecraft.core.BlockPos pos)
      Description copied from class: ExtendedSoundType
      Called by mixin injection when the block breaking progress sound is played in

      MultiPlayerGameMode.continueDestroyBlock(BlockPos, Direction)

      Example Implementation, matches the original logic of the parent sound being played:

      Minecraft.getInstance().getSoundManager().play(new SimpleSoundInstance(getHitSound(), SoundSource.BLOCKS, (getVolume() + 1.0F) / 8.0F, getPitch() * 0.5F, pos));
      Overrides:
      onPlayHitSound in class ExtendedSoundType
    • onPlayFallSound

      public void onPlayFallSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.sounds.SoundSource category)
      Description copied from class: ExtendedSoundType
      Called by mixin injection when an entity plays the fall sound in

      LivingEntity.playBlockFallSound()

      Example Implementation, matches the original logic of the parent sound being played:

      level.playSound(null, pos.getX(), pos.getY(), pos.getZ(), getFallSound(), category, getVolume() * 0.5F, getPitch() * 0.75f);
      Overrides:
      onPlayFallSound in class ExtendedSoundType