Package com.epicsagaonline.bukkit.EpicZones.objects

Examples of com.epicsagaonline.bukkit.EpicZones.objects.EpicZonePlayer


    public EZZoneChild(String[] data, CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            boolean admin = PermissionsManager.hasPermission(player, "epiczones.admin") || player.isOp();
            if (admin) //Owners are not allowed to modify children.
            {
                if (ezp.getMode() == EpicZoneMode.ZoneEdit)
                {
                    if (data.length > 2)
                    {
                        String cmd = data[1];
                        for (int i = 2; i < data.length; i++)
                        {
                            String tag = data[i].replaceAll("[^a-zA-Z0-9_]", "");
                            if (tag.length() > 0 && General.myZones.get(tag) != null)
                            {
                                if (cmd.equalsIgnoreCase("add"))
                                {
                                    ezp.getEditZone().addChildTag(tag);
                                }
                                else if (cmd.equalsIgnoreCase("remove"))
                                {
                                    ezp.getEditZone().removeChild(tag);
                                }
                            }
                        }
                        Message.Send(sender, Message_ID.Info_00018_Updated_Children);
                    }
View Full Code Here


    public EZZoneCreate(String[] data, CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            if (ezp.getAdmin()) // Only admins can create zones
            {
                if (ezp.getMode() == EpicZoneMode.None)
                {
                    if (data.length > 1 && data[1].length() > 0)
                    {
                        String tag = data[1].replaceAll("[^a-zA-Z0-9_]", "");
                        if (General.myZones.get(tag) == null)
                        {

                            EpicZone zone = new EpicZone();

                            zone.setTag(tag);
                            zone.setName(tag);
                            zone.setWorld(player.getWorld().getName());
                            Log.Write(player.getWorld().getName());
                            Log.Write(General.myGlobalZones.get(player.getWorld().getName().toLowerCase()).getName());
                            zone.setDefaults(General.myGlobalZones.get(player.getWorld().getName().toLowerCase()));
                            ezp.setEditZone(zone);
                            ezp.setMode(EpicZoneMode.ZoneDraw);
                            Message.Send(sender, Message_ID.Mode_00020_Draw_StartAfterNew);
                        }
                        else
                        {
                            Message.Send(sender, Message_ID.Warning_00103_Zone_X_Exists, new String[]{tag});
View Full Code Here

    public EZZoneFlag(String[] data, CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            if (ezp.getAdmin()) //Owners are not allowed to edit flags on a zone.
            {
                if (ezp.getMode() == EpicZoneMode.ZoneEdit)
                {
                    if (data.length > 2 && data[1].length() > 0 && data[2].length() > 0)
                    {
                        String flag = data[1];
                        String value = "";
View Full Code Here

    public EZZoneDelete(CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            if (ezp.getAdmin()) //Owners are not allowed to delete zones.
            {
                if (ezp.getMode() == EpicZoneMode.ZoneEdit)
                {
                    ezp.setMode(EpicZoneMode.ZoneDeleteConfirm);
                    Message.Send(sender, Message_ID.Info_00104_Mode_ZoneDelete, new String[]{ezp.getEditZone().getTag()});
                }
            }
            else
            {
                new EZZoneHelp(ZoneCommand.DELETE, sender, ezp);
View Full Code Here

public class EZZoneEdit
{
    public EZZoneEdit(String[] data, CommandSender sender)
    {
        EpicZonePlayer ezp;
        if (sender instanceof Player)
        {
            ezp = General.getPlayer(sender.getName());
        }
        else
        {
            ezp = General.getPlayer("console");
        }
        if (ezp != null)
        {
            if (ezp.getMode() == EpicZoneMode.None)
            {
                if (data.length > 1)
                {
                    if (data[1].length() > 0)
                    {
                        if (General.myZones.get(data[1]) != null)
                        {
                            String tag = data[1].replaceAll("[^a-zA-Z0-9_]", "");

                            EpicZone zone = General.myZones.get(tag);
                            if (zone.getType() != ZoneType.GLOBAL)
                            {

                                if (ezp.getAdmin() || zone.isOwner(ezp.getName()))
                                {

                                    ezp.setEditZone(new EpicZone(zone));
                                    ezp.setMode(EpicZoneMode.ZoneEdit);
                                    ezp.getEditZone().ShowPillars();
                                    Message.Send(sender, Message_ID.Info_00105_Mode_Edit, new String[]{tag});

                                }
                                else
                                {
View Full Code Here

        {
            int MAX_HEALTH = 20;
            int MIN_HEALTH = 0;
            if (player.getHealth() <= MAX_HEALTH && player.getHealth() > MIN_HEALTH)
            {
                EpicZonePlayer ezp = General.getPlayer(player.getName());
                if (ezp != null)
                {
                    EpicZone zone = ezp.getCurrentZone();
                    if (zone != null)
                    {
                        if (zone.timeToRegen())
                        {
                            if (ezp.getEnteredZone().before(zone.getAdjustedRegenDelay()))
                            {
                                if (zone.getRegen().getRestDelay() == 0 || (zone.getRegen().getRestDelay() > 0 && ezp.getLastMoved().before(zone.getAdjustedRestDelay())))
                                {
                                    if (zone.getRegen().getAmount() >= 0)
                                    {
                                        int bonus = 0;
                                        if (player.isSleeping())
View Full Code Here

public class Security
{
    public static void UpdatePlayerSecurity(Player player)
    {
        EpicZonePlayer ezp = General.myPlayers.get(player.getName().toLowerCase());
        if (PermissionsManager.hasPermission(player, "epiczones.admin"))
        {
            ezp.setAdmin(true);
        }
        else if (player.isOp())
        {
            ezp.setAdmin(true);
        }
        else
        {
            ezp.setAdmin(false);
        }
    }
View Full Code Here

    public static void UpdatePlayerXYZ(Player player)
    {
        if (General.SpoutEnabled)
        {
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            SpoutPlayer sp = ezp.getSpoutPlayer();
            if (sp != null)
            {
                if (sp.isSpoutCraftEnabled())
                {
                    Location loc = player.getLocation();
View Full Code Here

    {
        if (player != null)
        {
            if (!myPlayers.containsKey(player.getName().toLowerCase()))
            {
                myPlayers.put(player.getName().toLowerCase(), new EpicZonePlayer(player));
            }
            Security.UpdatePlayerSecurity(player);
        }
        else
        {
            myPlayers.put("console", new EpicZonePlayer("console"));
        }
    }
View Full Code Here

        }
    }

    public static void removePlayer(String playerName)
    {
        EpicZonePlayer ezp = myPlayers.get(playerName.toLowerCase());
        if (ezp != null)
        {
            if (ezp.getMode() != EpicZoneMode.None)
            {
                if (ezp.getEditZone() != null)
                {
                    ezp.getEditZone().HidePillars();
                }
            }
            myPlayers.remove(playerName.toLowerCase());
        }
    }
View Full Code Here

TOP

Related Classes of com.epicsagaonline.bukkit.EpicZones.objects.EpicZonePlayer

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.