From 24d82b4c9daa81680e79ff36f4270ab6a1acff2a Mon Sep 17 00:00:00 2001 From: AViewFromTheTop <87103914+AViewFromTheTop@users.noreply.github.com> Date: Fri, 31 Jan 2025 03:07:28 -0500 Subject: [PATCH] Fix Two Sound Issues --- .../frozenblock/wilderwild/item/MobBottleItem.java | 13 ++++++++++++- .../frozenblock/wilderwild/registry/WWSounds.java | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/frozenblock/wilderwild/item/MobBottleItem.java b/src/main/java/net/frozenblock/wilderwild/item/MobBottleItem.java index 76241e79ad..39479635b0 100644 --- a/src/main/java/net/frozenblock/wilderwild/item/MobBottleItem.java +++ b/src/main/java/net/frozenblock/wilderwild/item/MobBottleItem.java @@ -32,6 +32,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; +import net.minecraft.sounds.SoundSource; import net.minecraft.stats.Stats; import net.minecraft.util.Mth; import net.minecraft.world.InteractionHand; @@ -90,7 +91,17 @@ public InteractionResultHolder use(@NotNull Level level, @NotNull Pla if (!player.getAbilities().instabuild) player.setItemInHand(interactionHand, ItemUtils.createFilledResult(stack, player, new ItemStack(Items.GLASS_BOTTLE))); player.awardStat(Stats.ITEM_USED.get(stack.getItem())); - player.playSound(this.releaseSound, 0.75F, level.getRandom().nextFloat() * 0.2F + 0.9F); + server.playSound( + null, + player.getX(), + player.getEyeY(), + player.getZ(), + this.releaseSound, + SoundSource.NEUTRAL, + 0.75F, + level.getRandom().nextFloat() * 0.2F + 0.9F + ); + if (stack.has(DataComponents.CUSTOM_NAME)) { entity.setCustomName(stack.getHoverName()); } diff --git a/src/main/java/net/frozenblock/wilderwild/registry/WWSounds.java b/src/main/java/net/frozenblock/wilderwild/registry/WWSounds.java index 81d01f681e..2d7a3f3dbe 100644 --- a/src/main/java/net/frozenblock/wilderwild/registry/WWSounds.java +++ b/src/main/java/net/frozenblock/wilderwild/registry/WWSounds.java @@ -230,7 +230,7 @@ public final class WWSounds { public static final SoundEvent BLOCK_OSTRICH_EGG_CRACK = register("block.ostrich_egg.crack"); public static final SoundEvent BLOCK_OSTRICH_EGG_HATCH = register("block.ostrich_egg.hatch"); public static final SoundEvent BLOCK_PENGUIN_EGG_CRACK = register("block.penguin_egg.crack"); - public static final SoundEvent BLOCK_PENGUIN_EGG_HATCH = register("block.ostrich_eggpenguin_egg.hatch"); + public static final SoundEvent BLOCK_PENGUIN_EGG_HATCH = register("block.penguin_egg.hatch"); public static final SoundEvent BLOCK_GEYSER_PLACE = register("block.geyser.place"); public static final SoundEvent BLOCK_GEYSER_HIT = register("block.geyser.hit"); public static final SoundEvent BLOCK_GEYSER_BREAK = register("block.geyser.break");