From 4187b0f50c3d7c079c59db109a4d338e83498bf6 Mon Sep 17 00:00:00 2001 From: Logan Gorence Date: Mon, 10 Jan 2022 00:04:08 -0800 Subject: [PATCH] Add missing alias and try to improve tab completion. --- .../foundation/core/features/player/LocalWeatherCommand.kt | 2 +- foundation-core/src/main/resources/plugin.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/foundation-core/src/main/kotlin/cloud/kubelet/foundation/core/features/player/LocalWeatherCommand.kt b/foundation-core/src/main/kotlin/cloud/kubelet/foundation/core/features/player/LocalWeatherCommand.kt index 1ad22ec..fe4c658 100644 --- a/foundation-core/src/main/kotlin/cloud/kubelet/foundation/core/features/player/LocalWeatherCommand.kt +++ b/foundation-core/src/main/kotlin/cloud/kubelet/foundation/core/features/player/LocalWeatherCommand.kt @@ -1,6 +1,5 @@ package cloud.kubelet.foundation.core.features.player -import org.bukkit.GameMode import org.bukkit.WeatherType import org.bukkit.command.Command import org.bukkit.command.CommandExecutor @@ -45,6 +44,7 @@ class LocalWeatherCommand : CommandExecutor, TabCompleter { args: Array ): List = when { args.isEmpty() -> weatherTypes.keys.toList() + args.size == 1 -> weatherTypes.filterKeys { it.startsWith(args[0]) }.keys.toList() else -> listOf() } } diff --git a/foundation-core/src/main/resources/plugin.yml b/foundation-core/src/main/resources/plugin.yml index 7b4c483..9f26985 100644 --- a/foundation-core/src/main/resources/plugin.yml +++ b/foundation-core/src/main/resources/plugin.yml @@ -60,3 +60,5 @@ commands: localweather: description: Set the player's local weather in the client. usage: /localweather + aliases: + - lw