From 3e72bbb36b253079b80e8dfb001f084c49a1965b Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 27 Nov 2011 16:58:47 +0100 Subject: [PATCH] Allow /unbanip playername, not just ips --- .../com/earth2me/essentials/commands/Commandunbanip.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java index 2c1d06f39..2b22ede2c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -19,7 +20,10 @@ public class Commandunbanip extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - + User user = getPlayer(server, args, 0, true); + if (user != null) { + ess.getServer().unbanIP(user.getLastLoginAddress()); + } ess.getServer().unbanIP(args[0]); sender.sendMessage(_("unbannedIP")); }