}
if (target != null)
{
EntityPlayerMP player = (EntityPlayerMP) sender;
PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(player.getPersistentID());
playerInfo.setLastTeleportOrigin(new WarpPoint(player));
CommandBack.justDied.remove(player.getPersistentID());
TeleportCenter.teleport(new WarpPoint(target), player);
}
else
{
OutputHandler.chatError(sender, String.format("Player %s does not exist, or is not online.", args[0]));
}
}
else if (args.length == 2 && PermissionsManager.checkPermission(sender, TeleportModule.PERM_TP_OTHERS))
{
EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
if (player != null)
{
EntityPlayer target = UserIdent.getPlayerByMatchOrUsername(sender, args[1]);
if (target != null)
{
PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(player.getPersistentID());
playerInfo.setLastTeleportOrigin(new WarpPoint(player));
WarpPoint point = new WarpPoint(target);
FunctionHelper.teleportPlayer(player, point);
}
else
{
OutputHandler.chatError(sender, String.format("Player %s does not exist, or is not online.", args[1]));
return;
}
}
else
{
OutputHandler.chatError(sender, String.format("Player %s does not exist, or is not online.", args[0]));
return;
}
}
else if (args.length >= 3)
{
if (args.length == 3)
{
EntityPlayerMP player = (EntityPlayerMP) sender;
double x = parseDouble(sender, args[0]), y = parseDouble(sender, args[1]), z = parseDouble(sender, args[2]);
PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(player.getPersistentID());
playerInfo.setLastTeleportOrigin(new WarpPoint(player));
TeleportCenter.teleport(new WarpPoint(player.dimension, x, y, z, player.rotationPitch, player.rotationYaw), player);
}
else if (args.length == 4)
{
EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
if (player != null)
{
double x = parseDouble(sender, args[1]), y = parseDouble(sender, args[2]), z = parseDouble(sender, args[3]);
PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(player.getPersistentID());
playerInfo.setLastTeleportOrigin(new WarpPoint(player));
TeleportCenter.teleport(new WarpPoint(player.dimension, x, y, z, player.rotationPitch, player.rotationYaw), player);
}
else
{
OutputHandler.chatError(sender, String.format("Player %s does not exist, or is not online.", args[0]));
}