9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-26 02:19:23 +00:00

修复其他玩家能听到hit声音

This commit is contained in:
XiaoMoMi
2025-04-10 03:14:36 +08:00
parent a39e5980ca
commit af8d0a6fc3

View File

@@ -425,7 +425,7 @@ public class BukkitServerPlayer extends Player {
Object soundType = Reflections.field$BlockBehaviour$soundType.get(blockOwner);
Object soundEvent = Reflections.field$SoundType$hitSound.get(soundType);
Object soundId = Reflections.field$SoundEvent$location.get(soundEvent);
level().playBlockSound(new Vec3d(this.destroyPos.x(), this.destroyPos.y(), this.destroyPos.z()), Key.of(soundId.toString()), 0.5F, 0.5F);
player.playSound(location, soundId.toString(), SoundCategory.BLOCKS, 0.5F, 0.5F);
this.lastHitBlockTime = currentTick;
}