From 9df4fae2dcbb49ab3cfe1aabf5a331e7b61ad365 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 2 Apr 2022 14:36:14 +0100 Subject: [PATCH] Fixed colors in console on new versions of paper --- .../main/java/com/willfp/eco/core/EcoPlugin.java | 6 +++--- .../com/willfp/eco/internal/logging/EcoLogger.kt | 15 ++++----------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java b/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java index 00de9ef3..9ae80a51 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java +++ b/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java @@ -353,9 +353,9 @@ public abstract class EcoPlugin extends JavaPlugin implements PluginLike { DefaultArtifactVersion mostRecentVersion = new DefaultArtifactVersion(version); if (!(currentVersion.compareTo(mostRecentVersion) > 0 || currentVersion.equals(mostRecentVersion))) { this.outdated = true; - this.getLogger().warning("&c" + this.getName() + " is out of date! (Version " + this.getDescription().getVersion() + ")"); - this.getLogger().warning("&cThe newest version is &f" + version); - this.getLogger().warning("&cDownload the new version!"); + this.getLogger().warning(this.getName() + " is out of date! (Version " + this.getDescription().getVersion() + ")"); + this.getLogger().warning("The newest version is &f" + version); + this.getLogger().warning("Download the new version!"); } }); } diff --git a/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/logging/EcoLogger.kt b/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/logging/EcoLogger.kt index 1586eedc..ae435cf1 100644 --- a/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/logging/EcoLogger.kt +++ b/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/logging/EcoLogger.kt @@ -2,24 +2,17 @@ package com.willfp.eco.internal.logging import com.willfp.eco.core.EcoPlugin import com.willfp.eco.util.StringUtils +import org.bukkit.Bukkit import java.util.logging.Level import java.util.logging.Logger -class EcoLogger(plugin: EcoPlugin) : Logger(plugin.name, null as String?) { +class EcoLogger(private val plugin: EcoPlugin) : Logger(plugin.name, null as String?) { override fun info(msg: String) { - super.info(StringUtils.format(msg)) - } - - override fun warning(msg: String) { - super.warning(StringUtils.format(msg)) - } - - override fun severe(msg: String) { - super.severe(StringUtils.format(msg)) + Bukkit.getConsoleSender().sendMessage("[${plugin.name}] ${StringUtils.format(msg)}") } init { parent = plugin.server.logger this.level = Level.ALL } -} \ No newline at end of file +}