From c2999e355e468ea1f32cf263004a7fd71e1dfc26 Mon Sep 17 00:00:00 2001 From: HoosierTransfer <97118529+HoosierTransfer@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:03:16 -0400 Subject: [PATCH] fix swing sounds --- .../minecraft/entity/player/EntityPlayer.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/minecraft/entity/player/EntityPlayer.java b/src/main/java/net/minecraft/entity/player/EntityPlayer.java index 1a7278e..eeafc6d 100644 --- a/src/main/java/net/minecraft/entity/player/EntityPlayer.java +++ b/src/main/java/net/minecraft/entity/player/EntityPlayer.java @@ -1236,8 +1236,8 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS i = i + EnchantmentHelper.getKnockbackModifier(this); if (this.isSprinting() && flag) { - this.worldObj.playSound(this.posX, this.posY, this.posZ, "entity.player.attack.knockback", 1.0F, - 1.0F, false); + this.worldObj.playSoundAtEntity(this, "entity.player.attack.knockback", 1.0F, + 1.0F); ++i; flag1 = true; } @@ -1312,9 +1312,9 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS } } - this.worldObj.playSound(this.posX, this.posY, this.posZ, "entity.player.attack.sweep", + this.worldObj.playSoundAtEntity(this, "entity.player.attack.sweep", 1.0F, - 1.0F, false); + 1.0F); this.spawnSweepParticles(); } @@ -1328,21 +1328,21 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS } if (flag2) { - this.worldObj.playSound(this.posX, this.posY, this.posZ, "entity.player.attack.crit", + this.worldObj.playSoundAtEntity(this, "entity.player.attack.crit", 1.0F, - 1.0F, false); + 1.0F); this.onCriticalHit(targetEntity); } if (!flag2 && !flag3) { if (flag) { - this.worldObj.playSound(this.posX, this.posY, this.posZ, + this.worldObj.playSoundAtEntity(this, "entity.player.attack.strong", 1.0F, - 1.0F, false); + 1.0F); } else { - this.worldObj.playSound(this.posX, this.posY, this.posZ, + this.worldObj.playSoundAtEntity(this, "entity.player.attack.weak", 1.0F, - 1.0F, false); + 1.0F); } } @@ -1422,8 +1422,8 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS this.addExhaustion(0.3F); } else { - this.worldObj.playSound(this.posX, this.posY, this.posZ, "entity.player.attack.weak", 1.0F, - 1.0F, false); + this.worldObj.playSoundAtEntity(this, "entity.player.attack.weak", 1.0F, + 1.0F); if (flag4) { targetEntity.extinguish();