Package com.forgeessentials.api.permissions

Examples of com.forgeessentials.api.permissions.WorldZone


            help(sender);
        }
        else
        {
            // Get world
            WorldZone worldZone = null;
            if (sender instanceof EntityPlayerMP)
            {
                worldZone = APIRegistry.perms.getWorldZone(((EntityPlayerMP) sender).dimension);
            }
View Full Code Here


            // Create world-zones
            for (Map<String, Object> zoneData : zonesData)
                if (zoneData.get("type").equals(1))
                {
                    WorldZone zone = new WorldZone(serverZone, (Integer) zoneData.get("dimension"), (Integer) zoneData.get("id"));
                    zones.put(zone.getId(), zone);
                }

            // Create area-zones
            for (Map<String, Object> zoneData : zonesData)
                if (zoneData.get("type").equals(2))
                {
                    WorldZone parentZone = (WorldZone) zones.get(zoneData.get("parent_id"));
                    if (parentZone != null)
                    {
                        AreaBase area = AreaBase.fromString((String) zoneData.get("area"));
                        if (area != null)
                        {
View Full Code Here

     */
    @Override
    public String getPermission(UserIdent ident, WorldPoint point, WorldArea area, Collection<String> groups, String permissionNode, boolean isProperty)
    {
        // Get world zone
        WorldZone worldZone = null;
        if (point != null)
            worldZone = getWorldZone(point.getDimension());
        else if (area != null)
            worldZone = getWorldZone(area.getDimension());

        // Get zones in correct order
        List<Zone> zones = new ArrayList<Zone>();
        if (worldZone != null)
        {
            for (Zone zone : worldZone.getAreaZones())
            {
                if (point != null && zone.isInZone(point) || area != null && zone.isInZone(area))
                {
                    zones.add(zone);
                }
View Full Code Here

    }

    @Override
    public WorldZone getWorldZone(int dimensionId)
    {
        WorldZone zone = rootZone.getServerZone().getWorldZones().get(dimensionId);
        if (zone == null)
        {
            zone = new WorldZone(getServerZone(), dimensionId);
        }
        return zone;
    }
View Full Code Here

    }

    @Override
    public List<Zone> getZonesAt(WorldPoint worldPoint)
    {
        WorldZone w = getWorldZone(worldPoint.getDimension());
        List<Zone> result = new ArrayList<Zone>();
        for (AreaZone zone : w.getAreaZones())
            if (zone.isInZone(worldPoint))
                result.add(zone);
        result.add(w);
        result.add(w.getParent());
        return result;
    }
View Full Code Here

    }

    @Override
    public List<AreaZone> getAreaZonesAt(WorldPoint worldPoint)
    {
        WorldZone w = getWorldZone(worldPoint.getDimension());
        List<AreaZone> result = new ArrayList<AreaZone>();
        for (AreaZone zone : w.getAreaZones())
            if (zone.isInZone(worldPoint))
                result.add(zone);
        return result;
    }
View Full Code Here

                    maxId = Math.max(maxId, worldId);

                    int dimensionID = Integer.parseInt(worldProperties.getProperty("dimId"));

                    // Create WorldZone and load permissions
                    WorldZone worldZone = new WorldZone(serverZone, dimensionID, worldId);
                    loadZonePermissions(worldPath, worldZone);

                    for (File areaPath : worldPath.listFiles(directoryFilter))
                    {
                        try
View Full Code Here

TOP

Related Classes of com.forgeessentials.api.permissions.WorldZone

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.