From 7d05c16fe1d6a6e971c10e3cb80933e40b33a502 Mon Sep 17 00:00:00 2001 From: Jannik Reimers Date: Thu, 13 Jun 2024 10:03:53 +0200 Subject: [PATCH] boah rein in die futterluke --- src/main/kotlin/moe/jansel/platinum/Platinum.kt | 4 ---- src/main/kotlin/moe/jansel/platinum/PlatinumBootstrap.kt | 1 + .../kotlin/moe/jansel/platinum/commands/PlatinumCommand.kt | 5 +++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/moe/jansel/platinum/Platinum.kt b/src/main/kotlin/moe/jansel/platinum/Platinum.kt index 531232b..914c90a 100644 --- a/src/main/kotlin/moe/jansel/platinum/Platinum.kt +++ b/src/main/kotlin/moe/jansel/platinum/Platinum.kt @@ -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) } } diff --git a/src/main/kotlin/moe/jansel/platinum/PlatinumBootstrap.kt b/src/main/kotlin/moe/jansel/platinum/PlatinumBootstrap.kt index b1d7b1b..a3caf64 100644 --- a/src/main/kotlin/moe/jansel/platinum/PlatinumBootstrap.kt +++ b/src/main/kotlin/moe/jansel/platinum/PlatinumBootstrap.kt @@ -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 diff --git a/src/main/kotlin/moe/jansel/platinum/commands/PlatinumCommand.kt b/src/main/kotlin/moe/jansel/platinum/commands/PlatinumCommand.kt index 71374d7..b2a1319 100644 --- a/src/main/kotlin/moe/jansel/platinum/commands/PlatinumCommand.kt +++ b/src/main/kotlin/moe/jansel/platinum/commands/PlatinumCommand.kt @@ -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?) { if (args?.size == 1 && args[0].lowercase() == "start") { - stack.getSender().sendRichMessage("Fun activated!"); + stack.sender.sendRichMessage("Fun activated!"); } } - + } \ No newline at end of file