diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-03-15 02:12:43 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-03-15 02:12:43 +0000 |
commit | 5d79863cfc5cb72aa387a381cf8069cbd20a1c49 (patch) | |
tree | 16f994a0a7af35e6dd50e464b9a52f4a945be7df | |
parent | b85756f8b1d0b3a2d8b144b0cb7552b8d08d2092 (diff) | |
download | Essentials-5d79863cfc5cb72aa387a381cf8069cbd20a1c49.tar Essentials-5d79863cfc5cb72aa387a381cf8069cbd20a1c49.tar.gz Essentials-5d79863cfc5cb72aa387a381cf8069cbd20a1c49.tar.lz Essentials-5d79863cfc5cb72aa387a381cf8069cbd20a1c49.tar.xz Essentials-5d79863cfc5cb72aa387a381cf8069cbd20a1c49.zip |
Fixing setwarp command.
3 files changed, 7 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Warps.java b/Essentials/src/com/earth2me/essentials/Warps.java index 57326b54a..ece987aba 100644 --- a/Essentials/src/com/earth2me/essentials/Warps.java +++ b/Essentials/src/com/earth2me/essentials/Warps.java @@ -1,6 +1,7 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.commands.WarpNotFoundException; import java.io.File; import java.util.*; import java.util.logging.Level; @@ -48,7 +49,7 @@ public class Warps implements IConf EssentialsConf conf = warpPoints.get(new StringIgnoreCase(warp)); if (conf == null) { - throw new Exception(_("warpNotExist")); + throw new WarpNotFoundException(); } return conf.getLocation(null, server); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java index b39a7efcf..42da62b85 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import com.earth2me.essentials.Warps; import org.bukkit.Location; import org.bukkit.Server; @@ -34,11 +35,11 @@ public class Commandsetwarp extends EssentialsCommand { warpLoc = warps.getWarp(args[0]); } - catch (WarpNotFoundException ex) + catch (Exception ex) { } - if (warpLoc == null || user.hasPermission("essentials.warp.overwrite." + args[0])) + if (warpLoc == null || user.isAuthorized("essentials.warp.overwrite." + Util.sanitizeFileName(args[0]))) { warps.setWarp(args[0], loc); } diff --git a/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java index 9258bf926..bfba73818 100644 --- a/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java +++ b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java @@ -1,11 +1,12 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; public class WarpNotFoundException extends Exception { public WarpNotFoundException() { - super("Warp not found"); + super(_("warpNotExist")); } public WarpNotFoundException(String message) |