Package com.bekvon.bukkit.residence.event

Examples of com.bekvon.bukkit.residence.event.ResidenceFlagChangeEvent


    public boolean setPlayerFlag(Player player, String targetPlayer, String flag, String flagstate, boolean resadmin) {
        if(validFlagGroups.containsKey(flag))
            return this.setFlagGroupOnPlayer(player, targetPlayer, flag, flagstate, resadmin);
        FlagState state = FlagPermissions.stringToFlagState(flagstate);
        if (checkCanSetFlag(player, flag, state, false, resadmin)) {
            ResidenceFlagChangeEvent fc = new ResidenceFlagChangeEvent(residence, player, flag, ResidenceFlagChangeEvent.FlagType.PLAYER, state, targetPlayer);
            Residence.getServ().getPluginManager().callEvent(fc);
            if (fc.isCancelled())
                return false;
            if(super.setPlayerFlag(targetPlayer, flag, state))
            {
                player.sendMessage(ChatColor.GREEN+Residence.getLanguage().getPhrase("FlagSet"));
                return true;
View Full Code Here


        if(validFlagGroups.containsKey(flag))
            return this.setFlagGroupOnGroup(player, flag, group, flagstate, resadmin);
        FlagState state = FlagPermissions.stringToFlagState(flagstate);
        if (checkCanSetFlag(player, flag, state, false, resadmin)) {
            if (Residence.getPermissionManager().hasGroup(group)) {
                ResidenceFlagChangeEvent fc = new ResidenceFlagChangeEvent(residence, player, flag, ResidenceFlagChangeEvent.FlagType.GROUP, state, group);
                Residence.getServ().getPluginManager().callEvent(fc);
                if (fc.isCancelled())
                    return false;
                if(super.setGroupFlag(group, flag, state))
                {
                    player.sendMessage(ChatColor.GREEN+Residence.getLanguage().getPhrase("FlagSet"));
                    return true;
View Full Code Here

    public boolean setFlag(Player player, String flag, String flagstate, boolean resadmin) {
        if(validFlagGroups.containsKey(flag))
            return this.setFlagGroup(player, flag, flagstate, resadmin);
        FlagState state = FlagPermissions.stringToFlagState(flagstate);
        if (checkCanSetFlag(player, flag, state, true, resadmin)) {
            ResidenceFlagChangeEvent fc = new ResidenceFlagChangeEvent(residence,player,flag,ResidenceFlagChangeEvent.FlagType.RESIDENCE,state,null);
            Residence.getServ().getPluginManager().callEvent(fc);
            if(fc.isCancelled())
                return false;
            if(super.setFlag(flag, state))
            {
                player.sendMessage(ChatColor.GREEN+Residence.getLanguage().getPhrase("FlagSet"));
                return true;
View Full Code Here

        return false;
    }
   
    public boolean removeAllPlayerFlags(Player player, String targetPlayer, boolean resadmin) {
        if (this.hasResidencePermission(player, false) || resadmin) {
            ResidenceFlagChangeEvent fc = new ResidenceFlagChangeEvent(residence, player, "ALL", ResidenceFlagChangeEvent.FlagType.RESIDENCE, FlagState.NEITHER, null);
            Residence.getServ().getPluginManager().callEvent(fc);
            if (fc.isCancelled()) {
                return false;
            }
            super.removeAllPlayerFlags(targetPlayer);
            player.sendMessage(ChatColor.GREEN+Residence.getLanguage().getPhrase("FlagSet"));
            return true;
View Full Code Here

        return false;
    }

    public boolean removeAllGroupFlags(Player player, String group, boolean resadmin) {
        if (this.hasResidencePermission(player, false) || resadmin) {
            ResidenceFlagChangeEvent fc = new ResidenceFlagChangeEvent(residence, player, "ALL", ResidenceFlagChangeEvent.FlagType.GROUP, FlagState.NEITHER, null);
            Residence.getServ().getPluginManager().callEvent(fc);
            if (fc.isCancelled()) {
                return false;
            }
            super.removeAllGroupFlags(group);
            player.sendMessage(ChatColor.GREEN+Residence.getLanguage().getPhrase("FlagSet"));
            return true;
View Full Code Here

    }


    @Override
    public boolean setFlag(String flag, FlagState state) {
        ResidenceFlagChangeEvent fc = new ResidenceFlagChangeEvent(residence, null,flag,ResidenceFlagChangeEvent.FlagType.RESIDENCE,state,null);
        Residence.getServ().getPluginManager().callEvent(fc);
        if(fc.isCancelled())
            return false;
        return super.setFlag(flag, state);
    }
View Full Code Here

        return super.setFlag(flag, state);
    }

    @Override
    public boolean setGroupFlag(String group, String flag, FlagState state) {
        ResidenceFlagChangeEvent fc = new ResidenceFlagChangeEvent(residence, null,flag,ResidenceFlagChangeEvent.FlagType.GROUP,state,group);
        Residence.getServ().getPluginManager().callEvent(fc);
        if(fc.isCancelled())
            return false;
        return super.setGroupFlag(group, flag, state);
    }
View Full Code Here

        return super.setGroupFlag(group, flag, state);
    }

    @Override
    public boolean setPlayerFlag(String player, String flag, FlagState state) {
        ResidenceFlagChangeEvent fc = new ResidenceFlagChangeEvent(residence, null,flag,ResidenceFlagChangeEvent.FlagType.PLAYER,state, player);
        Residence.getServ().getPluginManager().callEvent(fc);
        if(fc.isCancelled())
            return false;
        return super.setPlayerFlag(player,flag,state);
    }
View Full Code Here

TOP

Related Classes of com.bekvon.bukkit.residence.event.ResidenceFlagChangeEvent

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.