From 595929f4b2a256345490afbc8c6dc99cbb154b03 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 16 Jun 2022 12:17:01 +0200 Subject: [PATCH] Update UnIgnoreCommand --- .../bungeecore/commands/UnIgnoreCommand.java | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java index d7350ff..d0755bd 100644 --- a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java @@ -22,28 +22,20 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.IgnoreSystem; 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; -public class UnIgnoreCommand extends BasicCommand { +public class UnIgnoreCommand extends SWCommand { public UnIgnoreCommand() { - super("unignore", null); + super("unignore"); } - @Override - public void execute(CommandSender sender, String[] args) { - if(args.length < 1) { - Message.send("UNIGNORE_USAGE", sender); - return; - } - - if (!(sender instanceof ProxiedPlayer)) - return; - ProxiedPlayer p = (ProxiedPlayer) sender; + @Register(description = "UNIGNORE_USAGE") + public void genericCommand(ProxiedPlayer p, String toUnIgnore) { SteamwarUser user = SteamwarUser.get(p.getUniqueId()); - SteamwarUser target = SteamwarUser.get(args[0]); + SteamwarUser target = SteamwarUser.get(toUnIgnore); if(target == null){ Message.send("UNIGNORE_NOT_PLAYER", p); return; @@ -55,5 +47,4 @@ public class UnIgnoreCommand extends BasicCommand { IgnoreSystem.unIgnore(user, target); Message.send("UNIGNORE_UNIGNORED", p, target.getUserName()); } - } -- 2.39.5