From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Samsuik Date: Tue, 11 Jun 2024 13:37:51 +0100 Subject: [PATCH] Old combat sounds and particle effects diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java index 180d561ecc88f2a190f1eb9dbe3cfe426d393be9..618d9d066defa6fe941681e089ad7539f1738464 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -1417,7 +1417,7 @@ public abstract class Player extends LivingEntity { // CraftBukkit end } - if (this.level instanceof ServerLevel && f5 > 2.0F) { + if (this.level instanceof ServerLevel && f5 > 2.0F && !this.level.sakuraConfig.oldSoundsAndParticleEffects) { // Sakura - old combat sounds and particles int k = (int) ((double) f5 * 0.5D); ((ServerLevel) this.level).sendParticles(ParticleTypes.DAMAGE_INDICATOR, target.getX(), target.getY(0.5D), target.getZ(), k, 0.1D, 0.0D, 0.1D, 0.2D); @@ -1896,6 +1896,7 @@ public abstract class Player extends LivingEntity { } // Paper start - send SoundEffect to everyone who can see fromEntity private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { + if (fromEntity.level.sakuraConfig.oldSoundsAndParticleEffects) return; // Sakura - old combat sounds and particles fromEntity.level.playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself if (fromEntity instanceof ServerPlayer) { ((ServerPlayer) fromEntity).connection.send(new ClientboundSoundPacket(soundEffect, soundCategory, x, y, z, volume, pitch));