diff options
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java index c539a596c..14d2c8ae6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java @@ -1,20 +1,15 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.User; -import org.bukkit.Server; +import com.earth2me.essentials.api.IUser; +import lombok.Cleanup; import org.bukkit.command.CommandSender; public class Commandunbanip extends EssentialsCommand { - public Commandunbanip() - { - super("unbanip"); - } - @Override - public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { @@ -22,8 +17,10 @@ public class Commandunbanip extends EssentialsCommand } try { - final User user = getPlayer(server, args, 0, true); - ess.getServer().unbanIP(user.getLastLoginAddress()); + @Cleanup + final IUser user = getPlayer(args, 0, true); + user.acquireReadLock(); + ess.getServer().unbanIP(user.getData().getIpAddress()); } catch (Exception ex) { |