Package com.epicsagaonline.bukkit.EpicZones.objects

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


    @Override
    void onBlockIgnite(BlockIgniteEvent event)
    {
        if (!event.isCancelled())
        {
            EpicZone zone = General.GetZoneForPlayer(null, event.getBlock().getLocation().getWorld().getName(), event.getBlock().getLocation().getBlockY(), new Point(event.getBlock().getLocation().getBlockX(), event.getBlock().getLocation().getBlockZ()));
            if (zone != null)
            {
                if (event.getCause() == IgniteCause.FLINT_AND_STEEL) //Flint and steel
                {
                    if (!zone.getFire().getIgnite())
                    {
                        event.setCancelled(true);
                    }
                }
                else //Spread and Lava
                {
                    if (!zone.getFire().getSpread())
                    {
                        event.setCancelled(true);
                    }
                }
View Full Code Here


    @Override
    void onBlockBurn(BlockBurnEvent event)
    {
        if (!event.isCancelled())
        {
            EpicZone zone = General.GetZoneForPlayer(null, event.getBlock().getLocation().getWorld().getName(), event.getBlock().getLocation().getBlockY(), new Point(event.getBlock().getLocation().getBlockX(), event.getBlock().getLocation().getBlockZ()));
            if (zone != null)
            {
                if (!zone.getFire().getIgnite())
                {
                    event.setCancelled(true);
                }
            }
        }
View Full Code Here

            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()))
                    {
View Full Code Here

            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()))
                    {
View Full Code Here

    }

    @Override
    public void onEntityExplode(EntityExplodeEvent event)
    {
        EpicZone zone = General.GetZoneForPlayer(null, event.getLocation().getWorld().getName(), event.getLocation().getBlockY(), new Point(event.getLocation().getBlockX(), event.getLocation().getBlockZ()));
        if (zone != null)
        {
            if (event.getEntity().toString().equalsIgnoreCase("CraftTNTPrimed"))
            {
                if (!zone.getExplode().getTNT())
                {
                    event.setYield(0);
                    event.setCancelled(true);
                }
            }
            else if (event.getEntity().toString().equalsIgnoreCase("CraftCreeper"))
            {
                if (!zone.getExplode().getCreeper())
                {
                    event.setYield(0);
                    event.setCancelled(true);
                }
            }
            else if (event.getEntity().toString().equalsIgnoreCase("CraftFireball"))
            {
                if (!zone.getExplode().getGhast())
                {
                    event.setYield(0);
                    event.setCancelled(true);
                }
            }
View Full Code Here

    public void onEntityCombust(EntityCombustEvent event)
    {
        if (!event.isCancelled())
        {
            Entity e = event.getEntity();
            EpicZone zone = General.GetZoneForPlayer(null, e.getLocation().getWorld().getName(), e.getLocation().getBlockY(), new Point(e.getLocation().getBlockX(), e.getLocation().getBlockZ()));
            if (zone != null)
            {
                if (!zone.getFire().getIgnite())
                {
                    if (isPlayer(e))
                    {
                        e.setFireTicks(0);
                        event.setCancelled(true);
                    }
                    else if (!zone.getFireBurnsMobs())
                    {
                        e.setFireTicks(0);
                        event.setCancelled(true);
                    }
                }
View Full Code Here

    public void onEntityDamage(EntityDamageEvent event)
    {
        if (!event.isCancelled())
        {
            Entity e = event.getEntity();
            EpicZone sancZone = General.GetZoneForPlayer(null, e.getLocation().getWorld().getName(), e.getLocation().getBlockY(), new Point(e.getLocation().getBlockX(), e.getLocation().getBlockZ()));
            if ((sancZone != null && !sancZone.getSanctuary()) || sancZone == null)
            {
                if (event.getCause() == DamageCause.ENTITY_ATTACK)
                {
                    if (event instanceof EntityDamageByEntityEvent)
                    {
                        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);
                                }
                            }
                            else
View Full Code Here

    @Override
    public void onCreatureSpawn(CreatureSpawnEvent event)
    {
        if (!event.isCancelled() && spawnReasonsToBlock.contains(event.getSpawnReason()))
        {
            EpicZone zone = General.GetZoneForPlayer(null, event.getLocation().getWorld().getName(), event.getLocation().getBlockY(), new Point(event.getLocation().getBlockX(), event.getLocation().getBlockZ()));
            if (zone != null)
            {
                if (zone.getMobs() != null) //If null assume all
                {
                    if (zone.getMobs().size() > 0) //If size = 0 assume all
                    {
                        if (!zone.getMobs().contains("ALL"))
                        {
                            if (zone.getMobs().contains("NONE") || !zone.getMobs().contains(event.getCreatureType().toString()))
                            {
                                event.setCancelled(true);
                            }
                        }
                    }
View Full Code Here

    @Override
    public void onEndermanPickup(EndermanPickupEvent event)
    {
        if (!event.isCancelled())
        {
            EpicZone zone = General.GetZoneForPlayer(null, event.getBlock().getLocation().getWorld().getName(), event.getBlock().getLocation().getBlockY(), new Point(event.getBlock().getLocation().getBlockX(), event.getBlock().getLocation().getBlockZ()));
            if (zone != null)
            {
                if (!zone.getAllowEndermenPick())
                {
                    event.setCancelled(true);
                }
            }
        }
View Full Code Here

    @Override
    public void onEndermanPlace(EndermanPlaceEvent event)
    {
        if (!event.isCancelled())
        {
            EpicZone zone = General.GetZoneForPlayer(null, event.getLocation().getWorld().getName(), event.getLocation().getBlockY(), new Point(event.getLocation().getBlockX(), event.getLocation().getBlockZ()));
            if (zone != null)
            {
                if (!zone.getAllowEndermenPick())
                {
                    event.setCancelled(true);
                }
            }
        }
View Full Code Here

TOP

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

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.