kr.summitsystems.springbukkit.command.CommandContextImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-bukkit-command Show documentation
Show all versions of spring-bukkit-command Show documentation
Springframework based Bukkit plugin development kit.
The newest version!
package kr.summitsystems.springbukkit.command
import kr.summitsystems.springbukkit.core.util.extension.getLocale
import org.bukkit.command.CommandSender
internal class CommandContextImpl(
override val sender: T,
override val label: String,
private val registrableCommandMapping: RegistrableCommandMapping,
private val commandMappingRegistry: CommandMappingRegistry,
private val commandFeedbackSource: CommandFeedbackSource,
private val parameters: Map
) : CommandContext {
override fun sendUsage() {
sender.sendMessage(commandFeedbackSource.getUsageMessage(registrableCommandMapping, sender.getLocale()))
}
override fun sendUsageAll() {
commandMappingRegistry
.findAllByRoot(registrableCommandMapping.qualifier.split(".").first())
.forEach { mapping ->
sender.sendMessage(commandFeedbackSource.getUsageMessage(mapping, sender.getLocale()))
}
}
override fun getParameters(): Map {
return parameters
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy