Package net.sacredlabyrinth.phaed.simpleclans

Examples of net.sacredlabyrinth.phaed.simpleclans.ClanPlayer


    {
        if (plugin.getSettingsManager().isTamableMobsSharing())
        {
            if (event.getEntity() instanceof Wolf && event.getTarget() instanceof Player)
            {
                ClanPlayer cp = plugin.getClanManager().getClanPlayer((Player) event.getTarget());
                Tameable wolf = (Tameable) event.getEntity();
                if (wolf.isTamed())
                {
                    if (cp.getClan().isMember((Player) wolf.getOwner()))
                    {
                        // cancels the event if the attacker is one out of his clan
                        event.setCancelled(true);
                    }
                }
View Full Code Here


            {
                if (sub.getEntity() instanceof Wolf && sub.getDamager() instanceof Player)
                {
                    attacker = (Player) sub.getDamager();
                    Wolf wolf = (Wolf) sub.getEntity();
                    ClanPlayer cp = plugin.getClanManager().getClanPlayer(attacker);
                    if (wolf.isTamed())
                    {
                        if (cp.getClan().isMember((Player) wolf.getOwner()))
                        {
                            // Sets the wolf to friendly if the attacker is one out of his clan
                            wolf.setAngry(false);
                        }
                    }
                }
            }

            if (sub.getEntity() instanceof Player && sub.getDamager() instanceof Arrow)
            {
                Arrow arrow = (Arrow) sub.getDamager();

                if (arrow.getShooter() instanceof Player)
                {
                    attacker = (Player) arrow.getShooter();
                    victim = (Player) sub.getEntity();
                }
            }
        }

        if (victim != null)
        {
            if (plugin.getSettingsManager().isBlacklistedWorld(victim.getLocation().getWorld().getName()))
            {
                return;
            }
        }

        if (attacker != null && victim != null)
        {
            ClanPlayer acp = plugin.getClanManager().getClanPlayer(attacker);
            ClanPlayer vcp = plugin.getClanManager().getClanPlayer(victim);


            Clan vclan = vcp == null ? null : vcp.getClan();
            Clan aclan = acp == null ? null : acp.getClan();


            if (plugin.getSettingsManager().isPvpOnlywhileInWar())
            {
                // if one doesn't have clan then they cant be at war

                if (aclan == null || vclan == null)
                {
                    event.setCancelled(true);
                    return;
                }

                if (plugin.getPermissionsManager().has(victim, "simpleclans.mod.nopvpinwar")
                        && attacker != null && victim != null)
                {
                    event.setCancelled(true);
                    return;
                }

                // if not warring no pvp

                if (!aclan.isWarring(vclan))
                {
                    event.setCancelled(true);
                    return;
                }
            }

            if (vclan != null)
            {
                if (aclan != null)
                {
                    // personal ff enabled, allow damage

                    if (vcp.isFriendlyFire())
                    {
                        return;
                    }

                    // clan ff enabled, allow damage
View Full Code Here

    {
        SimpleClans plugin = SimpleClans.getInstance();

        if (plugin.getPermissionsManager().has(player, "simpleclans.member.resign"))
        {
            ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);

            if (cp != null)
            {
                Clan clan = cp.getClan();

                if (!clan.isLeader(player) || clan.getLeaders().size() > 1)
                {
                    clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("0.has.resigned"), Helper.capitalize(player.getName())));
                    if (SimpleClans.getInstance().hasUUID())
View Full Code Here

            if (!plugin.getSettingsManager().getClanChatEnable())
            {
                return;
            }

            ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);

            if (cp == null)
            {
                return;
            }

            if (cp.getTag().equalsIgnoreCase(command))
            {
                event.setCancelled(true);

                if (split.length > 1)
                {
                    plugin.getClanManager().processClanChat(player, cp.getTag(), Helper.toMessage(Helper.removeFirst(split)));
                }
            }
        }
        if (command.equals("."))
        {
            if (!plugin.getSettingsManager().getClanChatEnable())
            {
                return;
            }

            ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);

            if (cp == null)
            {
                return;
            }

            event.setCancelled(true);

            if (split.length > 1)
            {
                plugin.getClanManager().processClanChat(player, cp.getTag(), Helper.toMessage(Helper.removeFirst(split)));
            }
        }
        else if (command.equalsIgnoreCase(plugin.getSettingsManager().getCommandAlly()))
        {
            if (!plugin.getSettingsManager().isAllyChatEnable())
View Full Code Here

        {
            return;
        }

        String message = event.getMessage();
        ClanPlayer cp = plugin.getClanManager().getClanPlayer(event.getPlayer());

        if (cp != null)
        {
            if (cp.getChannel().equals(ClanPlayer.Channel.CLAN))
            {
                plugin.getClanManager().processClanChat(event.getPlayer(), message);
                event.setCancelled(true);
            }
            else if (cp.getChannel().equals(ClanPlayer.Channel.ALLY))
            {
                plugin.getClanManager().processAllyChat(event.getPlayer(), message);
                event.setCancelled(true);
            }
        }

        if (!plugin.getPermissionsManager().has(event.getPlayer(), "simpleclans.mod.nohide"))
        {
            boolean isClanChat = event.getMessage().contains("" + ChatColor.RED + ChatColor.WHITE + ChatColor.RED + ChatColor.BLACK);
            boolean isAllyChat = event.getMessage().contains("" + ChatColor.AQUA + ChatColor.WHITE + ChatColor.AQUA + ChatColor.BLACK);

            for (Iterator iter = event.getRecipients().iterator(); iter.hasNext(); )
            {
                Player player = (Player) iter.next();

                ClanPlayer rcp = plugin.getClanManager().getClanPlayer(player);

                if (rcp != null)
                {
                    if (!rcp.isClanChat())
                    {
                        if (isClanChat)
                        {
                            iter.remove();
                            continue;
                        }
                    }

                    if (!rcp.isAllyChat())
                    {
                        if (isAllyChat)
                        {
                            iter.remove();
                            continue;
                        }
                    }

                    if (!rcp.isGlobalChat())
                    {
                        if (!isAllyChat && !isClanChat)
                        {
                            iter.remove();
                        }
View Full Code Here

TOP

Related Classes of net.sacredlabyrinth.phaed.simpleclans.ClanPlayer

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.