mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-27 10:31:31 +01:00
Fixing setwarp command.
This commit is contained in:
parent
b85756f8b1
commit
5d79863cfc
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user