Merge pull request 'Update UnIgnoreCommand' (#406) from CommandUnIgnore into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #406 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
7c1925ad71
@ -22,28 +22,20 @@ package de.steamwar.bungeecore.commands;
|
|||||||
import de.steamwar.bungeecore.Message;
|
import de.steamwar.bungeecore.Message;
|
||||||
import de.steamwar.bungeecore.sql.IgnoreSystem;
|
import de.steamwar.bungeecore.sql.IgnoreSystem;
|
||||||
import de.steamwar.bungeecore.sql.SteamwarUser;
|
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import de.steamwar.command.SWCommand;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
public class UnIgnoreCommand extends BasicCommand {
|
public class UnIgnoreCommand extends SWCommand {
|
||||||
|
|
||||||
public UnIgnoreCommand() {
|
public UnIgnoreCommand() {
|
||||||
super("unignore", null);
|
super("unignore");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Register(description = "UNIGNORE_USAGE")
|
||||||
public void execute(CommandSender sender, String[] args) {
|
public void genericCommand(ProxiedPlayer p, String toUnIgnore) {
|
||||||
if(args.length < 1) {
|
|
||||||
Message.send("UNIGNORE_USAGE", sender);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(sender instanceof ProxiedPlayer))
|
|
||||||
return;
|
|
||||||
ProxiedPlayer p = (ProxiedPlayer) sender;
|
|
||||||
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
|
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
|
||||||
|
|
||||||
SteamwarUser target = SteamwarUser.get(args[0]);
|
SteamwarUser target = SteamwarUser.get(toUnIgnore);
|
||||||
if(target == null){
|
if(target == null){
|
||||||
Message.send("UNIGNORE_NOT_PLAYER", p);
|
Message.send("UNIGNORE_NOT_PLAYER", p);
|
||||||
return;
|
return;
|
||||||
@ -55,5 +47,4 @@ public class UnIgnoreCommand extends BasicCommand {
|
|||||||
IgnoreSystem.unIgnore(user, target);
|
IgnoreSystem.unIgnore(user, target);
|
||||||
Message.send("UNIGNORE_UNIGNORED", p, target.getUserName());
|
Message.send("UNIGNORE_UNIGNORED", p, target.getUserName());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren