geforkt von SteamWar/BungeeCore
Implementing WHOIS command
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
3a71a618e6
Commit
8cdbe6de25
@ -90,6 +90,7 @@ public class BungeeCore extends Plugin {
|
|||||||
new PollCommand();
|
new PollCommand();
|
||||||
new MuteCommand();
|
new MuteCommand();
|
||||||
new BugCommand();
|
new BugCommand();
|
||||||
|
new WhoisCommand();
|
||||||
|
|
||||||
new EventStarter();
|
new EventStarter();
|
||||||
new Broadcaster();
|
new Broadcaster();
|
||||||
|
46
src/de/steamwar/bungeecore/commands/WhoisCommand.java
Normale Datei
46
src/de/steamwar/bungeecore/commands/WhoisCommand.java
Normale Datei
@ -0,0 +1,46 @@
|
|||||||
|
package de.steamwar.bungeecore.commands;
|
||||||
|
|
||||||
|
import de.steamwar.bungeecore.BungeeCore;
|
||||||
|
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||||
|
import de.steamwar.bungeecore.sql.Team;
|
||||||
|
import net.md_5.bungee.api.CommandSender;
|
||||||
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
|
public class WhoisCommand extends BasicCommand {
|
||||||
|
public WhoisCommand(){
|
||||||
|
super("whois", "bungeecore.teamchat");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(CommandSender sender, String[] args) {
|
||||||
|
if(!(sender instanceof ProxiedPlayer))
|
||||||
|
return;
|
||||||
|
ProxiedPlayer player = (ProxiedPlayer) sender;
|
||||||
|
|
||||||
|
if(args.length == 0){
|
||||||
|
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§c/whois [Spieler]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SteamwarUser user = SteamwarUser.get(args[0]);
|
||||||
|
if(user == null){
|
||||||
|
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cUnbekannter Spieler.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BungeeCore.send(player, "§7Username§8: §e" + user.getUserName());
|
||||||
|
BungeeCore.send(player, "§7UUID§8: §e" + user.getUuid().toString(), "", new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, user.getUuid().toString()));
|
||||||
|
BungeeCore.send(player, "§7ID§8: §e" + user.getId());
|
||||||
|
|
||||||
|
Team team = Team.get(user.getTeam());
|
||||||
|
BungeeCore.send(player, "§7Team§8: §e" + team.getTeamName());
|
||||||
|
|
||||||
|
if(user.isBanned()){
|
||||||
|
player.sendMessage(user.banMessage());
|
||||||
|
}
|
||||||
|
if(user.isMuted()){
|
||||||
|
player.sendMessage(user.muteMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren