9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-19 14:59:29 +00:00
Files
Gale/patches/server/0103-Broadcast-crit-animations-as-the-entity-being-critte.patch
2024-06-16 07:45:50 +08:00

52 lines
3.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/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 79b49aec7c5c80948b8f1c77ca6e48049dae174e..a70317f5b5cf0fc5ab80782e6f22e76d3716b749 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2148,12 +2148,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
@Override
public void crit(Entity target) {
- this.serverLevel().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(target, 4));
+ // Gale start - MultiPaper - broadcast crit animations as the entity being critted
+ var level = this.serverLevel();
+ level.getChunkSource().broadcastAndSend(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? target : this, new ClientboundAnimatePacket(target, 4));
+ // Gale end - MultiPaper - broadcast crit animations as the entity being critted
}
@Override
public void magicCrit(Entity target) {
- this.serverLevel().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(target, 5));
+ // Gale start - MultiPaper - broadcast crit animations as the entity being critted
+ var level = this.serverLevel();
+ level.getChunkSource().broadcastAndSend(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? target : this, new ClientboundAnimatePacket(target, 5));
+ // Gale end - MultiPaper - broadcast crit animations as the entity being critted
}
@Override
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
index 269393f8b56ed5b5e37879c23fe1e28b5a82ebe0..687549714e928ea74be154c84d04ffd453dc324d 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
@@ -106,6 +106,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
public Fixes fixes;
public class Fixes extends ConfigurationPart {
+ public boolean broadcastCritAnimationsAsTheEntityBeingCritted = false; // Gale - MultiPaper - broadcast crit animations as the entity being critted
public boolean keepMooshroomRotationAfterShearing = true; // Gale - Purpur - fix cow rotation when shearing mooshroom
// Gale start - Purpur - fix MC-238526