2022-03-20 01:50:33 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
|
|
|
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
|
2024-04-24 22:05:42 +02:00
|
|
|
index 8c387df4d1e0b714edb07f177e85fe2ec4706b2a..ed2514de46d0939259ca4e45a6dc96d7c1dac20d 100644
|
2022-03-20 01:50:33 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
2024-04-24 22:05:42 +02:00
|
|
|
@@ -196,7 +196,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
|
2022-03-20 01:50:33 +01:00
|
|
|
@Override
|
2022-06-08 15:36:56 +02:00
|
|
|
public void die(DamageSource damageSource) {
|
2023-06-08 10:08:08 +02:00
|
|
|
if (!this.level().isClientSide && this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
|
2022-06-08 15:36:56 +02:00
|
|
|
- this.getOwner().sendSystemMessage(this.getCombatTracker().getDeathMessage());
|
2024-01-18 18:52:00 +01:00
|
|
|
+ // Paper start - Add TameableDeathMessageEvent
|
2022-03-20 01:50:33 +01:00
|
|
|
+ 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()) {
|
2022-06-08 15:36:56 +02:00
|
|
|
+ this.getOwner().sendSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.deathMessage()));
|
|
|
|
+ }
|
2024-01-18 18:52:00 +01:00
|
|
|
+ // Paper end - Add TameableDeathMessageEvent
|
2022-03-20 01:50:33 +01:00
|
|
|
}
|
|
|
|
|
2022-06-08 15:36:56 +02:00
|
|
|
super.die(damageSource);
|