From 20358758e694fb383c2fa263f234216c0f69b07e Mon Sep 17 00:00:00 2001 From: SergeyDertan Date: Wed, 19 Jun 2019 23:19:46 +0300 Subject: [PATCH] PluginIdentifiableCommand --- .../kotlin/Sergey_Dertan/SVault/command/SVaultCommand.kt | 6 +++++- .../kotlin/Sergey_Dertan/SVault/command/VaultCommand.kt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/Sergey_Dertan/SVault/command/SVaultCommand.kt b/src/main/kotlin/Sergey_Dertan/SVault/command/SVaultCommand.kt index 5028efb..1899cf6 100644 --- a/src/main/kotlin/Sergey_Dertan/SVault/command/SVaultCommand.kt +++ b/src/main/kotlin/Sergey_Dertan/SVault/command/SVaultCommand.kt @@ -1,10 +1,12 @@ package Sergey_Dertan.SVault.command +import Sergey_Dertan.SVault.main.SVaultMain import Sergey_Dertan.SVault.messenger.Messenger import Sergey_Dertan.SVault.vault.VaultManager import cn.nukkit.command.Command +import cn.nukkit.command.PluginIdentifiableCommand -abstract class SVaultCommand(name: String) : Command(name) { +abstract class SVaultCommand(name: String) : Command(name), PluginIdentifiableCommand { protected val messenger = Messenger protected val vaultManager = VaultManager @@ -13,4 +15,6 @@ abstract class SVaultCommand(name: String) : Command(name) { this.permission = "svault.command.$name" this.description = this.messenger.getMessage("command.$name.description") } + + override fun getPlugin() = SVaultMain.instance } diff --git a/src/main/kotlin/Sergey_Dertan/SVault/command/VaultCommand.kt b/src/main/kotlin/Sergey_Dertan/SVault/command/VaultCommand.kt index 5210dfe..f77ef1c 100644 --- a/src/main/kotlin/Sergey_Dertan/SVault/command/VaultCommand.kt +++ b/src/main/kotlin/Sergey_Dertan/SVault/command/VaultCommand.kt @@ -1,12 +1,14 @@ package Sergey_Dertan.SVault.command +import Sergey_Dertan.SVault.main.SVaultMain import Sergey_Dertan.SVault.messenger.Messenger import cn.nukkit.command.Command import cn.nukkit.command.CommandSender +import cn.nukkit.command.PluginIdentifiableCommand import cn.nukkit.command.data.CommandParameter import java.util.* -object VaultCommand : Command("vault") { +object VaultCommand : Command("vault"), PluginIdentifiableCommand { private val messenger = Messenger private val commands = mutableMapOf() @@ -51,4 +53,6 @@ object VaultCommand : Command("vault") { } this.commandParameters = params } + + override fun getPlugin() = SVaultMain.instance }