9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-21 15:59:26 +00:00
Files
SakuraMC/patches/server/0070-Old-combat-sounds-and-particle-effects.patch
Samsuik 9a7b139975 Updated Upstream (1.21.4 Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@c0a3d51 Start update, apply API patches
PaperMC/Paper@172c7dc Work
PaperMC/Paper@ab9a3db More work
PaperMC/Paper@c60e47f More more work
PaperMC/Paper@bd55e32 More more more work
PaperMC/Paper@5265287 More more more more work
PaperMC/Paper@4601dc9 Some fixes, start updating CustomModelData API
PaperMC/Paper@2331dad Even more work
PaperMC/Paper@dc74c6f moonrise
PaperMC/Paper@d7d2f88 Apply remaining patches, fix API
PaperMC/Paper@f863bb7 Update generated classes
PaperMC/Paper@71a4ef8 Set java launcher for api generate task
PaperMC/Paper@b8aeecb Compilation fixes
PaperMC/Paper@6c35392 Tests succeed (by removing one)
PaperMC/Paper@b0603da Fix jd gson version, move back mc util diff
PaperMC/Paper@e2dd1d5 Add back post_teleport chunk ticket
PaperMC/Paper@7045b2a Update DataConverter
PaperMC/Paper@65633e3 Update Moonrise
2024-12-04 00:31:13 +00:00

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 23c66dc1bba4f4242c848121f70879bb94f0fb4b..e0cb3a9d0cd27a98e302816bc736db291a32cf4f 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1461,7 +1461,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);
@@ -1869,6 +1869,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()));