blob: 0b49a9aff36321875bbc3513f2081b6b32338e9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package moe.nea.ledger
import moe.nea.ledger.utils.Inject
import net.minecraft.command.CommandBase
import net.minecraft.command.ICommandSender
class LogChatCommand : CommandBase() {
@Inject
lateinit var logger: LedgerLogger
override fun getCommandName(): String {
return "ledgerlogchat"
}
override fun canCommandSenderUseCommand(sender: ICommandSender?): Boolean {
return true
}
override fun getCommandUsage(sender: ICommandSender?): String {
return ""
}
override fun processCommand(sender: ICommandSender?, args: Array<out String>?) {
logger.shouldLog = !logger.shouldLog
logger.printOut("§eLedger logging toggled " + (if (logger.shouldLog) "§aon" else "§coff") + "§e.")
}
}
|