9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-29 20:09:17 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0079-Broadcast-crit-animations-as-the-entity-being-critte.patch
2025-04-02 22:16:16 -04:00

40 lines
2.2 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 62e49f844c477c92894d77b469c1537b05fa7677..ccbfb6ad7de454a622c55395b8876ac8cef0d5a8 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -2080,12 +2080,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@Override
public void crit(Entity entityHit) {
- this.serverLevel().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 4));
+ // Gale start - MultiPaper - broadcast crit animations as the entity being critted
+ var level = this.serverLevel();
+ level.getChunkSource().broadcastAndSend(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? entityHit : this, new ClientboundAnimatePacket(entityHit, 4));
+ // Gale end - MultiPaper - broadcast crit animations as the entity being critted
}
@Override
public void magicCrit(Entity entityHit) {
- this.serverLevel().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 5));
+ // Gale start - MultiPaper - broadcast crit animations as the entity being critted
+ var level = this.serverLevel();
+ 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