improve color stripping
This commit is contained in:
parent
8115bada4f
commit
ac9066225d
|
@ -8,6 +8,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent
|
||||||
import cpw.mods.fml.common.event.FMLServerStartingEvent
|
import cpw.mods.fml.common.event.FMLServerStartingEvent
|
||||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent
|
import cpw.mods.fml.common.event.FMLServerStoppingEvent
|
||||||
import matterlink.bridge.command.IBridgeCommand
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
|
import matterlink.command.AuthCommand
|
||||||
import matterlink.command.MatterLinkCommand
|
import matterlink.command.MatterLinkCommand
|
||||||
import matterlink.command.MatterLinkCommandSender
|
import matterlink.command.MatterLinkCommandSender
|
||||||
import matterlink.config.BaseConfig
|
import matterlink.config.BaseConfig
|
||||||
|
@ -50,6 +51,7 @@ class MatterLink : IMatterLink() {
|
||||||
fun serverStarting(event: FMLServerStartingEvent) {
|
fun serverStarting(event: FMLServerStartingEvent) {
|
||||||
logger.debug("Registering server commands")
|
logger.debug("Registering server commands")
|
||||||
event.registerServerCommand(MatterLinkCommand())
|
event.registerServerCommand(MatterLinkCommand())
|
||||||
|
event.registerServerCommand(AuthCommand())
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ fun String.lazyFormat(env: Map<String, () -> String?>): String {
|
||||||
val String.stripColorOut: String
|
val String.stripColorOut: String
|
||||||
get() =
|
get() =
|
||||||
if (cfg.outgoing.stripColors)
|
if (cfg.outgoing.stripColors)
|
||||||
this.replace("§.?".toRegex(RegexOption.UNIX_LINES), "")
|
this.replace("[&§][0-9A-FK-OR]".toRegex(RegexOption.IGNORE_CASE), "")
|
||||||
else
|
else
|
||||||
this
|
this
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue