Move log message for named entity deaths into correct location (#6105)

This commit is contained in:
Jason Penilla 2021-07-07 03:04:34 -07:00
parent 8a664e6bbc
commit 0b90741c3f

View file

@ -109,15 +109,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
entityliving.awardKillScore(this, this.deathScore, source); entityliving.awardKillScore(this, this.deathScore, source);
} }
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
if (this.isSleeping()) {
this.stopSleeping();
}
+ */ // Paper - move down to make death event cancellable - this is the runKillTrigger below
+
if (!this.level.isClientSide && this.hasCustomName()) { if (!this.level.isClientSide && this.hasCustomName()) {
LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString());
} }
+ */ // Paper - move down to make death event cancellable - this is the runKillTrigger below
this.dead = true; this.dead = true;
- this.getCombatTracker().recheckStatus(); - this.getCombatTracker().recheckStatus();
@ -140,6 +135,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.stopSleeping(); + this.stopSleeping();
+ } + }
+ +
+ if (!this.level.isClientSide && this.hasCustomName()) {
+ LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString());
+ }
+
+ this.getCombatTracker().recheckStatus(); + this.getCombatTracker().recheckStatus();
+ if (entity != null) { + if (entity != null) {
+ entity.killed((ServerLevel) this.level, this); + entity.killed((ServerLevel) this.level, this);