From 85629d0c4a153d0df9e97f145851ee274d61b7d9 Mon Sep 17 00:00:00 2001 From: games647 Date: Sat, 1 Jul 2017 19:24:53 +0200 Subject: [PATCH] Depend only on the bungee api --- pom.xml | 12 +++------ .../bungee/ColorConsoleBungee.java | 25 ++++++++----------- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index acd4218..8da25d6 100644 --- a/pom.xml +++ b/pom.xml @@ -100,12 +100,6 @@ https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - bungee-repo - https://repo.extension.ws/content/repositories/snapshots/ - - sponge-repo @@ -124,9 +118,9 @@ - tc.oc - bungeecord-proxy - 1.11-SNAPSHOT + net.md-5 + bungeecord-api + 1.12-SNAPSHOT provided diff --git a/src/main/java/com/github/games647/colorconsole/bungee/ColorConsoleBungee.java b/src/main/java/com/github/games647/colorconsole/bungee/ColorConsoleBungee.java index ed651e4..76ca8fb 100644 --- a/src/main/java/com/github/games647/colorconsole/bungee/ColorConsoleBungee.java +++ b/src/main/java/com/github/games647/colorconsole/bungee/ColorConsoleBungee.java @@ -10,12 +10,11 @@ import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; -import net.md_5.bungee.BungeeCord; +import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.plugin.Plugin; import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; import net.md_5.bungee.config.YamlConfiguration; -import net.md_5.bungee.log.ColouredWriter; public class ColorConsoleBungee extends Plugin { @@ -40,16 +39,14 @@ public class ColorConsoleBungee extends Plugin { @Override public void onDisable() { //restore the old format - BungeeCord bungee = BungeeCord.getInstance(); + ProxyServer bungee = ProxyServer.getInstance(); Logger bungeeLogger = bungee.getLogger(); Handler[] handlers = bungeeLogger.getHandlers(); for (Handler handler : handlers) { - if (handler instanceof ColouredWriter) { - Formatter formatter = handler.getFormatter(); - if (formatter instanceof ColorLogFormatter) { - handler.setFormatter(((ColorLogFormatter) formatter).getOldFormatter()); - } + Formatter formatter = handler.getFormatter(); + if (formatter instanceof ColorLogFormatter) { + handler.setFormatter(((ColorLogFormatter) formatter).getOldFormatter()); } } } @@ -59,18 +56,16 @@ public class ColorConsoleBungee extends Plugin { } private void installLogFormat() { - BungeeCord bungee = BungeeCord.getInstance(); + ProxyServer bungee = ProxyServer.getInstance(); Logger bungeeLogger = bungee.getLogger(); Handler[] handlers = bungeeLogger.getHandlers(); for (Handler handler : handlers) { - if (handler instanceof ColouredWriter) { - Formatter oldFormatter = handler.getFormatter(); + Formatter oldFormatter = handler.getFormatter(); - ColorLogFormatter newFormatter = new ColorLogFormatter(this, oldFormatter); - newFormatter.initPluginColors(getConfiguration().getString("PLUGIN")); - handler.setFormatter(newFormatter); - } + ColorLogFormatter newFormatter = new ColorLogFormatter(this, oldFormatter); + newFormatter.initPluginColors(getConfiguration().getString("PLUGIN")); + handler.setFormatter(newFormatter); } }