Package org.bukkit

Examples of org.bukkit.Location


            public void run() {
                if (!className.equalsIgnoreCase("random")) {
                    if (useClassChests) {
                        // Check for stored class chests first
                        ArenaClass ac = plugin.getArenaMaster().getClasses().get(className.toLowerCase());
                        Location loc = ac.getClassChest();
                        Block blockChest;
                        if (loc != null) {
                            blockChest = loc.getBlock();
                        } else {
                            // Otherwise, start the search
                            BlockFace backwards = ((org.bukkit.material.Sign) sign.getData()).getFacing().getOppositeFace();
                            Block blockSign   = sign.getBlock();
                            Block blockBelow  = blockSign.getRelative(BlockFace.DOWN);
View Full Code Here


     */
    private final int RADIUS = 5;
   
    @Override
    public void execute(Arena arena, MABoss boss) {
        Location bLoc = boss.getEntity().getLocation();
       
        for (Player p : AbilityUtils.getNearbyPlayers(arena, boss.getEntity(), RADIUS)) {
            Location loc = p.getLocation();
            Vector v     = new Vector(bLoc.getX() - loc.getX(), 0, bLoc.getZ() - loc.getZ());
           
            double a = Math.abs(bLoc.getX() - loc.getX());
            double b = Math.abs(bLoc.getZ() - loc.getZ());
            double c = Math.sqrt((a*a + b*b));
           
            p.setVelocity(v.normalize().multiply(c*0.3).setY(0.8));
        }
    }
View Full Code Here

    public TeleportResponse onPlayerTeleport(PlayerTeleportEvent event) {
        if (!arena.isEnabled() || !region.isSetup() || arena.inEditMode() || allowTeleport) {
            return TeleportResponse.IDGAF;
        }

        Location to = event.getTo();
        Location from = event.getFrom();
        Player p = event.getPlayer();

        if (region.contains(from)) {
            // Players with proper admin permission can warp out
            if (p.hasPermission("mobarena.admin.teleport")) {
View Full Code Here

     */
    private final int RADIUS = 8;
   
    @Override
    public void execute(Arena arena, MABoss boss) {
        Location bLoc = boss.getEntity().getLocation();
       
        for (Player p : AbilityUtils.getDistantPlayers(arena, boss.getEntity(), RADIUS)) {
            p.teleport(bLoc);
        }
    }
View Full Code Here

        final LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), true);
        if (target == null || !(target instanceof Player))
            return;
       
        Player p = (Player) target;
        Location loc = p.getLocation();
       
        rootTarget(arena, p, loc, ITERATIONS);
    }
View Full Code Here

     */
    private final int RADIUS = 8;
   
    @Override
    public void execute(Arena arena, MABoss boss) {
        Location bLoc = boss.getEntity().getLocation();
       
        for (Player p : AbilityUtils.getDistantPlayers(arena, boss.getEntity(), RADIUS)) {
            Location loc = p.getLocation();
            Vector v     = new Vector(bLoc.getX() - loc.getX(), 0, bLoc.getZ() - loc.getZ());
           
            double a = Math.abs(bLoc.getX() - loc.getX());
            double b = Math.abs(bLoc.getZ() - loc.getZ());
            double c = Math.sqrt((a*a + b*b));
           
            p.setVelocity(v.normalize().multiply(c*0.3).setY(0.8));
        }
    }
View Full Code Here

        // Register the permission.
        registerPermission("mobarena.classes." + lowercase, PermissionDefault.TRUE).addParent("mobarena.classes", true);

        // Check for class chests
        Location cc = parseLocation(section, "classchest", null);
        arenaClass.setClassChest(cc);

        // Finally add the class to the classes map.
        classes.put(lowercase, arenaClass);
        return arenaClass;
View Full Code Here

        // Split the string by semicolons
        String[] spawns = spawnString.split(";");
       
        ArenaRegion region = arena.getRegion();
        for (String spawn : spawns) {
            Location spawnpoint = region.getSpawnpoint(spawn.trim());
           
            if (spawnpoint == null) {
                Messenger.warning("Spawnpoint '" + spawn + "' in wave '" + name + "' for arena '" + arena.configName() + "' could not be parsed!");
                continue;
            }
View Full Code Here

       
        // If no spawnpoints in range, just return all of them.
        if (result.isEmpty()) {
            String locs = "";
            for (Player p : players) {
                Location l = p.getLocation();
                locs += "(" + l.getBlockX() + "," + l.getBlockY() + "," + l.getBlockZ() + ") ";
            }
            Messenger.warning("The following locations in arena '" + arena.configName() + "' are not covered by any spawnpoints:" + locs);
            return spawnpoints;
        }
        return result;
View Full Code Here

    public void fixLobbyRegion() {
        fix("l1", "l2");
    }
   
    private void fix(String location1, String location2) {
        Location loc1 = parseLocation(coords, location1, world);
        Location loc2 = parseLocation(coords, location2, world);
       
        if (loc1 == null || loc2 == null) {
            return;
        }

        boolean modified = false;

        if (loc1.getX() > loc2.getX()) {
            double tmp = loc1.getX();
            loc1.setX(loc2.getX());
            loc2.setX(tmp);
            modified = true;
        }
       
        if (loc1.getZ() > loc2.getZ()) {
            double tmp = loc1.getZ();
            loc1.setZ(loc2.getZ());
            loc2.setZ(tmp);
            modified = true;
        }
       
        if (loc1.getY() > loc2.getY()) {
            double tmp = loc1.getY();
            loc1.setY(loc2.getY());
            loc2.setY(tmp);
            modified = true;
        }
       
        if (!arena.getWorld().getName().equals(world.getName())) {
            arena.setWorld(world);
View Full Code Here

TOP

Related Classes of org.bukkit.Location

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.