Package com.forgeessentials.util.selections

Examples of com.forgeessentials.util.selections.WorldPoint


    @Override
    public String getPermissionProperty(EntityPlayer player, String permissionNode)
    {
        UserIdent ident = new UserIdent(player);
        return getPermission(ident, new WorldPoint(player), null, getPlayerGroups(ident), permissionNode, true);
    }
View Full Code Here


    // ------------------------------------------------------------

    @Override
    public boolean checkUserPermission(UserIdent ident, String permissionNode)
    {
        return checkBooleanPermission(getPermission(ident, ident.hasPlayer() ? new WorldPoint(ident.getPlayer()) : null, null, getPlayerGroups(ident),
                permissionNode, false));
    }
View Full Code Here

    }

    @Override
    public String getUserPermissionProperty(UserIdent ident, String permissionNode)
    {
        return getPermission(ident, ident.hasPlayer() ? new WorldPoint(ident.getPlayer()) : null, null, getPlayerGroups(ident), permissionNode, true);
    }
View Full Code Here

  public void processCommandPlayer(EntityPlayer sender, String[] args)
  {
    /*
     * Get the right zone. If nothing valid is given, defaults to the senders position.
     */
    Zone zone = APIRegistry.perms.getZoneAt(new WorldPoint(sender));
    if (args.length > 0)
    {
      if (args[0].equalsIgnoreCase("world"))
      {
        zone = APIRegistry.perms.getWorldZone(sender.worldObj);
View Full Code Here

    // Sub of edit and del
    if (args.length == 4 && args[1].equalsIgnoreCase("edit") && args[2].equalsIgnoreCase("del"))
    {
      try
      {
        Zone zone = APIRegistry.perms.getZoneAt(new WorldPoint((Entity) sender));
        if (args[0].equalsIgnoreCase("world"))
        {
          zone = APIRegistry.perms.getWorldZone(((Entity) sender).worldObj);
        }
        if (args[0].equalsIgnoreCase("global"))
        {
          zone = APIRegistry.perms.getServerZone();
        }
        // TODO: Identify zones by unique names
        // if (APIRegistry.perms.doesZoneExist(args[0]))
        // {
        // zone = APIRegistry.perms.getZone(args[0]);
        // }
        AutoPromote ap = AutoPromoteManager.instance().map.get(zone.toString());
        if (ap == null)
        {
          AutoPromoteManager.instance().map.put(zone.getId(), new AutoPromote(zone.getId(), false));
          ap = AutoPromoteManager.instance().map.get(zone.toString());
        }
        return getListOfStringsFromIterableMatchingLastWord(args, ap.getList());
      }
      catch (Exception e)
      {
      }
    }
    // Sub of edit and add
    if (args.length == 5 && args[1].equalsIgnoreCase("edit") && args[2].equalsIgnoreCase("add"))
    {
      try
      {
        Zone zone = APIRegistry.perms.getZoneAt(new WorldPoint((Entity) sender));
        if (args[0].equalsIgnoreCase("world"))
        {
          zone = APIRegistry.perms.getWorldZone(((Entity) sender).worldObj);
        }
        if (args[0].equalsIgnoreCase("global"))
View Full Code Here

    @Override
    public void invalidate()
    {
        super.invalidate();

        WorldPoint point = new WorldPoint(this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord);
        Grave grave = ModuleAfterlife.instance.deathchest.gravemap.get(point.toString());
        if (grave == null)
        {
            return;
        }
        if (grave.protEnable)
        {
            UserIdent owner = new UserIdent(grave.owner);
            if (owner.hasPlayer())
            {
                //createPlayerSkull(owner.getPlayer(), worldObj, point.getX(), point.getY(), point.getZ());
                worldObj.setBlock(point.getX(), point.getY(), point.getZ(), Blocks.chest);
            }
        }
        else
        {
            ModuleAfterlife.instance.deathchest.removeGrave(grave, true);
View Full Code Here

    else
    {
      UserIdent ident = new UserIdent(sender);
      switch (args[0].toLowerCase()) {
      case "here":
        APIRegistry.perms.setPlayerPermissionProperty(ident, FEPermissions.SPAWN, new WorldPoint(sender).toString());
        break;
      case "bed":
        APIRegistry.perms.setPlayerPermissionProperty(ident, FEPermissions.SPAWN, "bed");
        break;
      case "clear":
View Full Code Here

        }
        if (!PermissionsManager.checkPermission(e.entityPlayer, PERMISSION_MAKE))
        {
            return;
        }
        WorldPoint point = new WorldPoint(e.entityPlayer);
        if (point.getY() < 0)
        {
            OutputHandler.chatWarning(e.entityPlayer, "No deathchest for you as you fell out of the world!");
            return;
        }
        World world = e.entityPlayer.worldObj;

        // get height for grave
        point.setY(FunctionHelper.placeInWorld(world, point.getX(), point.getY(), point.getZ(), enableFencePost ? 2 : 1));
        e.setCanceled(true);

        if (enableFencePost)
        {
            world.setBlock(point.getX(), point.getY(), point.getZ(), Blocks.fence);
            point.setY(point.getY() + 1);
        }

        gravemap.put(point.toString(), new Grave(point, e.entityPlayer, e.drops, this));
        FEskullTe.createPlayerSkull(e.entityPlayer, world, point.getX(), point.getY(), point.getZ());
    }
View Full Code Here

            return;
        }

        if (e.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR)
        {
            WorldPoint point = new WorldPoint(e.entity.worldObj, e.x, e.y, e.z);
            if (gravemap.containsKey(point.toString()))
            {
                Grave grave = gravemap.get(point.toString());
                Block block = e.entity.worldObj.getBlock(e.x, e.y, e.z);
                if (block == Blocks.skull || block == Blocks.chest)
                {
                    if (!grave.canOpen(e.entityPlayer))
                    {
View Full Code Here

    }

    @SubscribeEvent
    public void mineGrave(BreakEvent e)
    {
        WorldPoint point = new WorldPoint(e.world, e.x, e.y, e.z); // the grave, or fencepost if fence is enabled
        WorldPoint point2 = new WorldPoint(e.world, e.x, e.y + 1, e.z); // the grave, if fencepost is enabled
        if (e.world.isRemote)
        {
            return;
        }

        if (enableFencePost)
        {
            if (gravemap.containsKey(point2.toString()))
            {
                e.setCanceled(true);
                if (e.world.getBlock(e.x, e.y, e.z) == Blocks.fence)
                {
                    OutputHandler.chatError(e.getPlayer(), "You may not defile the grave of a player.");
                }
                else
                {
                    Grave grave = gravemap.get(point2.toString());
                    removeGrave(grave, true);
                }
            }
            else if (gravemap.containsKey(point.toString()))
            {
View Full Code Here

TOP

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

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.