summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzenexer <zenexer@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-24 01:24:37 +0000
committerzenexer <zenexer@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-24 01:24:37 +0000
commitea284b6b0fc0279172c087e0ab1c113d184f1780 (patch)
tree7f36bb91ddc80034fdf4419bd0f737dfc89952fc
parent41279fc15981bda0a1e541ffe47fa80fdb1accc3 (diff)
downloadEssentials-ea284b6b0fc0279172c087e0ab1c113d184f1780.tar
Essentials-ea284b6b0fc0279172c087e0ab1c113d184f1780.tar.gz
Essentials-ea284b6b0fc0279172c087e0ab1c113d184f1780.tar.lz
Essentials-ea284b6b0fc0279172c087e0ab1c113d184f1780.tar.xz
Essentials-ea284b6b0fc0279172c087e0ab1c113d184f1780.zip
Let's get to the bottom of this ban error.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1269 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandban.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
index 778923029..1e74ed183 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
@@ -23,20 +23,27 @@ public class Commandban extends EssentialsCommand
return;
}
-
- User p = null;
- if (server.matchPlayer(args[0]).isEmpty())
+ try
{
- ((CraftServer)server).getHandle().a(args[0]);
- sender.sendMessage("§cPlayer " + args[0] + " banned");
+ User p = null;
+ if (server.matchPlayer(args[0]).isEmpty())
+ {
+ ((CraftServer)server).getHandle().a(args[0]);
+ sender.sendMessage("§cPlayer " + args[0] + " banned");
+ }
+ else
+ {
+ p = User.get(server.matchPlayer(args[0]).get(0));
+ p.kickPlayer(args.length > 1 ? getFinalArg(args, 1) : "Banned from server");
+ ((CraftServer)server).getHandle().a(p.getName());
+ sender.sendMessage("§cPlayer " + p.getName() + " banned");
+ }
+ Essentials.getStatic().loadBanList();
}
- else
+ catch (Throwable ex)
{
- p = User.get(server.matchPlayer(args[0]).get(0));
- p.kickPlayer(args.length > 1 ? getFinalArg(args, 1) : "Banned from server");
- ((CraftServer)server).getHandle().a(p.getName());
- sender.sendMessage("§cPlayer " + p.getName() + " banned");
+ ex.printStackTrace();
+ sender.sendMessage("Error: " + ex);
}
- Essentials.getStatic().loadBanList();
}
}