Package org.spout.api.geo.discrete

Examples of org.spout.api.geo.discrete.Point.sub()


  public static BlockFace getBlockFacing(Block block, Entity entity) {
    Point position;
    EntityHead head = entity.get(EntityHead.class);
    position = head != null ? head.getPosition() : entity.getPhysics().getPosition();

    Vector3f diff = position.sub(block.getX(), block.getY(), block.getZ());
    if (Math.abs(diff.getX()) < 2.0f && Math.abs(diff.getZ()) < 2.0f) {
      if (diff.getY() > 1.8f) {
        return BlockFace.TOP;
      } else if (diff.getY() < -0.2f) {
        return BlockFace.BOTTOM;
View Full Code Here


      } else if (material.equals(VanillaMaterials.FIRE_CHARGE)) {
        shootEffect = GeneralEffects.SHOOT_FIREBALL;
        //TODO: Spawn
      } else {
        shootEffect = GeneralEffects.RANDOM_CLICK1;
        position = position.sub(0.0, 0.3, 0.0);
        toLaunch = new Item();
        ((Item) toLaunch).setItemStack(item);
      }

      if (toLaunch != null) {
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.