SteamWar/BungeeCore
Archiviert
13
2

Update MsgCommand #389

Zusammengeführt
Lixfel hat 1 Commits von CommandMsg nach master 2022-06-16 13:14:15 +02:00 zusammengeführt

Datei anzeigen

@ -21,34 +21,23 @@ package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.listeners.ChatListener;
import de.steamwar.bungeecore.sql.IgnoreSystem;
import de.steamwar.command.SWCommand;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Stream;
import static de.steamwar.bungeecore.Storage.lastChats;
public class MsgCommand extends BasicCommand {
public class MsgCommand extends SWCommand {
public MsgCommand() {
super("msg", "", "w", "tell");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
if (args.length < 2) {
ChatSender.of(sender).system("MSG_USAGE");
return;
}
msg((ProxiedPlayer) sender, ProxyServer.getInstance().getPlayer(args[0]), Arrays.copyOfRange(args, 1, args.length));
@Register(description = "MSG_USAGE")
public void genericCommand(ProxiedPlayer sender, ProxiedPlayer target, String... message) {
msg(sender, target, message);
}
public static void msg(ProxiedPlayer player, ProxiedPlayer target, String[] args) {
@ -69,14 +58,6 @@ public class MsgCommand extends BasicCommand {
lastChats.put(target, player);
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
if(args.length == 1){
return allPlayers(args[0]);
}
return new ArrayList<>();
}
public static void remove(ProxiedPlayer player){
lastChats.remove(player);
}