Add tab completion to new command system, remove Brigadier

This commit is contained in:
dfsek
2020-10-01 21:54:43 -07:00
parent e36e5f390c
commit 8b0c2030ee
27 changed files with 229 additions and 124 deletions

View File

@@ -2,7 +2,9 @@ package com.dfsek.terra.command;
import com.dfsek.terra.command.type.Command;
import com.dfsek.terra.generation.TerraChunkGenerator;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.Collections;
@@ -15,7 +17,7 @@ public class SaveDataCommand extends Command {
}
@Override
public boolean onCommand(@NotNull CommandSender sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args) {
public boolean execute(@NotNull CommandSender sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args) {
TerraChunkGenerator.saveAll();
sender.sendMessage("Saved population data.");
return true;
@@ -30,4 +32,9 @@ public class SaveDataCommand extends Command {
public List<Command> getSubCommands() {
return Collections.emptyList();
}
@Override
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
return Collections.emptyList();
}
}