aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0700-Add-TameableDeathMessageEvent.patch
diff options
context:
space:
mode:
authorRiley Park <[email protected]>2024-05-15 17:06:59 -0700
committerGitHub <[email protected]>2024-05-15 17:06:59 -0700
commitf17519338bc589c045e0b32bfc37e048b23544d5 (patch)
treee50182ec698b4a9de8f366f485ee089b1901bbd9 /patches/server/0700-Add-TameableDeathMessageEvent.patch
parent3fc93581bb876e8149b2ca423375a98f5ca12d27 (diff)
downloadPaper-f17519338bc589c045e0b32bfc37e048b23544d5.tar.gz
Paper-f17519338bc589c045e0b32bfc37e048b23544d5.zip
Expose server build information (#10729)
* Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic <[email protected]> Co-authored-by: masmc05 <[email protected]>
Diffstat (limited to 'patches/server/0700-Add-TameableDeathMessageEvent.patch')
-rw-r--r--patches/server/0700-Add-TameableDeathMessageEvent.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/patches/server/0700-Add-TameableDeathMessageEvent.patch b/patches/server/0700-Add-TameableDeathMessageEvent.patch
new file mode 100644
index 0000000000..355d8192ca
--- /dev/null
+++ b/patches/server/0700-Add-TameableDeathMessageEvent.patch
@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Owen1212055 <[email protected]>
+Date: Mon, 21 Jun 2021 21:24:45 -0400
+Subject: [PATCH] Add TameableDeathMessageEvent
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+index 8c387df4d1e0b714edb07f177e85fe2ec4706b2a..ed2514de46d0939259ca4e45a6dc96d7c1dac20d 100644
+--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
++++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+@@ -196,7 +196,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
+ @Override
+ public void die(DamageSource damageSource) {
+ if (!this.level().isClientSide && this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
+- this.getOwner().sendSystemMessage(this.getCombatTracker().getDeathMessage());
++ // Paper start - Add TameableDeathMessageEvent
++ io.papermc.paper.event.entity.TameableDeathMessageEvent event = new io.papermc.paper.event.entity.TameableDeathMessageEvent((org.bukkit.entity.Tameable) getBukkitEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getCombatTracker().getDeathMessage()));
++ if (event.callEvent()) {
++ this.getOwner().sendSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.deathMessage()));
++ }
++ // Paper end - Add TameableDeathMessageEvent
+ }
+
+ super.die(damageSource);