Improve entity killer logging

Fixes #622
This commit is contained in:
Brokkonaut
2021-04-29 20:37:38 +02:00
parent 2d9456409c
commit 8e3f5aca56
2 changed files with 5 additions and 0 deletions

View File

@ -170,6 +170,9 @@ public class AdvancedEntityLogging extends LoggingListener {
actor = Actor.actorFromEntity(damager); actor = Actor.actorFromEntity(damager);
} }
} }
if (actor == null && entity.getKiller() != null) {
actor = Actor.actorFromEntity(entity.getKiller());
}
if (actor == null) { if (actor == null) {
actor = new Actor(lastDamage == null ? "UNKNOWN" : lastDamage.getCause().toString()); actor = new Actor(lastDamage == null ? "UNKNOWN" : lastDamage.getCause().toString());
} }

View File

@ -36,6 +36,8 @@ public class KillLogging extends LoggingListener {
return; return;
} }
consumer.queueKill(killer, victim); consumer.queueKill(killer, victim);
} else if (deathEvent.getEntity().getKiller() != null) {
consumer.queueKill(deathEvent.getEntity().getKiller(), victim);
} else if (logEnvironmentalKills) { } else if (logEnvironmentalKills) {
if (logKillsLevel == LogKillsLevel.PLAYERS && !(victim instanceof Player)) { if (logKillsLevel == LogKillsLevel.PLAYERS && !(victim instanceof Player)) {
return; return;