Package com.forgeessentials.util.selections

Examples of com.forgeessentials.util.selections.WarpPoint


    public void onPlayerDeath(LivingDeathEvent e)
    {
        if (e.entityLiving instanceof EntityPlayer)
        {
            EntityPlayerMP player = (EntityPlayerMP) e.entityLiving;
            PlayerInfo.getPlayerInfo(player.getPersistentID()).setLastDeathLocation(new WarpPoint(player));
        }
    }
View Full Code Here


        if (e.entity instanceof EntityPlayerMP)
        {
            EntityPlayerMP player = (EntityPlayerMP) e.entity;
            if (!PlayerInfo.playerInfoExists(player.getPersistentID()))
            {
                WarpPoint p = getPlayerSpawn(player, null);
                if (p != null)
                {
                    FunctionHelper.teleportPlayer(player, p);
                    player.posX = p.xd;
                    player.posY = p.yd;
View Full Code Here

    }
   
    @SubscribeEvent
    public void doRespawn(PlayerRespawnEvent e)
    {
        WarpPoint lastDeathLocation = PlayerInfo.getPlayerInfo(e.player.getPersistentID()).getLastDeathLocation();
        if (lastDeathLocation == null)
            lastDeathLocation = new WarpPoint(e.player);
       
        WarpPoint p = getPlayerSpawn(e.player, lastDeathLocation);
        if (p != null)
        {
            FunctionHelper.teleportPlayer((EntityPlayerMP) e.player, p);
            e.player.posX = p.xd;
            e.player.posY = p.yd;
View Full Code Here

                World world = player.worldObj;
                if (!world.provider.canRespawnHere())
                {
                    world = DimensionManager.getWorld(0);
                }
                PlayerInfo.getPlayerInfo(player.getPersistentID()).setLastTeleportOrigin(new WarpPoint(player));
                // Doesnt work
                // FunctionHelper.setPlayer(player, new Point(spawn), world);
                //player.playerNetServerHandler.setPlayerLocation(spawn.posX, spawn.posY, spawn.posZ, player.rotationYaw, player.rotationPitch);
                if (sleepPoint != null)
                {
View Full Code Here

    @SubscribeEvent
    public void getCoords(PlayerSleepInBedEvent e)
    {
        if (sleepPoint == null)
        {
            this.sleepPoint = new WarpPoint(e.entityPlayer.dimension, e.x, e.y, e.z, 0, 0);
        }
        else
        {
            this.sleepPoint.setX(e.x);
            this.sleepPoint.setY(e.y);
View Full Code Here

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

    @Override
    public void processCommandPlayer(EntityPlayer sender, String[] args)
    {
        if (args.length == 0)
        {
            WarpPoint home = PlayerInfo.getPlayerInfo(sender.getPersistentID()).getHome();
            if (home == null)
            {
                OutputHandler.chatError(sender, "No home set. Try this: [here|x, y, z]");
            }
            else
            {
                EntityPlayerMP player = (EntityPlayerMP) sender;
                PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(player.getPersistentID());
                playerInfo.setLastTeleportOrigin(new WarpPoint(player));
                CommandBack.justDied.remove(player.getPersistentID());
                TeleportCenter.teleport(home, player);
            }
        }
        else if (PermissionsManager.checkPermission(sender, TeleportModule.PERM_HOME_SET))
        {
            if (args.length >= 1 && (args[0].equals("here") || args[0].equals("set")))
            {
                WarpPoint p = new WarpPoint(sender);
                PlayerInfo info = PlayerInfo.getPlayerInfo(sender.getPersistentID());
                info.setHome(p);
                info.save();               
                OutputHandler.chatConfirmation(sender, String.format("Home set to: %1$d, %2$d, %3$d", p.getX(), p.getY(), p.getZ()));
            }
        }
    }
View Full Code Here

            double x = parseDouble(sender, args[0], sender.posX);
            double y = parseDouble(sender, args[1], sender.posY);
            double z = parseDouble(sender, args[2], sender.posZ);
            EntityPlayerMP player = (EntityPlayerMP) sender;
            PlayerInfo playerInfo = PlayerInfo.getPlayerInfo(player.getPersistentID());
            playerInfo.setLastTeleportOrigin(new WarpPoint(player));
            CommandBack.justDied.remove(player.getPersistentID());
            TeleportCenter.teleport(new WarpPoint(player.dimension, x, y, z, player.cameraPitch, player.cameraYaw), player);
        }
        else
        {
            this.error(sender);
        }
View Full Code Here

    {
        id = ModuleTickets.getNextID();
        creator = sender.getCommandSenderName();
        if (sender instanceof EntityPlayer)
        {
            point = new WarpPoint((EntityPlayer) sender);
        }
        this.category = category;
        this.message = message;
    }
View Full Code Here

      }
      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]));
        }
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.