{
if (args[0].equalsIgnoreCase("goto"))
{
if (map.containsKey(args[1]))
{
PWarp warp = map.get(args[1]);
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, "That personal warp doesn't exist!");
}
}
else if (args[0].equalsIgnoreCase("add"))
{
if (args.length == 1)
{
OutputHandler.chatError(sender, "You must specify a warp name!");
return;
}
if (!map.containsKey(args[1]))
{
Integer prop = APIRegistry.perms.getUserPermissionPropertyInt(new UserIdent(sender), PERM_LIMIT_PROP);
if (prop == null || prop == -1)
{
map.put(args[1], new PWarp(sender.getPersistentID().toString(), args[1], new WarpPoint(sender)));
OutputHandler.chatConfirmation(sender, "Personal warp sucessfully added.");
}
else if (map.size() < prop)
{
map.put(args[1], new PWarp(sender.getPersistentID().toString(), args[1], new WarpPoint(sender)));
OutputHandler.chatConfirmation(sender, "Personal warp sucessfully added.");
}
else
{
OutputHandler.chatError(sender, "You have reached your limit.");