MiniGames/src/main/java/net/knarcraft/dropper/command/EditArenaTabCompleter.java
EpicKnarvik97 ca5b0fcbca Makes it possible to get the current value from /dedit
Finally gets rid of the redundancy when checking if a record has been beaten
Adds tab-completions for arenas and properties to the edit command
Adds an ArenaEditableProperty enum to keep track of editable arena properties
2023-03-29 11:37:26 +02:00

34 lines
1.0 KiB
Java

package net.knarcraft.dropper.command;
import net.knarcraft.dropper.util.TabCompleteHelper;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
/**
* The tab-completer for the edit arena command
*/
public class EditArenaTabCompleter implements TabCompleter {
@Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command,
@NotNull String label, @NotNull String[] args) {
if (args.length == 1) {
return TabCompleteHelper.getArenas();
} else if (args.length == 2) {
return TabCompleteHelper.getArenaProperties();
} else if (args.length == 3) {
//TODO: Tab-complete possible values for the given property
return null;
} else {
return new ArrayList<>();
}
}
}