Examples of BlockFace


Examples of org.bukkit.block.BlockFace

    return false;
  }

  private boolean isPartOfGate(Block gateBlock, Block block) {
    if (gateBlock != null) {
      BlockFace leftSide = null; // look at the zone
      BlockFace rightSide = null;
      if (this.wall == Direction.NORTH()) {
        leftSide = Direction.EAST();
        rightSide = Direction.WEST();
      } else if (this.wall == Direction.EAST()) {
        leftSide = Direction.SOUTH();
View Full Code Here

Examples of org.bukkit.block.BlockFace

    }
  }

  private void resetGateSign(Block gate, String[] lines, boolean awayFromWall) {
    Block block = null;
    BlockFace direction = null;
    if (awayFromWall) {
      direction = this.wall;
    } else if (this.wall == Direction.NORTH()) {
      direction = Direction.SOUTH();
    } else if (this.wall == Direction.EAST()) {
View Full Code Here

Examples of org.bukkit.block.BlockFace

    }
    state.update(true);
  }

  public boolean isLeavingZone(Location location) {
    BlockFace inside = null;
    BlockFace left = null;
    BlockFace right = null;
    if (this.wall == Direction.NORTH()) {
      inside = Direction.SOUTH();
      left = Direction.WEST();
      right = Direction.EAST();
    } else if (this.wall == Direction.EAST()) {
View Full Code Here

Examples of org.bukkit.block.BlockFace

          }
        }
      }

      // lobby
      BlockFace lobbyFace = null;
      if (lobbyStr != null && !lobbyStr.equals("")) {
        String[] lobbyStrSplit = lobbyStr.split(",");
        if (lobbyStrSplit.length > 0) {
          // lobby orientation
          if (lobbyStrSplit[0].equals("south")) {
View Full Code Here

Examples of org.bukkit.block.BlockFace

      yaw = (int) (teamSpawn.getYaw() % 360);
    } else {
      yaw = (int) (360 + (teamSpawn.getYaw() % 360));
    }
    Block signBlock = null;
    BlockFace signDirection = null;

    if (style.equals(TeamSpawnStyle.SMALL)) {
      // SMALL style
      if (yaw >= 0 && yaw < 90) {
        signDirection = BlockFace.SOUTH_WEST.getOppositeFace();
View Full Code Here

Examples of org.bukkit.block.BlockFace

      // lobby
      String lobbyPrefix = zoneInfoPrefix + "lobby.";
     
      // lobby orientation
      String lobbyOrientation = warzoneRootSection.getString(lobbyPrefix + "orientation");
      BlockFace lobbyFace = null;
      if (lobbyOrientation.equals("south")) {
        lobbyFace = Direction.SOUTH();
      } else if (lobbyOrientation.equals("east")) {
        lobbyFace = Direction.EAST();
      } else if (lobbyOrientation.equals("north")) {
View Full Code Here

Examples of org.bukkit.block.BlockFace

                        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);
                            Block blockBehind = blockBelow.getRelative(backwards);

                            // If the block below this sign is a class sign, swap the order
View Full Code Here

Examples of org.bukkit.block.BlockFace

    return MaterialUtil.ISPRESSUREPLATE.get(type);
  }

  @Override
  public BlockFace[] getPossibleDirections(Block trackBlock) {
    BlockFace dir = getDirection(trackBlock);
    if (dir == BlockFace.SELF) {
      return FaceUtil.RADIAL;
    } else {
      return RailTypeRegular.getPossibleDirections(dir);
    }
View Full Code Here

Examples of org.bukkit.block.BlockFace

  }

  @Override
  public RailLogic getLogic(MinecartMember<?> member, Block railsBlock) {
    // Get the direction of the rails to find out the logic to use
    BlockFace dir = Util.getPlateDirection(railsBlock);
    if (dir == BlockFace.SELF) {
      //set track direction based on direction of this cart
      dir = FaceUtil.toRailsDirection(member.getDirectionTo());
    }
    return RailLogicHorizontal.get(dir);
View Full Code Here

Examples of org.bukkit.block.BlockFace

      return false;
    }
    // Handle collision (ignore UP/DOWN, recalculate hitFace for this)
    Block posBlock = findMinecartPos(railsBlock);
    hitFace = FaceUtil.getDirection(hitBlock, posBlock, false);
    final BlockFace hitToFace = hitFace.getOppositeFace();
    if (posBlock.getY() == hitBlock.getY()) {
      // If the hit face is not a valid direction to go to, ignore it
      int dx = hitBlock.getX() - posBlock.getX();
      int dz = hitBlock.getZ() - posBlock.getZ();
      if (Math.abs(dx) > 0 && Math.abs(dz) > 0) {
        // CANCEL: we hit a corner block
        return false;
      }
      BlockFace[] possible = this.getPossibleDirections(railsBlock);
      if (!LogicUtil.contains(hitToFace, possible)) {
        // CANCEL: we hit a block that is not an end-direction
        return false;
      }
    }
    if (member.isOnSlope()) {
      // Cancel collisions with blocks two above this sloped rail
      if (hitBlock.getX() == posBlock.getX() && hitBlock.getZ() == posBlock.getZ()) {
        int dy = hitBlock.getY() - posBlock.getY();
        if (dy >= 2) {
          return false;
        }
      }

      // Cancel collisions with blocks at the heading of sloped rails when going up vertically
      BlockFace railDirection = this.getDirection(railsBlock);
      if (hitToFace == railDirection && Util.isVerticalAbove(posBlock, railDirection)) {
        return false;
      }

      // Cancel collisions with blocks 'right above' the next rail when going down the slope
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.