Fix message color formatting for PaperSpigot

This commit is contained in:
games647 2017-06-20 18:03:09 +02:00
parent 22c648b90a
commit 6eeb94a5c2
No known key found for this signature in database
GPG Key ID: BFC68C8708713A88
2 changed files with 7 additions and 3 deletions

View File

@ -8,7 +8,7 @@
<packaging>jar</packaging>
<name>ColorConsole</name>
<version>2.3</version>
<version>2.3.1</version>
<inceptionYear>2016</inceptionYear>
<url>http://dev.bukkit.org/bukkit-plugins/colorconsole/</url>
<description>

View File

@ -70,7 +70,12 @@ public class ColorConsoleBukkit extends JavaPlugin {
Appender terminalAppender = CommonLogInstaller.getTerminalAppender(TERMINAL_NAME);
oldLayout = terminalAppender.getLayout();
String logFormat = getConfig().getString("logFormat");
String logFormat = oldLayout.toString();
if (oldLayout.toString().contains("%minecraftFormatting")) {
logFormat.replace("%msg", "%minecraftFormatting{%msg}");
}
logFormat = "[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx";
if (getConfig().getBoolean("colorLoggingLevel")) {
logFormat = logFormat.replace("%level", "%highlight{%level}{"
+ "FATAL=" + getConfig().getString("FATAL") + ", "
@ -83,7 +88,6 @@ public class ColorConsoleBukkit extends JavaPlugin {
String dateStyle = getConfig().getString("dateStyle");
logFormat = logFormat.replaceFirst("(%d)\\{.{1,}\\}", "%style{$0}{" + dateStyle + "}");
try {
PatternLayout layout = CommonLogInstaller.createLayout(logFormat);
CommonLogInstaller.setLayout(layout, terminalAppender);