summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
diff options
context:
space:
mode:
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandunban.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunban.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
index dda1475d0..101e09691 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.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 Commandunban extends EssentialsCommand
{
- public Commandunban()
- {
- super("unban");
- }
-
@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)
{
@@ -23,7 +18,10 @@ public class Commandunban extends EssentialsCommand
try
{
- final User player = getPlayer(server, args, 0, true);
+ @Cleanup
+ final IUser player = getPlayer(args, 0, true);
+ player.acquireWriteLock();
+ player.getData().setBan(null);
player.setBanned(false);
sender.sendMessage(_("unbannedPlayer"));
}