From 166feefc023c7e153072a18e6b49982d7246fb0a Mon Sep 17 00:00:00 2001 From: OneLemonyBoi <50998649+OneLemonyBoi@users.noreply.github.com> Date: Mon, 27 Sep 2021 12:59:06 -0700 Subject: [PATCH] Fix pet death message being sent when pet death event is canceled. (#8110) --- .../world/entity/TamableAnimal.java.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch diff --git a/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch b/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch new file mode 100644 index 0000000000..d90ef5ad2f --- /dev/null +++ b/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch @@ -0,0 +1,18 @@ +--- a/net/minecraft/world/entity/TamableAnimal.java ++++ b/net/minecraft/world/entity/TamableAnimal.java +@@ -197,11 +_,14 @@ + } + + public void m_6667_(DamageSource p_21809_) { ++ // FORGE: Super moved to top so that death message would be cancelled properly ++ super.m_6667_(p_21809_); ++ ++ if (this.f_20890_) + if (!this.f_19853_.f_46443_ && this.f_19853_.m_46469_().m_46207_(GameRules.f_46142_) && this.m_142480_() instanceof ServerPlayer) { + this.m_142480_().m_6352_(this.m_21231_().m_19293_(), Util.f_137441_); + } + +- super.m_6667_(p_21809_); + } + + public boolean m_21827_() {