|
@@ -21,6 +21,7 @@ package de.butzlabben.missilewars.commands;
|
|
import co.aikar.commands.BukkitCommandCompletionContext;
|
|
import co.aikar.commands.BukkitCommandCompletionContext;
|
|
import co.aikar.commands.CommandCompletions;
|
|
import co.aikar.commands.CommandCompletions;
|
|
import co.aikar.commands.PaperCommandManager;
|
|
import co.aikar.commands.PaperCommandManager;
|
|
|
|
+import com.google.common.collect.ImmutableList;
|
|
import de.butzlabben.missilewars.game.Game;
|
|
import de.butzlabben.missilewars.game.Game;
|
|
import de.butzlabben.missilewars.game.GameManager;
|
|
import de.butzlabben.missilewars.game.GameManager;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.command.CommandSender;
|
|
@@ -36,6 +37,7 @@ public class MWCommandCompletions {
|
|
registerGamesResult();
|
|
registerGamesResult();
|
|
registerMissilesResult();
|
|
registerMissilesResult();
|
|
registerArenasResult();
|
|
registerArenasResult();
|
|
|
|
+ registerTeamsResult();
|
|
}
|
|
}
|
|
|
|
|
|
private void registerGamesResult() {
|
|
private void registerGamesResult() {
|
|
@@ -69,5 +71,19 @@ public class MWCommandCompletions {
|
|
return game.getLobby().getPossibleArenas();
|
|
return game.getLobby().getPossibleArenas();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void registerTeamsResult() {
|
|
|
|
+ commandCompletions.registerCompletion("teams", c -> {
|
|
|
|
+ CommandSender sender = c.getSender();
|
|
|
|
+
|
|
|
|
+ if (!(sender instanceof Player)) return null;
|
|
|
|
+ Player player = (Player) sender;
|
|
|
|
+
|
|
|
|
+ Game game = GameManager.getInstance().getGame(player.getLocation());
|
|
|
|
+ if (game == null) return null;
|
|
|
|
+
|
|
|
|
+ return ImmutableList.of("1", "2", "spec");
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|