Fix pet death message being sent when pet death event is canceled. (#8110)

This commit is contained in:
OneLemonyBoi authored and GitHub committed 2021-09-27 12:59:06 -07:00
1 parent cd67762bee
commit 166feefc02
1 file changed
+18
@@ -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_() {