|
1 | 1 | package dev.newspicel.di.commands
|
2 | 2 |
|
| 3 | +import dev.newspicel.di.DIJavaPlugin |
3 | 4 | import kotlinx.coroutines.CoroutineScope
|
4 | 5 | import kotlinx.coroutines.Dispatchers
|
5 | 6 | import kotlinx.coroutines.launch
|
6 | 7 | import kotlinx.coroutines.runBlocking
|
7 |
| -import net.kyori.adventure.text.format.TextColor |
8 |
| -import dev.newspicel.di.DIJavaPlugin |
9 | 8 | import net.kyori.adventure.text.Component.text
|
| 9 | +import net.kyori.adventure.text.format.TextColor |
10 | 10 | import org.bukkit.command.CommandExecutor
|
11 | 11 | import org.bukkit.command.CommandSender
|
12 | 12 | import org.bukkit.command.PluginCommand
|
@@ -51,8 +51,6 @@ object CommandsHelper {
|
51 | 51 | }
|
52 | 52 |
|
53 | 53 | private fun createCommandExecutor(plugin: DIJavaPlugin, func: KFunction<*>, command: Command): CommandExecutor = CommandExecutor { sender, _, label, args ->
|
54 |
| - if (command.label != label) error("This should never happen") |
55 |
| - |
56 | 54 | if (!checkPermissions(sender, func)) {
|
57 | 55 | sender.sendMessage(text("You don't have permission to execute this command").color(TextColor.color(0xFF0000)))
|
58 | 56 | return@CommandExecutor false
|
@@ -88,8 +86,6 @@ object CommandsHelper {
|
88 | 86 | }
|
89 | 87 |
|
90 | 88 | private fun createTabCompleter(plugin: DIJavaPlugin, func: KFunction<*>, tabComplete: TabComplete): TabCompleter = TabCompleter { sender, _, label, args ->
|
91 |
| - if (tabComplete.label != label) error("This should never happen") |
92 |
| - |
93 | 89 | if (!checkPermissions(sender, func)) {
|
94 | 90 | return@TabCompleter emptyList()
|
95 | 91 | }
|
|
0 commit comments