From bfd8eb8fae814f6b9849e9d309fed10889a6d921 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Sat, 30 Nov 2024 15:03:32 -0600 Subject: [PATCH] Fixed the farmer not making sounds when planting. --- CHANGELOG.md | 1 + .../mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96787a9c3..37e846ead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * Possible fix for very rare stack overflow. * Reinforced fix for drills breaking in certain circumstances. * Fix for drill not dropping block contents for certain mods. +* Fixed the Farmer not making sounds when planting. # 1.3.10+mc1.21.1 * Fixed Fluid placer not being harvestable. diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java index 061da6acb..72a25118d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java @@ -62,7 +62,9 @@ public class DefaultFarmerBehavior implements IFarmerBehavior { private static boolean tryPlant(BlockState toPlant, Level world, BlockPos pos) { if (toPlant.canSurvive(world, pos)) { + SoundType sound = toPlant.getSoundType(world, pos, null); world.setBlockAndUpdate(pos, toPlant); + world.playSound(null, pos, sound.getPlaceSound(), SoundSource.BLOCKS, (sound.getVolume() + 1.0F) / 2.0F, sound.getPitch() * 0.8F); return true; } return false;