boah rein in die futterluke

This commit is contained in:
Jannik Reimers 2024-06-13 10:03:53 +02:00
parent 99f3eef4f8
commit 7d05c16fe1
3 changed files with 4 additions and 6 deletions

View File

@ -68,8 +68,4 @@ class Platinum : JavaPlugin() {
private fun registerCommands() {
}
private fun String.cmd() = instance.getCommand(this) ?: throw NullPointerException("Command '$name' not found!")
private infix fun PluginCommand.complete(with: TabCompleter) { this.tabCompleter = with }
private infix fun PluginCommand.execs(thing: CommandExecutor) = this.also { setExecutor(thing) }
}

View File

@ -7,6 +7,7 @@ import io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEven
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents
import moe.jansel.platinum.commands.PlatinumCommand
@Suppress("UnstableApiUsage")
class PlatinumBootstrap : PluginBootstrap {
override fun bootstrap(context: BootstrapContext) {
val manager = context.lifecycleManager

View File

@ -3,11 +3,12 @@ package moe.jansel.platinum.commands
import io.papermc.paper.command.brigadier.BasicCommand
import io.papermc.paper.command.brigadier.CommandSourceStack
@Suppress("UnstableApiUsage")
class PlatinumCommand: BasicCommand {
override fun execute(stack: CommandSourceStack, args: Array<out String>?) {
if (args?.size == 1 && args[0].lowercase() == "start") {
stack.getSender().sendRichMessage("<rainbow>Fun activated!");
stack.sender.sendRichMessage("<rainbow>Fun activated!");
}
}
}