Package org.bukkit.block

Examples of org.bukkit.block.BlockFace


      int dist = Math.min(ParseUtil.parseInt(info.getLine(1), 100), TrainCarts.maxDetectorLength);
      long delay = ParseUtil.parseTime(info.getLine(2));
      double launchDistance = ParseUtil.parseDouble(info.getLine(3), 2.0);

      //allowed?
      BlockFace dir = info.getMember().getDirectionTo();

      //distance
      if (MemberActionWaitOccupied.handleOccupied(info.getRails(), dir, info.getMember(), dist)) {
        info.getGroup().getActions().clear();
        info.getMember().getActions().addActionWaitOccupied(dist, delay, launchDistance);
View Full Code Here


    if (!info.hasRailedMember()) {
      return;
    }
    final boolean facing = info.isFacing();
    if (facing) {
      final BlockFace cartDirection = info.getCartDirection();
      //find out what statements to parse
      List<DirectionStatement> statements = new ArrayList<DirectionStatement>();
      statements.add(new DirectionStatement(info.getLine(2), cartDirection, Direction.LEFT));
      statements.add(new DirectionStatement(info.getLine(3), cartDirection, Direction.RIGHT));
      //other signs below this sign we could parse?
View Full Code Here

        return;
      }
    }
    if (info.getMode() != SignActionMode.NONE && event.getBlock().getType() == Material.SIGN_POST) {
      //snap to fixed 45-degree angle
      BlockFace facing = BlockUtil.getFacing(event.getBlock());
      BlockUtil.setFacing(event.getBlock(), Util.snapFace(facing));
    }
  }
View Full Code Here

        // Don't do this in the move event as that one fires too often (performance issue)
        if (!info.isAction(SignActionType.MEMBER_MOVE)) {
          Direction direction = Direction.parse(info.getLine(3));
          if (direction != Direction.NONE) {
            long delay = ParseUtil.parseTime(info.getLine(2));
            BlockFace trainDirection = direction.getDirection(info.getFacing(), info.getCartDirection());
            info.getGroup().getActions().clear();
            info.getGroup().getActions().addActionWaitState();
            if (delay > 0) {
              info.getGroup().getActions().addActionWait(delay);
            }
View Full Code Here

      return;
    }

    int radX, radY, radZ;
    radX = radY = radZ = ParseUtil.parseInt(info.getLine(1), TrainCarts.defaultTransferRadius);
    BlockFace dir = info.getRailDirection();
    if (FaceUtil.isAlongX(dir)) {
      radX = 0;
    } else if (FaceUtil.isAlongZ(dir)) {
      radZ = 0;
    }
View Full Code Here

        }
        group.head().getActions().addActionLaunch(distance, velocity);
      }
    } else if (info.hasRailedMember()) {
      // Parse the direction to launch into
      BlockFace direction = Direction.parse(info.getLine(3)).getDirection(info.getFacing(), info.getCartDirection());

      // Calculate the launch distance if left empty
      if (distance <= 0.0) {
        distance = Util.calculateStraightLength(info.getRails(), direction);
      }
View Full Code Here

    if (dest != null) {
      //Teleport the ENTIRE train to the destination...
      Block sign = dest.getBlock();
      sign.getChunk(); //load the chunk
      if (MaterialUtil.ISSIGN.get(sign)) {
        BlockFace facing = BlockUtil.getFacing(sign);
        BlockFace direction = facing;
        Block destinationRail = Util.getRailsFromSign(sign);
        if (destinationRail == null) {
          return;
        }
        boolean isPlate = MaterialUtil.ISPRESSUREPLATE.get(destinationRail);
View Full Code Here

      }

      //Brake
      //TODO: ADD CHECK?!
      group.getActions().clear();   
      BlockFace trainDirection = station.getNextDirection().getDirection(info.getFacing(), info.getMember().getDirection());
      if (station.getNextDirection() != Direction.NONE) {
        // Actual launching here
        if (station.hasDelay()) {
          station.centerTrain();
          station.waitTrain(station.getDelay());
View Full Code Here

      if (types.isEmpty()) {
        return;
      }
      Location[] locs = new Location[types.size()];
      BlockFace spawnDirection = null;
      if (types.size() == 1) {
        // Single-minecart spawning logic
        locs[0] = info.getCenterLocation();
        if (MinecartMemberStore.getAt(locs[0]) == null) {
          for (BlockFace direction : info.getWatchedDirections()) {
View Full Code Here

        event.getPlayer().sendMessage(ChatColor.RED + "No rails are nearby: This detector sign has not been activated!");
        return true;
      }
      Block startsign = event.getBlock();
      Block startrails = event.getRails();
      BlockFace dir = event.getFacing();
      if (!tryBuild(startrails, startsign, dir)) {
        if (!tryBuild(startrails, startsign, FaceUtil.rotate(dir, 2))) {
          if (!tryBuild(startrails, startsign, FaceUtil.rotate(dir, -2))) {
            event.getPlayer().sendMessage(ChatColor.RED + "Failed to find a second detector sign: No region set.");
            event.getPlayer().sendMessage(ChatColor.YELLOW + "Place a second connected detector sign to finish this region!");
View Full Code Here

TOP

Related Classes of org.bukkit.block.BlockFace

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.