mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-22 16:29:16 +00:00
28 lines
2.2 KiB
Diff
28 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <kfian294ma4@gmail.com>
|
|
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 a5417a76897395129baaf0eea8ed0a0cd60d9335..2c88d4956894e19e773f569679396d5c6058781b 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
@@ -1496,7 +1496,7 @@ public abstract class Player extends LivingEntity {
|
|
float f8 = f4 - ((LivingEntity) target).getHealth();
|
|
|
|
this.awardStat(Stats.DAMAGE_DEALT, Math.round(f8 * 10.0F));
|
|
- if (this.level() instanceof ServerLevel && f8 > 2.0F) {
|
|
+ if (this.level() instanceof ServerLevel && f8 > 2.0F && !this.level().sakuraConfig().players.combat.oldSoundsAndParticleEffects) { // Sakura - old combat sounds and particles
|
|
int i = (int) ((double) f8 * 0.5D);
|
|
|
|
((ServerLevel) this.level()).sendParticles(ParticleTypes.DAMAGE_INDICATOR, target.getX(), target.getY(0.5D), target.getZ(), i, 0.1D, 0.0D, 0.1D, 0.2D);
|
|
@@ -1915,6 +1915,7 @@ public abstract class Player extends LivingEntity {
|
|
}
|
|
// Paper start - send while respecting visibility
|
|
private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) {
|
|
+ if (fromEntity.level().sakuraConfig().players.combat.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 itself
|
|
if (fromEntity instanceof ServerPlayer serverPlayer) {
|
|
serverPlayer.connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong()));
|