Skip to content

Commit

Permalink
Removed debug stuff from the Command, final commit before release
Browse files Browse the repository at this point in the history
  • Loading branch information
byPixelTV committed May 4, 2024
1 parent 01f2ec3 commit ea0d761
Showing 1 changed file with 0 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ import kotlin.jvm.optionals.getOrNull
class SkCloudnetCommands {
private val miniMessages = MiniMessage.miniMessage()

private val serviceRegistry: ServiceRegistry? = InjectionLayer.ext().instance(ServiceRegistry::class.java)
private val playerManager: PlayerManager? = serviceRegistry?.firstProvider(PlayerManager::class.java)

@Suppress("UNUSED", "DEPRECATION")
val command = commandTree("skcloudnet") {
withPermission("skcloudnet.admin")
Expand Down Expand Up @@ -110,42 +107,5 @@ class SkCloudnetCommands {
player.sendMessage(miniMessages.deserialize("<dark_grey>[<gradient:aqua:blue:aqua>SkCloudnet</gradient>]</dark_grey> <color:#43fa00>Successfully reloaded the config!</color>"))
}
}
literalArgument("kick") {
literalArgument("self") {
playerExecutor { player, _ ->
playerManager?.playerExecutor(player.uniqueId)?.kick(literalText("Test"))
}
}
literalArgument("others_test_1") {
stringArgument("player", false) {
replaceSuggestions(ArgumentSuggestions.stringCollection {
playerManager?.onlinePlayers()?.uniqueIds()?.map { it.toString() } ?: emptyList()
})
greedyStringArgument("reason", true) {
playerExecutor { player, args ->
val reason = args.getOptional(1).getOrNull() as? String ?: "No reason specified"
val target = UUID.fromString(args[0].toString())
playerManager?.playerExecutor(target)?.kick(literalText(reason))
player.sendMessage(miniMessages.deserialize("<dark_grey>[<gradient:aqua:blue:aqua>SkCloudnet</gradient>]</dark_grey> <grey>Kicked player <aqua>${Bukkit.getPlayer(target)?.name}</aqua> from the network!</grey>"))
}
}
}
}
literalArgument("others_test_2") {
stringArgument("player", false) {
replaceSuggestions(ArgumentSuggestions.stringCollection {
playerManager?.onlinePlayers()?.uniqueIds()?.map { it.toString() } ?: emptyList()
})
greedyStringArgument("reason", true) {
playerExecutor { player, args ->
val reason = args.getOptional(0).getOrNull() as? String ?: "No reason specified"
val target = UUID.fromString(args[0].toString())
playerManager?.playerExecutor(target)?.kick(literalText(reason))
player.sendMessage(miniMessages.deserialize("<dark_grey>[<gradient:aqua:blue:aqua>SkCloudnet</gradient>]</dark_grey> <grey>Kicked player <aqua>${Bukkit.getPlayer(target)?.name}</aqua> from the network!</grey>"))
}
}
}
}
}
}
}

0 comments on commit ea0d761

Please sign in to comment.