Package com.epicsagaonline.bukkit.EpicZones.objects

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


    {

        if (Config.enableRadius)
        {

            EpicZonePlayer ezp = General.getPlayer(player.getName());
            EpicZone globalZone = myGlobalZones.get(player.getWorld().getName().toLowerCase());

            double xSquared = point.x * point.x;
            double ySquared = point.y * point.y;
            double distanceFromCenter = Math.sqrt(xSquared + ySquared);

            if (globalZone != null)
            {
                if (distanceFromCenter <= globalZone.getRadius())
                {
                    if (ezp.getPastBorder())
                    {
                        WarnPlayer(player, ezp, "You are inside the map radius border.");
                        ezp.setPastBorder(false);
                    }
                    return true;
                }
                else
                {
                    if (PermissionsManager.hasPermission(player, "epiczones.ignoremapradius"))
                    {
                        if (!ezp.getPastBorder())
                        {
                            WarnPlayer(player, ezp, "You are outside the map radius border.");
                            ezp.setPastBorder(true);
                        }
                        return true;
                    }
                    else
                    {
View Full Code Here


    public static EpicZone GetZoneForPlayer(@Nullable Player player, String worldName, int playerHeight, Point playerPoint)
    {
        EpicZone result = null;
        if (player != null)
        {
            EpicZonePlayer ezp = getPlayer(player.getName());
            if (ezp.getCurrentZone() != null)
            {
                result = IsPlayerWithinZone(ezp.getCurrentZone(), worldName, playerHeight, playerPoint);
            }
        }
        if (result == null)
        {
            for (String zoneTag : myZones.keySet())
View Full Code Here

    public static boolean PlayerMovementLogic(Player player, Location fromLoc, Location toLoc)
    {
        boolean result = true;
        if (player != null && fromLoc != null && toLoc != null)
        {
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            if (ezp != null)
            {
                if (General.ShouldCheckPlayer(ezp))
                {
                    if (!ezp.isTeleporting())
                    {
                        int playerHeight = toLoc.getBlockY();
                        Point playerPoint = new Point(toLoc.getBlockX(), toLoc.getBlockZ());
                        EpicZone zone;
                        if (General.BorderLogic(playerPoint, player))
                        {
                            zone = General.GetZoneForPlayer(player, toLoc.getWorld().getName(), playerHeight, playerPoint);
                            if (zone != null)
                            {
                                if (ZonePermissionsHandler.hasPermissions(player, zone, "entry"))
                                {
                                    if ((ezp.getCurrentZone() != null && !ezp.getCurrentZone().getTag().equals(zone.getTag())) || ezp.getCurrentZone() == null)
                                    {
                                        if (ezp.getCurrentZone() != null)
                                        {
                                            ezp.setPreviousZoneTag(ezp.getCurrentZone().getTag());
                                            if (ezp.getCurrentZone().getExitText().length() > 0)
                                            {
                                                Message.Send(player, ezp.getCurrentZone().getExitText());
                                            }
                                        }
                                        ezp.setCurrentZone(zone);
                                        if (zone.getEnterText().length() > 0)
                                        {
                                            Message.Send(player, zone.getEnterText());
                                        }
                                        if (General.SpoutEnabled)
                                        {
                                            EpicSpout.UpdatePlayerZone(ezp, zone);
                                        }
                                        ezp.setCurrentLocation(fromLoc);
                                    }
                                }
                                else
                                {
                                    General.WarnPlayer(player, ezp, Message.get(Message.Message_ID.Info_00130_NoPermToEnter, zone.getName()));
                                    ezp.setIsTeleporting(true);
                                    player.teleport(ezp.getCurrentLocation());
                                    ezp.setIsTeleporting(false);
                                    result = false;
                                }
                            }
                        }
                        ezp.Check();
                    }
                    ezp.setHasMoved(true);
                }
            }
        }
        return result;
    }
View Full Code Here

        regen = null;

        PluginDescriptionFile pdfFile = this.getDescription();
        for (String playerName : General.myPlayers.keySet())
        {
            EpicZonePlayer ezp = General.myPlayers.get(playerName);
            if (ezp.getMode() != EpicZoneMode.None)
            {
                if (ezp.getEditZone() != null)
                {
                    ezp.getEditZone().HidePillars();
                }
            }
        }

        General.HeroChatEnabled = false;
View Full Code Here

    public EZZoneOwner(String[] data, CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            if (ezp.getAdmin()) //Owners cannot edit owners on a zone.
            {
                if (ezp.getMode() == EpicZoneMode.ZoneEdit)
                {
                    if (data.length > 2)
                    {
                        String cmd = data[1];
                        for (int i = 2; i < data.length; i++)
                        {
                            if (data[i].length() > 0)
                            {
                                if (cmd.equalsIgnoreCase("add"))
                                {
                                    ezp.getEditZone().addOwner(data[i]);
                                }
                                else if (cmd.equalsIgnoreCase("remove"))
                                {
                                    ezp.getEditZone().removeOwner(data[i]);
                                }
                            }
                        }
                        Message.Send(sender, Message_ID.Info_00026_OwnersUpdated);
                    }
View Full Code Here

public class EZZoneSave
{
    public EZZoneSave(CommandSender sender)
    {
        EpicZonePlayer ezp;
        if (sender instanceof Player)
        {
            ezp = General.getPlayer(sender.getName());
        }
        else
        {
            ezp = General.getPlayer("console");
        }
        if (ezp.getMode() == EpicZoneMode.ZoneDraw)
        {
            if (ezp.getEditZone().getPolygon().npoints > 2)
            {
                ezp.setMode(EpicZoneMode.ZoneEdit);
                ezp.getEditZone().rebuildBoundingBox();
                Message.Send(sender, Message_ID.Info_00029_DrawingComplete);
            }
            else if (ezp.getEditZone().getPolygon().npoints == 1 && ezp.getEditZone().getRadius() > 0)
            {
                ezp.setMode(EpicZoneMode.ZoneEdit);
                ezp.getEditZone().rebuildBoundingBox();
                Message.Send(sender, Message_ID.Info_00029_DrawingComplete);
//                if (EpicSpout.UseSpout(ezp))
//                {
//                    EpicSpout.EditZone(ezp);
//                }
            }
            else
            {
                Message.Send(sender, Message_ID.Warning_00030_Draw_Need3Points);
            }
        }
        else if (ezp.getMode() == EpicZoneMode.ZoneEdit)
        {
            if (!ezp.getEditZone().hasParent())
            { // If a zone does not have a parent, set it's parent to the global
                // zone the zone is within.
                ezp.getEditZone().setParent(General.myGlobalZones.get(ezp.getEditZone().getWorld().toLowerCase()));
            }
            if (General.myZones.get(ezp.getEditZone().getTag()) == null)
            {
                General.myZones.put(ezp.getEditZone().getTag(), ezp.getEditZone());
            }
            else
            {
                General.myZones.remove(ezp.getEditZone().getTag());
                General.myZones.put(ezp.getEditZone().getTag(), ezp.getEditZone());
            }
            ezp.getEditZone().HidePillars();
            General.SaveZones();
            ezp.setMode(EpicZoneMode.None);
            Message.Send(sender, Message_ID.Info_00031_ZoneSaved);
        }
        else
        {
            new EZZoneHelp(ZoneCommand.SAVE, sender, ezp);
View Full Code Here

    public EZZoneRadius(String[] data, CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            if (ezp.getAdmin()) //Owners cannot change the size of their zone.
            {
                if (ezp.getMode() == EpicZoneMode.ZoneDraw || ezp.getMode() == EpicZoneMode.ZoneEdit)
                {
                    if (ezp.getEditZone().getPolygon().npoints == 1)
                    {
                        if (data.length > 1 && General.IsNumeric(data[1]))
                        {
                            Integer value = Integer.parseInt(data[1]);
                            ezp.getEditZone().setRadius(value);
                            Message.Send(sender, Message_ID.Info_00100_ZoneUpdatedSet_X_to_Y, new String[]{"radius", data[1]});
                        }
                        else
                        {
                            Message.Send(sender, Message_ID.Warning_00101_X_IsNotNumeric, new String[]{data[1]});
View Full Code Here

    public EZZoneList(CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            boolean sentMessage = false;
            for (String zoneTag : General.myZones.keySet())
            {
                EpicZone zone = General.myZones.get(zoneTag);
                String messageText = "";
                if (ezp.getAdmin() || zone.isOwner(ezp.getName()))
                {
                    messageText = Message.get(Message_ID.Format_KeyValue, new String[]{zone.getName(), zone.getTag()});
                    if (zone.hasChildren())
                    {
                        messageText = messageText + " " + Message.get(Message_ID.Info_00123_Zone_Children, new String[]{zone.getChildren().size() + ""});
                    }
                    if (zone.hasParent())
                    {
                        messageText = messageText + " " + Message.get(Message_ID.Info_00126_Zone_Parent, new String[]{zone.getParent().getTag()});
                    }
                }
                if (messageText.length() > 0)
                {
                    Message.Send(sender, messageText);
                    sentMessage = true;
                }
            }
            if (!sentMessage)
            {
                if (ezp.getAdmin())
                {
                    Message.Send(sender, Message_ID.Warning_00023_NoZones);
                }
                else
                {
View Full Code Here

    public EZZoneName(String[] data, CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());

            if (ezp.getMode() == EpicZoneMode.ZoneEdit)
            {
                if (data.length > 1)
                {
                    String message = "";
                    for (int i = 1; i < data.length; i++)
                    {
                        message = message + data[i] + " ";
                    }
                    if (message.length() > 0)
                    {
                        ezp.getEditZone().setName(message.trim());
                        Message.Send(sender, Message_ID.Info_00100_ZoneUpdatedSet_X_to_Y, new String[]{"name", message});
                    }
                }
            }
            else
View Full Code Here

    public EZZoneConfirm(CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            if (ezp.getAdmin()) //Only admin will ever be to this point.
            {
                if (ezp.getMode() == EpicZoneMode.ZoneDeleteConfirm)
                {

                    if (ezp.getEditZone().hasParent())
                    {
                        General.myZones.get(ezp.getEditZone().getParent().getTag()).removeChild(ezp.getEditZone().getTag());
                    }
                    ezp.getEditZone().HidePillars();
                    EpicZoneDAL.DeleteZone(ezp.getEditZone().getTag());
                    Message.Send(sender, Message_ID.Info_00102_Zone_X_Deleted, new String[]{ezp.getEditZone().getTag()});

                    ezp.setMode(EpicZoneMode.None);
                    ezp.setEditZone(null);

                }
                else if (ezp.getMode() == EpicZoneMode.ZoneDrawConfirm)
                {
                    ezp.setMode(EpicZoneMode.ZoneDraw);
                    ezp.getEditZone().clearPolyPoints();
                    ezp.getEditZone().HidePillars();
                    Message.Send(sender, Message_ID.Mode_00019_Draw_StartMessage);
                }
            }
            else
            {
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.