Package org.bukkit.util

Examples of org.bukkit.util.Vector


   
    // store player's original position, so we can return him safely back (in case he's underground and another player slaps him to heavens)
    Location loc = target.getLocation();
    slappedLastLocations.put(tName, loc);
   
    target.setVelocity(new Vector(0, slapHeight, 0));
   
    // insure player's safe return home even if they fall into deep water and no damage is done
    slappedUnslapTasks.put(tName,  Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(CommandsEX.plugin, new Unslap(target, tName), (20 * 25)));

    if (showMessages) {
View Full Code Here


      }
    }
   
    Player player = (Player) sender;
    Location eye = player.getEyeLocation().add(0.5, 0.5, 0.5);
    Vector v = eye.getDirection().multiply(2);
    Fireball entity = player.getWorld().spawn(eye.add(v.getX(), v.getY(), v.getZ()), (!smallFireball ? Fireball.class : SmallFireball.class));
    entity.setShooter(player);
    entity.setVelocity(eye.getDirection().multiply(2));
   
    LogHelper.showInfo("fireballSuccess", sender);
    return true;
View Full Code Here

    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 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

        LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), RANDOM);
        if (target == null) return;

        Location bLoc = boss.getEntity().getLocation();
        Location loc  = target.getLocation();
        Vector v      = new Vector(loc.getX() - bLoc.getX(), 0, loc.getZ() - bLoc.getZ());
       
        target.setVelocity(v.normalize().setY(0.8));
    }
View Full Code Here

        LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), RANDOM);
        if (target == null) return;
       
        Location loc  = target.getLocation();
        Location bLoc = boss.getEntity().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));
       
        target.setVelocity(v.normalize().multiply(c*0.3).setY(0.8));
    }
View Full Code Here

    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(loc.getX() - bLoc.getX(), 0, loc.getZ() - bLoc.getZ());
            p.setVelocity(v.normalize().setY(0.8));
        }
    }
View Full Code Here

    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(loc.getX() - bLoc.getX(), 0, loc.getZ() - bLoc.getZ());
            p.setVelocity(v.normalize().setY(0.8));
        }
    }
View Full Code Here

   *            Entity to launch into the air
   * @param value
   *            Acceleration of entity
   */
  public static void launchEntity(final LivingEntity entity, final int value) {
    entity.setVelocity(new Vector(0, 2 * value, 0));
  }
View Full Code Here

    return member.getDirection().getModY() * member.getEntity().vel.getY();
  }

  @Override
  public Vector getFixedPosition(CommonMinecart<?> entity, double x, double y, double z, IntVector3 railPos) {
    return new Vector(railPos.midX(), y, railPos.midZ());
  }
View Full Code Here

TOP

Related Classes of org.bukkit.util.Vector

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.