Merge pull request 'Update MsgCommand' (#389) from CommandMsg into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #389 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
7c898ac869
@ -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);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren