summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-08-11 04:38:00 +0100
committerKHobbits <rob@khobbits.co.uk>2011-08-11 04:38:00 +0100
commit5ca992798710507cd3bd87403b36d458f63523e2 (patch)
treec56ed3245bc885e6bab6c9d7d6b943c2747e7763
parenta753f322df3399fb4fcf972f717bc3ba3b929c84 (diff)
downloadEssentials-5ca992798710507cd3bd87403b36d458f63523e2.tar
Essentials-5ca992798710507cd3bd87403b36d458f63523e2.tar.gz
Essentials-5ca992798710507cd3bd87403b36d458f63523e2.tar.lz
Essentials-5ca992798710507cd3bd87403b36d458f63523e2.tar.xz
Essentials-5ca992798710507cd3bd87403b36d458f63523e2.zip
Fix unbanning players who don't have user files.
-rw-r--r--Essentials/src/com/earth2me/essentials/Util.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunban.java15
2 files changed, 13 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java
index 6ec5f4180..614e9b2b9 100644
--- a/Essentials/src/com/earth2me/essentials/Util.java
+++ b/Essentials/src/com/earth2me/essentials/Util.java
@@ -252,7 +252,7 @@ public class Util
{
y = 127;
x += 1;
- if (x - 16 > loc.getBlockX())
+ if (x - 32 > loc.getBlockX())
{
throw new Exception(Util.i18n("holeInFloor"));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
index 88e7f10ba..2cf4e78d0 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
@@ -20,9 +20,18 @@ public class Commandunban extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
-
- User u = getPlayer(server, args, 0, true);
- ess.getBans().unbanByName(u.getName());
+
+ String name;
+ try
+ {
+ User u = getPlayer(server, args, 0, true);
+ name = u.getName();
+ }
+ catch (NoSuchFieldException e)
+ {
+ name = args[0];
+ }
+ ess.getBans().unbanByName(name);
sender.sendMessage(Util.i18n("unbannedPlayer"));
}
}