summaryrefslogtreecommitdiff
path: root/src/main/kotlin/commands/BrigadierPatchbay.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-09-24 16:41:49 +0200
committerLinnea Gräf <nea@nea.moe>2024-09-24 16:41:49 +0200
commitaa1238430bd0f103f040ed31baadc029bb09529e (patch)
tree05aa9d4f6a1c35166003dc8e306dd2c40a818945 /src/main/kotlin/commands/BrigadierPatchbay.kt
parentfb40ab45f0b4979420bae066da2244f4fdd52db8 (diff)
downloadultra-notifier-aa1238430bd0f103f040ed31baadc029bb09529e.tar.gz
ultra-notifier-aa1238430bd0f103f040ed31baadc029bb09529e.tar.bz2
ultra-notifier-aa1238430bd0f103f040ed31baadc029bb09529e.zip
snapshot
Diffstat (limited to 'src/main/kotlin/commands/BrigadierPatchbay.kt')
-rw-r--r--src/main/kotlin/commands/BrigadierPatchbay.kt17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/kotlin/commands/BrigadierPatchbay.kt b/src/main/kotlin/commands/BrigadierPatchbay.kt
index a6c9f6a..424224b 100644
--- a/src/main/kotlin/commands/BrigadierPatchbay.kt
+++ b/src/main/kotlin/commands/BrigadierPatchbay.kt
@@ -8,6 +8,7 @@ package moe.nea.ultranotifier.commands
//$$import moe.nea.ultranotifier.event.RegistrationFinishedEvent
//$$import moe.nea.ultranotifier.event.UltraNotifierEvents
//$$import moe.nea.ultranotifier.event.UltraSubscribe
+//$$import moe.nea.ultranotifier.event.SubscriptionTarget
//$$import moe.nea.ultranotifier.mixin.AccessorCommandHandler
//$$import net.minecraft.command.CommandBase
//$$import net.minecraft.command.CommandHandler
@@ -30,9 +31,15 @@ package moe.nea.ultranotifier.commands
//$$ val dispatcher: CommandDispatcher<UltraCommandSource>,
//$$ val node: CommandNode<UltraCommandSource>
//$$) : CommandBase() {
-//$$ override fun checkPermission(server: MinecraftServer, sender: ICommandSender): Boolean {
+//#if MC >= 1.12
+//$$ override fun checkPermission(server: MinecraftServer, sender: ICommandSender): Boolean {
//$$ return true
//$$ }
+//#else
+//$$ override fun canCommandSenderUseCommand(sender: ICommandSender): Boolean {
+//$$ return true
+//$$ }
+//#endif
//$$
//$$ override fun getName(): String {
//$$ return node.name
@@ -43,7 +50,13 @@ package moe.nea.ultranotifier.commands
//$$ }
//$$
//$$ private fun getCommandLineText(args: Array<out String>) = "${node.name} ${args.joinToString(" ")}".trim()
+//$$
+//$$
+//#if MC < 1.12
+//$$ override fun processCommand(sender: ICommandSender, args: Array<out String>) {
+//#else
//$$ override fun execute(server: MinecraftServer, sender: ICommandSender, args: Array<out String>) {
+//#endif
//$$ val source = BridgedCommandSource(sender)
//$$ val results = dispatcher.parse(getCommandLineText(args), source)
//$$ kotlin.runCatching {
@@ -55,7 +68,7 @@ package moe.nea.ultranotifier.commands
//$$ }
//$$}
//$$
-//$$object BrigadierPatchbay {
+//$$object BrigadierPatchbay : SubscriptionTarget {
//$$
//$$ @UltraSubscribe
//$$ fun onAfterRegistration(event: RegistrationFinishedEvent) {