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 b2a15c986c7500a0ce227a54cb61ec3f5378f6f3..3ea9b877a563d2b7894cf59799d654ebaa1f9819 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 ce5274e4093962a839f05063ffb7e2ab6244343b..0f276a6a3521e97afbb20ea5421a16180f626d45 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java @@ -60,6 +60,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 {