From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Fri, 25 Nov 2022 15:03:50 +0100 Subject: [PATCH] Do not log legacy Material initialization License: MIT (https://opensource.org/licenses/MIT) Gale - https://galemc.org 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) * Purpur copyright * MIT License Copyright (c) 2019-2022 PurpurMC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java index 6a083e269b828ef53f943cae56b029f2e0021ef1..8244810e9ac8aed6248cca71af3be31292cd99aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java @@ -31,6 +31,7 @@ import org.bukkit.Material; import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.entity.EntityType; import org.bukkit.material.MaterialData; +import org.galemc.gale.configuration.GaleGlobalConfiguration; /** * This class may seem unnecessarily slow and complicated/repetitive however it @@ -255,7 +256,7 @@ public final class CraftLegacy { } static { - System.err.println("Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!"); + if (GaleGlobalConfiguration.get().logToConsole.legacyMaterialInitialization) System.err.println("Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!"); // Gale - Purpur - do not log legacy Material initialization if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDebugging()) { new Exception().printStackTrace(); } diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java index efb7e3198ab4f327ec6816af143350460f8bd900..933c81e539e2da1901c9b7abf4f0c616d62f4cd6 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java @@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes + public boolean legacyMaterialInitialization = false; // Gale - Purpur - do not log legacy Material initialization public Chat chat; public class Chat extends ConfigurationPart {