geforkt von SteamWar/BungeeCore
Adding unban-Befehl
Dieser Commit ist enthalten in:
Ursprung
4c8c0ed4e3
Commit
6918bdaa75
@ -73,6 +73,7 @@ public class BungeeCore extends Plugin {
|
|||||||
new FightCommand();
|
new FightCommand();
|
||||||
new HelpCommand();
|
new HelpCommand();
|
||||||
new BanCommand();
|
new BanCommand();
|
||||||
|
new UnbanCommand();
|
||||||
new DenyCommand("watchcat", "wc");
|
new DenyCommand("watchcat", "wc");
|
||||||
new ChallengeCommand();
|
new ChallengeCommand();
|
||||||
new TeamCommand();
|
new TeamCommand();
|
||||||
|
30
src/de/steamwar/bungeecore/commands/UnbanCommand.java
Normale Datei
30
src/de/steamwar/bungeecore/commands/UnbanCommand.java
Normale Datei
@ -0,0 +1,30 @@
|
|||||||
|
package de.steamwar.bungeecore.commands;
|
||||||
|
|
||||||
|
import de.steamwar.bungeecore.BungeeCore;
|
||||||
|
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||||
|
import net.md_5.bungee.api.CommandSender;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class UnbanCommand extends BasicCommand {
|
||||||
|
|
||||||
|
public UnbanCommand() {
|
||||||
|
super("unban", "bungeecore.ban");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(CommandSender sender, String[] args) {
|
||||||
|
if(args.length < 1){
|
||||||
|
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "/unban [Spieler]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SteamwarUser target = user(sender, args[0]);
|
||||||
|
if(target == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "Du hast " + target.getUserName() + " entbannt.");
|
||||||
|
target.ban(Timestamp.from(new Date().toInstant()), "");
|
||||||
|
}
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren