Package com.epicsagaonline.bukkit.EpicZones.objects

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


                {
                    if (interactiveItems.contains((event.getPlayer().getItemInHand().getTypeId())))
                    {

                        Player player = event.getPlayer();
                        EpicZonePlayer ezp = General.getPlayer(player.getName());
                        Point blockPoint = new Point(event.getClickedBlock().getLocation().getBlockX(), event.getClickedBlock().getLocation().getBlockZ());
                        String worldName = player.getWorld().getName();
                        int blockHeight = event.getClickedBlock().getLocation().getBlockY();
                        boolean hasPerms;

                        EpicZone currentZone;
                        if (General.BorderLogic(blockPoint, player))
                        {
                            currentZone = General.GetZoneForPlayer(player, worldName, blockHeight, blockPoint);
                            hasPerms = ZonePermissionsHandler.hasPermissions(player, currentZone, "build");

                            if (!hasPerms)
                            {
                                if (ezp.getLastWarned().before(new Date()))
                                {
                                    Message.Send(player, Message_ID.Warning_00036_Perm_GenericInZone);
                                    ezp.Warn();
                                }
                                event.setCancelled(true);
                            }
                        }
                    }
                    else if (event.getPlayer().getItemInHand().getTypeId() == Config.zoneTool)
                    {
                        if (General.getPlayer(event.getPlayer().getName()).getMode() == EpicZoneMode.ZoneDraw)
                        {
                            Point point = new Point(event.getClickedBlock().getLocation().getBlockX(), event.getClickedBlock().getLocation().getBlockZ());
                            EpicZonePlayer ezp = General.getPlayer(event.getPlayer().getName());
                            ezp.getEditZone().addPoint(point);
                            ezp.getEditZone().addPillar(event.getClickedBlock());
                            ezp.getEditZone().ShowPillar(point);
                            Message.Send(event.getPlayer(), Message_ID.Info_00112_Point_XZ_Added, new String[]{Integer.toString(point.x), Integer.toString(point.y)});
                        }
                    }
                }
            }
View Full Code Here


public class EZZoneInfo
{
    public EZZoneInfo(String[] data, CommandSender sender)
    {
        EpicZonePlayer ezp;
        if (sender instanceof Player)
        {
            ezp = General.getPlayer(sender.getName());
        }
        else
        {
            ezp = General.getPlayer("console");
        }
        if (data.length > 1)
        {
            EpicZone zone = General.myZones.get(data[1].trim());
            if (zone != null)
            {
                if (ezp.getAdmin() || zone.isOwner(ezp.getName()))
                {
                    String messageText;
                    Message.Send(sender, Message_ID.Format_KeyValue, new String[]{zone.getName(), zone.getTag()});
                    if (zone.getCenter() != null)
                    {
View Full Code Here

public class EZZoneCommand
{
    public EZZoneCommand(String[] data, CommandSender sender)
    {
        EpicZonePlayer ezp;
        if (sender instanceof Player)
        {
            ezp = General.getPlayer(sender.getName());
        }
        else
        {
            ezp = General.getPlayer("console");
        }

        if (ezp.getMode() == EpicZoneMode.ZoneEdit)
        {
            if (data.length > 2)
            {
                String perm = data[1];
                String command = data[2].toLowerCase();

                if (ValidPerm(perm))
                {
                    if (perm.equals("allow"))
                    {
                        ezp.getEditZone().getDisallowedCommands().remove(command);
                        Message.Send(sender, Message_ID.Info_00131_CommandNotDenied, new String[]{command, ezp.getEditZone().getName()});
                    }
                    else
                    {
                        ezp.getEditZone().getDisallowedCommands().add(command);
                        Message.Send(sender, Message_ID.Info_00132_CommandDenied, new String[]{command, ezp.getEditZone().getName()});
                    }
                }
                else
                {
                    Message.Send(sender, Message_ID.Warning_00110_InvalidPermissionType, new String[]{perm});
View Full Code Here

    void onBlockBreak(BlockBreakEvent event)
    {
        if (!event.isCancelled())
        {
            Player player = event.getPlayer();
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            Point blockPoint = new Point(event.getBlock().getLocation().getBlockX(), event.getBlock().getLocation().getBlockZ());
            if (General.BorderLogic(blockPoint, player))
            {
                String worldName = player.getWorld().getName();
                int blockHeight = event.getBlock().getLocation().getBlockY();
                EpicZone currentZone = General.GetZoneForPlayer(player, worldName, blockHeight, blockPoint);
                boolean hasPerms = ZonePermissionsHandler.hasPermissions(player, currentZone, "destroy");
                if (!hasPerms)
                {
                    if (ezp.getLastWarned().before(new Date()))
                    {
                        Message.Send(player, Message_ID.Warning_00032_Perm_DestroyInZone);
                        ezp.Warn();
                    }
                    event.setCancelled(true);
                }
            }
            else
            {
                if (ezp.getLastWarned().before(new Date()))
                {
                    Message.Send(player, Message_ID.Warning_00033_Perm_DestroyOutsideRadius);
                    ezp.Warn();
                }
                event.setCancelled(true);
            }
        }
    }
View Full Code Here

    void onBlockPlace(BlockPlaceEvent event)
    {
        if (!event.isCancelled())
        {
            Player player = event.getPlayer();
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            Point blockPoint = new Point(event.getBlock().getLocation().getBlockX(), event.getBlock().getLocation().getBlockZ());
            if (General.BorderLogic(blockPoint, player))
            {
                String worldName = player.getWorld().getName();
                int blockHeight = event.getBlock().getLocation().getBlockY();
                EpicZone currentZone = General.GetZoneForPlayer(player, worldName, blockHeight, blockPoint);
                boolean hasPerms = ZonePermissionsHandler.hasPermissions(player, currentZone, "build");
                if (!hasPerms)
                {
                    if (ezp.getLastWarned().before(new Date()))
                    {
                        Message.Send(player, Message_ID.Warning_00032_Perm_DestroyInZone);
                        ezp.Warn();
                    }
                    event.setCancelled(true);
                }
            }
            else
            {
                if (ezp.getLastWarned().before(new Date()))
                {
                    Message.Send(player, Message_ID.Warning_00033_Perm_DestroyOutsideRadius);
                    ezp.Warn();
                }
                event.setCancelled(true);
            }
        }
    }
View Full Code Here

                    {
                        EntityDamageByEntityEvent sub = (EntityDamageByEntityEvent) event;
                        if (isPlayer(sub.getEntity()) && isPlayer(sub.getDamager()))
                        {
                            Player player = (Player) sub.getEntity();
                            EpicZonePlayer ezp = General.getPlayer(player.getName());
                            EpicZone zone = ezp.getCurrentZone();
                            if (zone != null)
                            {
                                if (!zone.getPVP())
                                {
                                    event.setCancelled(true);
View Full Code Here

    public EZZoneFloor(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 change the size of their zone.
            {
                if (ezp.getMode() == EpicZoneMode.ZoneEdit)
                {
                    if (data.length > 1 && General.IsNumeric(data[1]))
                    {
                        Integer value = Integer.parseInt(data[1]);
                        ezp.getEditZone().setFloor(value);
                        Message.Send(sender, Message_ID.Info_00100_ZoneUpdatedSet_X_to_Y, new String[]{"floor", data[1]});
                    }
                    else
                    {
                        Message.Send(sender, Message_ID.Warning_00101_X_IsNotNumeric, new String[]{data[1]});
View Full Code Here

    public EZZoneDraw(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 change the size of their zone.
            {
                if (ezp.getMode() == EpicZoneMode.ZoneEdit)
                {
                    ezp.setMode(EpicZoneMode.ZoneDrawConfirm);
                    Message.Send(sender, Message_ID.Mode_00021_DrawConfirm_Warning);
                }
                else if (ezp.getMode() == EpicZoneMode.ZoneDrawConfirm)
                {
                    if (data.length > 1)
                    {
                        if (data[1].equalsIgnoreCase("confirm"))
                        {
                            ezp.setMode(EpicZoneMode.ZoneDraw);
                            Message.Send(sender, Message_ID.Mode_00019_Draw_StartMessage);
                        }
                        else if (data[1].equalsIgnoreCase("deny"))
                        {
                            ezp.setMode(EpicZoneMode.ZoneEdit);
                            Message.Send(sender, Message_ID.Info_00017_Cancel_Draw);
                        }
                    }
                }
            }
View Full Code Here

    public EZZoneMessage(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 > 2)
                {
                    String message = "";
                    String cmd = data[1];
                    for (int i = 2; i < data.length; i++)
                    {
                        message = message + data[i] + " ";
                    }
                    message = message.trim();
                    if (message.length() > 0)
                    {
                        if (cmd.equalsIgnoreCase("enter"))
                        {
                            if (message.equalsIgnoreCase("clear"))
                            {
                                message = "";
                            }
                            ezp.getEditZone().setEnterText(message);
                            Message.Send(sender, Message_ID.Info_00100_ZoneUpdatedSet_X_to_Y, new String[]{"enter message", message});
                        }
                        else if (cmd.equalsIgnoreCase("exit"))
                        {
                            if (message.equalsIgnoreCase("clear"))
                            {
                                message = "";
                            }
                            ezp.getEditZone().setExitText(message);
                            Message.Send(sender, Message_ID.Info_00100_ZoneUpdatedSet_X_to_Y, new String[]{"exit message", message});
                        }
                        else
                        {
                            Message.Send(sender, Message_ID.Warning_00025_NoEnter_NoExit);
View Full Code Here

    public EZZoneCancel(CommandSender sender)
    {
        if (sender instanceof Player)
        {
            Player player = (Player) sender;
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            if (ezp.getMode() == EpicZoneMode.ZoneEdit || ezp.getMode() == EpicZoneMode.ZoneDraw)
            {
                String zoneTag = ezp.getEditZone().getTag();
                ezp.getEditZone().HidePillars();
                ezp.setMode(EpicZoneMode.None);
                ezp.setEditZone(null);
                EpicZoneDAL.ReloadZone(zoneTag);
                Message.Send(sender, Message_ID.Info_00016_Cancel_Edit);
            }
            else if (ezp.getMode() == EpicZoneMode.ZoneDrawConfirm || ezp.getMode() == EpicZoneMode.ZoneDeleteConfirm)
            {
                ezp.setMode(EpicZoneMode.ZoneEdit);
                Message.Send(sender, Message_ID.Info_00017_Cancel_Draw);
            }
            else
            {
                new EZZoneHelp(ZoneCommand.CANCEL, sender, ezp);
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.