Eliminated plugin and kSpigot parameters

This commit is contained in:
bluefireoly
2020-10-12 17:01:01 +02:00
parent 6b2f95c7fa
commit 29bd82803d
11 changed files with 63 additions and 69 deletions

View File

@@ -1,6 +1,6 @@
package net.axay.kspigot.utils
import net.axay.kspigot.main.KSpigot
import net.axay.kspigot.main.KSpigotMainInstance
import org.bukkit.command.CommandExecutor
import org.bukkit.command.TabCompleter
@@ -13,8 +13,8 @@ interface RegisterableCommand : CommandExecutor {
* @return true if the command was found -
* false if not
*/
fun registerCommand(commandName: String, kSpigot: KSpigot): Boolean {
kSpigot.getCommand(commandName)?.let {
fun registerAs(commandName: String): Boolean {
KSpigotMainInstance.getCommand(commandName)?.let {
it.setExecutor(this)
if (this is TabCompleter)
it.tabCompleter = this