improve color stripping

This commit is contained in:
nikky 2018-08-06 17:38:58 +02:00
parent 8115bada4f
commit ac9066225d
2 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent
import cpw.mods.fml.common.event.FMLServerStartingEvent
import cpw.mods.fml.common.event.FMLServerStoppingEvent
import matterlink.bridge.command.IBridgeCommand
import matterlink.command.AuthCommand
import matterlink.command.MatterLinkCommand
import matterlink.command.MatterLinkCommandSender
import matterlink.config.BaseConfig
@ -50,6 +51,7 @@ class MatterLink : IMatterLink() {
fun serverStarting(event: FMLServerStartingEvent) {
logger.debug("Registering server commands")
event.registerServerCommand(MatterLinkCommand())
event.registerServerCommand(AuthCommand())
start()
}

View File

@ -44,7 +44,7 @@ fun String.lazyFormat(env: Map<String, () -> String?>): String {
val String.stripColorOut: String
get() =
if (cfg.outgoing.stripColors)
this.replace("§.?".toRegex(RegexOption.UNIX_LINES), "")
this.replace("[&§][0-9A-FK-OR]".toRegex(RegexOption.IGNORE_CASE), "")
else
this