Examples of PlayerInfo


Examples of com.forgeessentials.util.PlayerInfo

    } else {
      wandName = "your hands";
      wandId = "hands";
    }

        PlayerInfo info = PlayerInfo.getPlayerInfo(sender.getPersistentID());

        // Check for rebind
        boolean rebind = args.length > 0 && args[0].equalsIgnoreCase("rebind");
       
    // Check for unbind
    if (!rebind && ((info.isWandEnabled() && info.getWandID().equals(wandId)) | (args.length > 0 && args[0].equalsIgnoreCase("unbind")))) {
      OutputHandler.sendMessage(sender, EnumChatFormatting.LIGHT_PURPLE + "Wand unbound from " + wandName);
      info.setWandEnabled(false);
      return;
    }

    // Check for permissions
    if (!checkCommandPermission(sender))
        throw new CommandException(FEPermissions.MSG_NO_COMMAND_PERM);

    if (args.length > 0 && !rebind) {
      Pair<String, Integer> data = FunctionHelper.parseIdAndMetaFromString(args[0], false);
      wandItem = GameData.getItemRegistry().getObject(data.getLeft());
      wandId = wandItem.getUnlocalizedName();
      wandDmg = data.getRight();
      if (wandDmg == -1) {
        wandDmg = 0;
      }
    }
   
    // Bind wand
    info.setWandEnabled(true);
    info.setWandID(wandId);
    info.setWandDmg(wandDmg);
    OutputHandler.chatConfirmation(sender, "Wand bound to " + wandName);
    }
View Full Code Here

Examples of com.forgeessentials.util.PlayerInfo

    }

    @Override
    public boolean canPlayerUseCommand(EntityPlayer player)
    {
        PlayerInfo info = PlayerInfo.getPlayerInfo(player.getPersistentID());
        if (info.isWandEnabled())
        {
            return true;
        }
        else
        {
View Full Code Here

Examples of com.forgeessentials.util.PlayerInfo

      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
        {
View Full Code Here

Examples of com.forgeessentials.util.PlayerInfo

                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

Examples of com.forgeessentials.util.PlayerInfo

        {
            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
        {
View Full Code Here

Examples of com.forgeessentials.util.PlayerInfo

        target = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
      }
      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

Examples of com.forgeessentials.util.PlayerInfo

        {
          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

Examples of com.forgeessentials.util.PlayerInfo

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

Examples of com.forgeessentials.util.PlayerInfo

    }

    @Override
    public void processCommandPlayer(EntityPlayer sender, String[] args)
    {
        PlayerInfo info = PlayerInfo.getPlayerInfo(sender.getPersistentID());
        info.clearSelection();

        OutputHandler.chatConfirmation(sender, "Selection cleared.");
    }
View Full Code Here

Examples of com.forgeessentials.util.PlayerInfo

        {
            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
TOP
Copyright © 2018 www.massapi.com. 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.