mirror of
https://github.com/games647/ColorConsole.git
synced 2024-11-23 19:05:19 +01:00
Depend only on the bungee api
This commit is contained in:
parent
9100b697da
commit
85629d0c4a
12
pom.xml
12
pom.xml
@ -100,12 +100,6 @@
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
|
||||
<!--BungeeCord with also the part outside the API-->
|
||||
<repository>
|
||||
<id>bungee-repo</id>
|
||||
<url>https://repo.extension.ws/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
|
||||
<!--Sponge-API-->
|
||||
<repository>
|
||||
<id>sponge-repo</id>
|
||||
@ -124,9 +118,9 @@
|
||||
|
||||
<!--Normally should you move this to a extra module, but this project is currently so small-->
|
||||
<dependency>
|
||||
<groupId>tc.oc</groupId>
|
||||
<artifactId>bungeecord-proxy</artifactId>
|
||||
<version>1.11-SNAPSHOT</version>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.12-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user