Fixed the farmer not making sounds when planting.

This commit is contained in:
Flanks255 2024-11-30 15:03:32 -06:00
parent b23ba8f0b8
commit bfd8eb8fae
2 changed files with 3 additions and 0 deletions

View file

@ -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.

View file

@ -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;