2021-07-07 15:15:17 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Malfrador <malfrador@gmail.com>
Date: Wed, 7 Jul 2021 12:48:50 +0200
Subject: [PATCH] Config option for named entity death logging
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
2021-07-26 01:11:44 +02:00
index 6f51eb31a06922a9d0c3697755c1bfe8baf6cfe2..95d8cf449bf0439fddaf319246fef51e1570b68e 100644
2021-07-07 15:15:17 +02:00
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
2021-07-26 01:11:44 +02:00
@@ -501,6 +501,11 @@ public class PaperConfig {
2021-07-07 15:15:17 +02:00
deobfuscateStacktraces = getBoolean("settings.loggers.deobfuscate-stacktraces", deobfuscateStacktraces);
}
+ public static boolean logNamedEntityDeaths = true;
+ private static void namedEntityDeaths() {
+ logNamedEntityDeaths = getBoolean("settings.log-named-entity-deaths", logNamedEntityDeaths);
+ }
+
public static int itemValidationDisplayNameLength = 8192;
public static int itemValidationLocNameLength = 8192;
public static int itemValidationLoreLineLength = 8192;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
2021-07-09 16:08:42 +02:00
index 442d0df276defbbea1b4282b99460ab463c2e5e0..027898e97667081840562547653d4adaeae01dda 100644
2021-07-07 15:15:17 +02:00
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1634,7 +1634,7 @@ public abstract class LivingEntity extends Entity {
this.stopSleeping();
}
- if (!this.level.isClientSide && this.hasCustomName()) {
+ if (com.destroystokyo.paper.PaperConfig.logNamedEntityDeaths && !this.level.isClientSide && this.hasCustomName()) { // Paper - add setting for entity death logging
LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString());
}