Package org.anjocaido.groupmanager.dataholder

Examples of org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder


        }
        return handler.getGroup(playerName);
    }

    private void setPlayerValue(String worldName, String playerName, String node, Object value) {
        OverloadedWorldHolder owh;
        if (worldName == null) {
            owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
        } else {
            owh = groupManager.getWorldsHolder().getWorldData(worldName);
        }
        if (owh == null) {
            return;
        }
        User user = owh.getUser(playerName);
        if (user == null) {
            return;
        }
        user.getVariables().addVar(node, value);
    }
View Full Code Here


        }
        user.getVariables().addVar(node, value);
    }

    private void setGroupValue(String worldName, String groupName, String node, Object value) {
        OverloadedWorldHolder owh;
        if (worldName == null) {
            owh = groupManager.getWorldsHolder().getDefaultWorld();
        } else {
            owh = groupManager.getWorldsHolder().getWorldData(worldName);
        }
        if (owh == null) {
            return;
        }
        Group group = owh.getGroup(groupName);
        if (group == null) {
            return;
        }
        group.getVariables().addVar(node, value);
    }
View Full Code Here

        return handler.permission(playerName, permission);
    }

    @Override
    public boolean playerAdd(String worldName, String playerName, String permission) {
        OverloadedWorldHolder owh;
        if (worldName == null) {
            owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
        } else {
            owh = groupManager.getWorldsHolder().getWorldData(worldName);
        }
        if (owh == null) {
            return false;
        }

        User user = owh.getUser(playerName);
        if (user == null) {
            return false;
        }

        user.addPermission(permission);
View Full Code Here

        return true;
    }

    @Override
    public boolean playerRemove(String worldName, String playerName, String permission) {
        OverloadedWorldHolder owh;
        if (worldName == null) {
            owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
        } else {
            owh = groupManager.getWorldsHolder().getWorldData(worldName);
        }
        if (owh == null) {
            return false;
        }

        User user = owh.getUser(playerName);
        if (user == null) {
            return false;
        }

        user.removePermission(permission);
View Full Code Here

        return true;
    }

    @Override
    public boolean groupHas(String worldName, String groupName, String permission) {
        OverloadedWorldHolder owh;
        if (worldName == null) {
            owh = groupManager.getWorldsHolder().getDefaultWorld();
        } else {
            owh = groupManager.getWorldsHolder().getWorldData(worldName);
        }
        if (owh == null) {
            return false;
        }

        Group group = owh.getGroup(groupName);
        if (group == null) {
            return false;
        }

        return group.hasSamePermissionNode(permission);
View Full Code Here

        return group.hasSamePermissionNode(permission);
    }

    @Override
    public boolean groupAdd(String worldName, String groupName, String permission) {
        OverloadedWorldHolder owh;
        if (worldName == null) {
            owh = groupManager.getWorldsHolder().getDefaultWorld();
        } else {
            owh = groupManager.getWorldsHolder().getWorldData(worldName);
        }
        if (owh == null) {
            return false;
        }

        Group group = owh.getGroup(groupName);
        if (group == null) {
            return false;
        }

        group.addPermission(permission);
View Full Code Here

        return true;
    }

    @Override
    public boolean groupRemove(String worldName, String groupName, String permission) {
        OverloadedWorldHolder owh;
        if (worldName == null) {
            owh = groupManager.getWorldsHolder().getDefaultWorld();
        } else {
            owh = groupManager.getWorldsHolder().getWorldData(worldName);
        }
        if (owh == null) {
            return false;
        }

        Group group = owh.getGroup(groupName);
        if (group == null) {
            return false;
        }

        group.removePermission(permission);
View Full Code Here

        return handler.inGroup(playerName, groupName);
    }

    @Override
    public boolean playerAddGroup(String worldName, String playerName, String groupName) {
        OverloadedWorldHolder owh;
        if (worldName == null) {
            owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
        } else {
            owh = groupManager.getWorldsHolder().getWorldData(worldName);
        }
        if (owh == null) {
            return false;
        }
        User user = owh.getUser(playerName);
        if (user == null) {
            return false;
        }
        Group group = owh.getGroup(groupName);
        if (group == null) {
            return false;
        }
        if (user.getGroup().equals(owh.getDefaultGroup())) {
            user.setGroup(group);
        } else if (group.getInherits().contains(user.getGroup().getName().toLowerCase())) {
            user.setGroup(group);
        } else {
            user.addSubGroup(group);
View Full Code Here

        return true;
    }

    @Override
    public boolean playerRemoveGroup(String worldName, String playerName, String groupName) {
        OverloadedWorldHolder owh;
        if (worldName == null) {
            owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
        } else {
            owh = groupManager.getWorldsHolder().getWorldData(worldName);
        }
        if (owh == null) {
            return false;
        }
        User user = owh.getUser(playerName);
        if (user == null) {
            return false;
        }
        boolean success = false;
        if (user.getGroup().getName().equalsIgnoreCase(groupName)) {
            user.setGroup(owh.getDefaultGroup());
            success = true;
        } else {
            Group group = owh.getGroup(groupName);
            if (group != null) {
                success = user.removeSubGroup(group);
            }
        }
        if (success) {
View Full Code Here

    @Override
    public String[] getGroups() {
        Set<String> groupNames = new HashSet<String>();
        for (World world : Bukkit.getServer().getWorlds()) {
            OverloadedWorldHolder owh = groupManager.getWorldsHolder().getWorldData(world.getName());
            if (owh == null) {
                continue;
            }
            Collection<Group> groups = owh.getGroupList();
            if (groups == null) {
                continue;
            }
            for (Group group : groups) {
                groupNames.add(group.getName());
View Full Code Here

TOP

Related Classes of org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder

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.