mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
58 lines
3.2 KiB
Diff
58 lines
3.2 KiB
Diff
From 0bc10c468cdf8d88d2569bd702d5e4827d4ec82e Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Fri, 10 May 2019 19:17:36 -0500
|
|
Subject: [PATCH] Add config to suppress specific log outputs
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/GenericAttributes.java | 1 +
|
|
src/main/java/net/minecraft/server/WorldServer.java | 2 +-
|
|
src/main/java/net/pl3x/purpur/PurpurConfig.java | 7 +++++++
|
|
3 files changed, 9 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/GenericAttributes.java b/src/main/java/net/minecraft/server/GenericAttributes.java
|
|
index 908f11f98..20c3b37d3 100644
|
|
--- a/src/main/java/net/minecraft/server/GenericAttributes.java
|
|
+++ b/src/main/java/net/minecraft/server/GenericAttributes.java
|
|
@@ -79,6 +79,7 @@ public class GenericAttributes {
|
|
AttributeInstance attributeinstance = attributemapbase.a(nbttagcompound.getString("Name"));
|
|
|
|
if (attributeinstance == null) {
|
|
+ if (net.pl3x.purpur.PurpurConfig.showUnknownAttributeWarnings) // Purpur
|
|
GenericAttributes.LOGGER.warn("Ignoring unknown attribute '{}'", nbttagcompound.getString("Name"));
|
|
} else {
|
|
a(attributeinstance, nbttagcompound);
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
|
index 3ed12672e..d82102bd8 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -985,7 +985,7 @@ public class WorldServer extends World {
|
|
return false;
|
|
}
|
|
|
|
- if (DEBUG_ENTITIES && entity.world.paperConfig.duplicateUUIDMode != PaperWorldConfig.DuplicateUUIDMode.NOTHING) {
|
|
+ if (net.pl3x.purpur.PurpurConfig.showDuplicateEntityUUIDErrors && DEBUG_ENTITIES && entity.world.paperConfig.duplicateUUIDMode != PaperWorldConfig.DuplicateUUIDMode.NOTHING) { // Purpur
|
|
WorldServer.LOGGER.error("Keeping entity {} that already exists with UUID {}", EntityTypes.getName(entity1.getEntityType()), entity.getUniqueID().toString()); // CraftBukkit // paper
|
|
WorldServer.LOGGER.error("Deleting duplicate entity {}", entity); // CraftBukkit // paper
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index 8f3367ae1..d552076b3 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -103,6 +103,13 @@ public class PurpurConfig {
|
|
return config.getString(path, config.getString(path));
|
|
}
|
|
|
|
+ public static boolean showDuplicateEntityUUIDErrors = true;
|
|
+ public static boolean showUnknownAttributeWarnings = true;
|
|
+ private static void loggerSettings() {
|
|
+ showDuplicateEntityUUIDErrors = getBoolean("settings.logger.show-duplicate-entity-uuid-errors", showDuplicateEntityUUIDErrors);
|
|
+ showUnknownAttributeWarnings = getBoolean("settings.logger.show-unknown-attribute-warnings", showUnknownAttributeWarnings);
|
|
+ }
|
|
+
|
|
public static int feedMushroomsToCows = 5;
|
|
private static void cowsSettings() {
|
|
feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
|
--
|
|
2.20.1
|
|
|