From bbe0c2a5cbc34072ab27e8025653a752e2999937 Mon Sep 17 00:00:00 2001 From: starlottemusic <65743811+starlottemusic@users.noreply.github.com> Date: Mon, 14 Nov 2022 17:29:47 -0500 Subject: [PATCH] Sails use vanilla dye/shear sounds Adds the "Dye stains" and "Shears click" sounds to the sail block when the respective action occurs. --- .../components/structureMovement/bearing/SailBlock.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/SailBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/SailBlock.java index ee71a2dd5..2a2189a00 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/SailBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/SailBlock.java @@ -21,6 +21,8 @@ import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.Entity; @@ -90,6 +92,7 @@ public class SailBlock extends WrenchableDirectionalBlock { if (heldItem.getItem() instanceof ShearsItem) { if (!world.isClientSide) + world.playSound(null, pos, SoundEvents.SHEEP_SHEAR, SoundSource.BLOCKS, 1.0f, 1.0f); applyDye(state, world, pos, ray.getLocation(), null); return InteractionResult.SUCCESS; } @@ -100,6 +103,7 @@ public class SailBlock extends WrenchableDirectionalBlock { DyeColor color = DyeColor.getColor(heldItem); if (color != null) { if (!world.isClientSide) + world.playSound(null, pos, SoundEvents.DYE_USE, SoundSource.BLOCKS, 1.0f, 1.1f - world.random.nextFloat() * .2f); applyDye(state, world, pos, ray.getLocation(), color); return InteractionResult.SUCCESS; }