summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-12-19 12:07:28 +0100
committersnowleo <schneeleo@gmail.com>2011-12-19 12:07:28 +0100
commitcc0611721083e2cea902d6b8e7e819e7818680f5 (patch)
treeefe4de80d80ae14e88d1af872c59d8ecc4a0050c
parentcbd5b6c0f43a7be652c7ead7199939fadd6cc422 (diff)
parent5a092f0e9929e82cf4f5792b9744bca5c0ecc1ca (diff)
downloadEssentials-cc0611721083e2cea902d6b8e7e819e7818680f5.tar
Essentials-cc0611721083e2cea902d6b8e7e819e7818680f5.tar.gz
Essentials-cc0611721083e2cea902d6b8e7e819e7818680f5.tar.lz
Essentials-cc0611721083e2cea902d6b8e7e819e7818680f5.tar.xz
Essentials-cc0611721083e2cea902d6b8e7e819e7818680f5.zip
Merge branch 'refs/heads/master' into release
-rw-r--r--Essentials/src/com/earth2me/essentials/Jails.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java4
2 files changed, 12 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java
index 4c1090c5c..f8ab2d02e 100644
--- a/Essentials/src/com/earth2me/essentials/Jails.java
+++ b/Essentials/src/com/earth2me/essentials/Jails.java
@@ -59,7 +59,12 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
{
throw new Exception(_("jailNotExist"));
}
- return getData().getJails().get(jailName.toLowerCase(Locale.ENGLISH));
+ Location loc = getData().getJails().get(jailName.toLowerCase(Locale.ENGLISH));
+ if (loc == null || loc.getWorld() == null)
+ {
+ throw new Exception(_("jailNotExist"));
+ }
+ return loc;
}
finally
{
@@ -111,7 +116,8 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
{
if (!(user.getBase() instanceof OfflinePlayer))
{
- user.getTeleport().now(getJail(jail), false, TeleportCause.COMMAND);
+ Location loc = getJail(jail);
+ user.getTeleport().now(loc, false, TeleportCause.COMMAND);
}
user.setJail(jail);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
index bf5c11abe..1a7d27b4b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
@@ -20,6 +20,10 @@ public class Commandsetwarp extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
+
+ if (args[0].matches("[0-9]+")) {
+ throw new NotEnoughArgumentsException();
+ }
final Location loc = user.getLocation();
ess.getWarps().setWarp(args[0], loc);