9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0078-Broadcast-crit-animations-as-the-entity-being-critte.patch
2025-07-01 17:53:06 +08:00

40 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Sun, 25 Dec 2022 23:33:28 +0100
Subject: [PATCH] Broadcast crit animations as the entity being critted
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Send crit animations as the entity being critted"
By: PureGero <puregero@gmail.com>
As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 784a08d0aed30fd0362e408aaa5772003021c0ad..bbe123fd18fe97ae93bf562f32af73cdde722f70 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -2115,12 +2115,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@Override
public void crit(Entity entityHit) {
- this.level().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 4));
+ // Gale start - MultiPaper - broadcast crit animations as the entity being critted
+ var level = this.level();
+ level.getChunkSource().broadcastAndSend(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? entityHit : this, new ClientboundAnimatePacket(entityHit, 4));
+ // Gale end - MultiPaper - broadcast crit animations as the entity being critte
}
@Override
public void magicCrit(Entity entityHit) {
- this.level().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 5));
+ // Gale start - MultiPaper - broadcast crit animations as the entity being critted
+ var level = this.level();
+ level.getChunkSource().broadcastAndSend(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? entityHit : this, new ClientboundAnimatePacket(entityHit, 5));
+ // Gale end - MultiPaper - broadcast crit animations as the entity being critted
}
@Override