Package com.forgeessentials.util.selections

Examples of com.forgeessentials.util.selections.WarpPoint


          target = UserIdent.getPlayerByMatchOrUsername(sender, args[1]);
        }
        if (target != null)
        {
          PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(player.getPersistentID());
          playerInfo.setLastTeleportOrigin(new WarpPoint(player));
          TeleportCenter.teleport(new WarpPoint(target), player);
        }
        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 == 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]));
      }
View Full Code Here


                    if (data.receiver == sender)
                    {
                        OutputHandler.chatNotification(data.sender, "Teleport request accepted.");
                        OutputHandler.chatConfirmation(data.receiver, "Teleport request accepted by other party. Teleporting..");
                        PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(data.sender.getPersistentID());
                        playerInfo.setLastTeleportOrigin(new WarpPoint(data.sender));
                        CommandBack.justDied.remove(data.sender.getPersistentID());
                        TeleportModule.tpaListToRemove.add(data);
                        TeleportCenter.teleport(new WarpPoint(data.receiver), data.sender);
                        return;
                    }
                }
            }
            return;
View Full Code Here

            EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
            if (player != null)
            {
                EntityPlayerMP target = (EntityPlayerMP) sender;
                PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(player.getPersistentID());
                playerInfo.setLastTeleportOrigin(new WarpPoint(player));
                TeleportCenter.teleport(new WarpPoint(target), player);
            }
            else
            {
                OutputHandler.chatError(sender, String.format("Player %s does not exist, or is not online.", args[0]));
            }
View Full Code Here

        if (FMLCommonHandler.instance().getEffectiveSide().isServer())
        {
            if (e.entityLiving instanceof EntityPlayer)
            {
                EntityPlayerMP player = (EntityPlayerMP) e.entityLiving;
                PlayerInfo.getPlayerInfo(player.getPersistentID()).setLastTeleportOrigin(new WarpPoint(player));
                CommandBack.justDied.add(player.getPersistentID());
            }
        }
    }
View Full Code Here

      if (player == null)
      {
        throw new CommandException(String.format("Player %s does not exist, or is not online.", args[0]));
      }

      WarpPoint point = RespawnHandler.getPlayerSpawn(player, null);
      if (point == null)
      {
        throw new CommandException("There is no spawnpoint set for that player.");
      }

      PlayerInfo.getPlayerInfo(player.getPersistentID()).setLastTeleportOrigin(new WarpPoint(player));
      OutputHandler.chatNotification(player, "Teleporting to spawn.");
      TeleportCenter.teleport(point, player);
    }
    else if (args.length == 0)
    {
      EntityPlayerMP player = (EntityPlayerMP) sender;

      WarpPoint point = RespawnHandler.getPlayerSpawn(player, null);
      if (point == null)
      {
        throw new CommandException("There is no spawnpoint set for that player.");
      }

      PlayerInfo.getPlayerInfo(player.getPersistentID()).setLastTeleportOrigin(new WarpPoint(player));
      OutputHandler.chatConfirmation(player, "Teleporting to spawn.");
      TeleportCenter.teleport(point, player);
    }
  }
View Full Code Here

    if (player == null)
    {
      throw new CommandException(String.format("Player %s does not exist, or is not online.", args[0]));
    }

    WarpPoint point = RespawnHandler.getPlayerSpawn(player, null);
    if (point == null)
    {
      throw new CommandException("There is no spawnpoint set for that player.");
    }

    PlayerInfo.getPlayerInfo(player.getPersistentID()).setLastTeleportOrigin(new WarpPoint(player));
    OutputHandler.chatNotification(player, "Teleporting to spawn.");
    TeleportCenter.teleport(point, player);
  }
View Full Code Here

        }
    }

    public void top(EntityPlayer player)
    {
        WarpPoint point = new WarpPoint(player);
        point.setY(player.worldObj.getActualHeight());
        while (player.worldObj.getBlock(point.getX(), point.getY(), point.getZ()) == Blocks.air)
        {
            point.setY(point.getY() - 1);
        }
        ((EntityPlayerMP) player).playerNetServerHandler.setPlayerLocation(point.getX(), point.getY() + 1, point.getZ(), point.yaw, point.pitch);
        OutputHandler.chatConfirmation(player, "Teleported.");
    }
View Full Code Here

            {
                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!");
                            }
View Full Code Here

            {
                EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
                if (player != null)
                {
                    Warp warp = TeleportDataManager.warps.get(args[1].toLowerCase());
                    PlayerInfo.getPlayerInfo(player.getPersistentID()).setLastTeleportOrigin(new WarpPoint(player));
                    TeleportCenter.teleport(warp.getPoint(), player);
                }
                else
                {
                    OutputHandler.chatError(sender, String.format("Player %s does not exist, or is not online.", args[0]));
View Full Code Here

            if (PermissionsManager.checkPermission(sender, TeleportModule.PERM_BACK_ONDEATH))
            {
                PlayerInfo info = PlayerInfo.getPlayerInfo(sender.getPersistentID());
                if (info.getLastTeleportOrigin() != null)
                {
                    WarpPoint death = info.getLastTeleportOrigin();
                    info.setLastTeleportOrigin(new WarpPoint(sender));
                    EntityPlayerMP player = (EntityPlayerMP) sender;
                    TeleportCenter.teleport(death, player);
                }
                else
                {
                    OutputHandler.chatError(sender, "You have nowhere to get back to");
                }
                justDied.remove(sender.getPersistentID());
                return;
            }
            else
            {
                OutputHandler.chatError(sender, "You have nowhere to get back to");
            }
        }
        else if (PermissionsManager.checkPermission(sender, TeleportModule.PERM_BACK_ONTP))
        {
            PlayerInfo info = PlayerInfo.getPlayerInfo(sender.getPersistentID());
            if (info.getLastTeleportOrigin() != null)
            {
                WarpPoint back = info.getLastTeleportOrigin();
                info.setLastTeleportOrigin(new WarpPoint(sender));
                EntityPlayerMP player = (EntityPlayerMP) sender;
                TeleportCenter.teleport(back, player);
            }
            else
            {
View Full Code Here

TOP

Related Classes of com.forgeessentials.util.selections.WarpPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.