Package org.bukkit.util

Examples of org.bukkit.util.Vector.lengthSquared()


    entity.setPosition(entity.loc.getX(), entity.loc.getY(), entity.loc.getZ());

    if (getGroup().getProperties().isManualMovementAllowed() && entity.hasPassenger()) {
      Vector vel = entity.getPassenger().getVelocity();
      vel.setY(0.0);
      if (vel.lengthSquared() > 1.0E-4 && entity.vel.xz.lengthSquared() < 0.01) {
        entity.vel.xz.add(vel.multiply(0.1));
      }
    }

    // Perform any pre-movement rail updates
View Full Code Here


    if (!isCart && !isTrain) {
      return;
    }
    // Parse offset
    Vector offset = Util.parseVector(info.getLine(2), new Vector(0.0, 0.0, 0.0));
    if (offset.lengthSquared() == 0.0) {
      return;
    }
    // Rotate the offset so it becomes aligned with the sign
    float yaw = FaceUtil.faceToYaw(info.getFacing().getOppositeFace());
    offset = MathUtil.rotate(yaw, 0.0f, offset);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.