From 5d649593304c364cf2ff7c064bee4f09c66b8551 Mon Sep 17 00:00:00 2001 From: MartijnMuijsers Date: Fri, 25 Nov 2022 13:24:16 +0100 Subject: [PATCH] Do not log ignored advancements --- README.md | 2 +- ...0042-Do-not-log-ignored-advancements.patch | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 patches/server/0042-Do-not-log-ignored-advancements.patch diff --git a/README.md b/README.md index 1d776be..215274a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ In order to distribute and use this server software, you need a Paperclip file: This fork would not exist without the years-long work of all the contributors to the [Paper](https://github.com/PaperMC/Paper) and [Spigot](https://www.spigotmc.org/) projects, including the dedication of their community to stability and trust among all users. Over the years, many forks of Paper have appeared, including some that contain changes that are too minor to be worth inclusion and maintaining by the Paper project. -We gratefully include various tested and carefully individually reviewed changes from Paper forks, including [Airplane](https://github.com/TECHNOVE/Airplane), [Mirai](https://github.com/etil2jz/Mirai), [JettPack](https://gitlab.com/Titaniumtown/JettPack), [Patina](https://github.com/PatinaMC/Patina) and [EmpireCraft](https://github.com/starlis/empirecraft). +We gratefully include various tested and carefully individually reviewed changes from Paper forks, including [Airplane](https://github.com/TECHNOVE/Airplane), [Mirai](https://github.com/etil2jz/Mirai), [Purpur](https://github.com/PurpurMC/Purpur), [JettPack](https://gitlab.com/Titaniumtown/JettPack), [Patina](https://github.com/PatinaMC/Patina) and [EmpireCraft](https://github.com/starlis/empirecraft). We would also like to thank our friends at [MultiPaper](https://github.com/MultiPaper/MultiPaper) and MCMT ([Fabric](https://github.com/himekifee/MCMTFabric), [Forge](https://github.com/jediminer543/JMT-MCMT)) for their shared knowledge and hard work towards a common goal. ## License diff --git a/patches/server/0042-Do-not-log-ignored-advancements.patch b/patches/server/0042-Do-not-log-ignored-advancements.patch new file mode 100644 index 0000000..d7b7f60 --- /dev/null +++ b/patches/server/0042-Do-not-log-ignored-advancements.patch @@ -0,0 +1,46 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MartijnMuijsers +Date: Fri, 25 Nov 2022 13:18:54 +0100 +Subject: [PATCH] Do not log ignored advancements + +License: MIT (https://opensource.org/licenses/MIT) + +This patch is based on the following patch: +"Logger settings (suppressing pointless logs)" +By: William Blake Galbreath +As part of: Purpur (https://github.com/PurpurMC/Purpur) +Licensed under: MIT (https://opensource.org/licenses/MIT) + +diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java +index a0c19503aabab5378d672a30163d35a5ba05b6c1..5ba0a756d45350dcda3caa5518c9a47a4de06f14 100644 +--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java ++++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java +@@ -47,6 +47,7 @@ import net.minecraft.server.level.ServerPlayer; + import net.minecraft.server.players.PlayerList; + import net.minecraft.util.datafix.DataFixTypes; + import net.minecraft.world.level.GameRules; ++import org.galemc.gale.configuration.GaleGlobalConfiguration; + import org.slf4j.Logger; + + public class PlayerAdvancements { +@@ -183,7 +184,7 @@ public class PlayerAdvancements { + if (advancement == null) { + // CraftBukkit start + if (entry.getKey().getNamespace().equals("minecraft")) { +- PlayerAdvancements.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.file); ++ if (GaleGlobalConfiguration.get().logToConsole.ignoredAdvancements) PlayerAdvancements.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.file); // Gale - Purpur - do not log ignored advancements + } + // CraftBukkit end + } else { +diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +index f292156b411b4c0f5db8fa15c92df395acb6e901..ae00ec83b9ba545f56d606a5c9802aab97fdefcb 100644 +--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java ++++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +@@ -57,6 +57,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { + public class LogToConsole extends ConfigurationPart { + + public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics ++ public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements + + public Chat chat; + public class Chat extends ConfigurationPart {