From 42adba4adc6bb3a2f140c2defdd6fd67f75e176e Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 28 Jan 2021 20:14:05 +0100 Subject: [PATCH] Add Check if user is Banned in Unban Command --- src/de/steamwar/bungeecore/commands/UnbanCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/UnbanCommand.java b/src/de/steamwar/bungeecore/commands/UnbanCommand.java index c21561a9..8b17a270 100644 --- a/src/de/steamwar/bungeecore/commands/UnbanCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnbanCommand.java @@ -22,7 +22,6 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.api.CommandSender; -import net.md_5.bungee.api.connection.ProxiedPlayer; import java.sql.Timestamp; import java.util.Date; @@ -44,6 +43,11 @@ public class UnbanCommand extends BasicCommand { if(target == null) return; + if(!target.isBanned()) { + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "Der Spieler ist nicht gebannt."); + return; + } + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "Du hast " + target.getUserName() + " entbannt."); target.ban(Timestamp.from(new Date().toInstant()), "Unban", SteamwarUser.get(sender.getName()).getId(), false); }