Should work now

This commit is contained in:
DaMachinator 2018-02-15 11:43:11 -05:00
parent 3a9889ead7
commit f36e77ed31
2 changed files with 12 additions and 2 deletions

View File

@ -44,4 +44,12 @@ object BridgeCommandRegistry {
val commandList: String val commandList: String
get() = commandMap.keys.joinToString(separator = ", ") get() = commandMap.keys.joinToString(separator = ", ")
fun reloadCommands() {
commandMap.clear()
registerAll(HelpCommand,PlayerListCommand,UptimeCommand)
for (key : String in cfg!!.command.commandMapping.keys) {
register(PassthroughCommand(key, cfg!!.command.commandMapping.get(key)!!))
}
}
} }

View File

@ -1,9 +1,11 @@
package matterlink.bridge.command package matterlink.bridge.command
class PassthroughCommand(override val name: String) : IBridgeCommand { import matterlink.instance
class PassthroughCommand(override val name: String, val cmd: String) : IBridgeCommand {
override fun call(args: String): Boolean { override fun call(args: String): Boolean {
return true return instance.commandSender.execute("$name $args",100)
} }
override val help: String = "No help available for this command." override val help: String = "No help available for this command."