{
if (TeleportDataManager.warps.containsKey(args[0].toLowerCase()))
{
if (PermissionsManager.checkPermission(sender, getPermissionNode() + "." + args[0].toLowerCase()))
{
Warp warp = TeleportDataManager.warps.get(args[0].toLowerCase());
PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(sender.getPersistentID());
playerInfo.setLastTeleportOrigin(new WarpPoint(sender));
CommandBack.justDied.remove(sender.getPersistentID());
TeleportCenter.teleport(warp.getPoint(), (EntityPlayerMP) sender);
}
else
{
OutputHandler.chatError(sender,
"You have insufficient permissions to do that. If you believe you received this message in error, please talk to a server admin.");
}
}
else
{
OutputHandler.chatError(sender, "That warp doesn't exist!");
}
}
else if (args.length == 2)
{
if (PermissionsManager.checkPermission(sender, TeleportModule.PERM_WARP_ADMIN))
{
if (args[0].equalsIgnoreCase("set"))
{
if (TeleportDataManager.warps.containsKey(args[1].toLowerCase()))
{
OutputHandler.chatError(sender, "That warp already exists. Use '/warp del <name>' to delete.");
}
else
{
Warp warp = new Warp(args[1].toLowerCase(), new WarpPoint(sender.dimension, sender.posX, sender.posY, sender.posZ, sender.rotationPitch, sender.rotationYaw));
TeleportDataManager.addWarp(warp);
if (!TeleportDataManager.warps.containsKey(args[1].toLowerCase()))
{
OutputHandler.chatError(sender, "Could not make warp! This is an error!");
}