Skip to content

Commit

Permalink
PluginIdentifiableCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyDertan committed Jun 19, 2019
1 parent 0ef65da commit 2035875
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
}
6 changes: 5 additions & 1 deletion src/main/kotlin/Sergey_Dertan/SVault/command/VaultCommand.kt
Original file line number Diff line number Diff line change
@@ -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<String, Command>()
Expand Down Expand Up @@ -51,4 +53,6 @@ object VaultCommand : Command("vault") {
}
this.commandParameters = params
}

override fun getPlugin() = SVaultMain.instance
}

0 comments on commit 2035875

Please sign in to comment.