Allow /unbanip playername, not just ips

This commit is contained in:
snowleo 2011-11-27 16:58:47 +01:00
parent ccb4d3a7e8
commit c5251591de

View File

@ -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"));
}