Examples of BlockLocation


Examples of com.bergerkiller.bukkit.common.BlockLocation

    public boolean next() {
      if (!iter.hasNext()) {
        return true;
      }
      Block nextRail = iter.next();
      BlockLocation newNodeLocation;
      String newNodeName;
      boolean hasFinished = false;
      for (Block signblock : Util.getSignsFromRails(nextRail)) {
        SignActionEvent event = new SignActionEvent(signblock);
        if (event.getMode() != SignActionMode.NONE) {
          if (event.isType("tag", "switcher")){
            newNodeLocation = new BlockLocation(nextRail);
            newNodeName = newNodeLocation.toString();
          } else if (event.isType("destination")) {
            newNodeLocation = new BlockLocation(nextRail);
            newNodeName = event.getLine(2);
          } else if (event.isType("blocker") && event.isWatchedDirection(iter.currentDirection()) && event.isPowerAlwaysOn()) {
            hasFinished = true;
            break;
          } else {
View Full Code Here

Examples of com.bergerkiller.bukkit.common.BlockLocation

  @Override
  public BlockLocation getLocation() {
    MinecartMember<?> member = this.getHolder();
    if (member != null) {
      return new BlockLocation(member.getEntity().getLocation().getBlock());
    } else {
      // Offline member?
      OfflineMember omember = OfflineGroupManager.findMember(this.getTrainProperties().getTrainName(), this.getUUID());
      if (omember == null) {
        return null;
      } else {
        // Find world
        World world = Bukkit.getWorld(omember.group.worldUUID);
        if (world == null) {
          return new BlockLocation("Unknown", omember.cx << 4, 0, omember.cz << 4);
        } else {
          return new BlockLocation(world, omember.cx << 4, 0, omember.cz << 4);
        }
      }
    }
  }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.BlockLocation

      //create from location
      return getOrCreate(event.getRails());
    }
  }
  public static PathNode getOrCreate(Block location) {
    return getOrCreate(new BlockLocation(location));
  }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.BlockLocation

  }
  public static PathNode getOrCreate(BlockLocation location) {
    return getOrCreate(location.toString(), location);
  }
  public static PathNode getOrCreate(final String name, Block location) {
    return getOrCreate(name, new BlockLocation(location));
  }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.BlockLocation

        nodes = new HashMap<String, PathNode>(count);
        blockNodes.clear();
        PathNode[] parr = new PathNode[count];
        for (int i = 0; i < count; i++) {
          String name = stream.readUTF();
          BlockLocation loc = new BlockLocation(stream.readUTF(), stream.readInt(), stream.readInt(), stream.readInt());
          if (name.isEmpty()) {
            name = loc.toString();
          }
          parr[i] = new PathNode(name, loc);
          parr[i].addToMapping();
        }
        //generating connections
View Full Code Here

Examples of com.bergerkiller.bukkit.common.BlockLocation

    if (prop.hasDestination()) {
      message.newLine().yellow("This minecart will attempt to reach: ").white(prop.getDestination());
    }
    message.newLine().yellow("Players entering trains: ").white(prop.getPlayersEnter() ? "Allowed" : "Denied");
    message.newLine().yellow("Can be exited by players: ").white(prop.getPlayersExit());
    BlockLocation loc = prop.getLocation();
    if (loc != null) {
      message.newLine().yellow("Current location: ").white("[", loc.x, "/", loc.y, "/", loc.z, "] in world ", loc.world);
    }
  }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.BlockLocation

    } else if (cmd.equals("teleport") || cmd.equals("tp")) {
      Permission.COMMAND_TELEPORT.handle(p);
      if (!prop.restore()) {
        p.sendMessage(ChatColor.RED + "Train location could not be found: Train is lost");
      } else {
        BlockLocation bloc = prop.getLocation();
        World world = bloc.getWorld();
        if (world == null) {
          p.sendMessage(ChatColor.RED + "Train is on a world that is not loaded (" + bloc.world + ")");
        } else {
          EntityUtil.teleport(p, new Location(world, bloc.x + 0.5, bloc.y + 0.5, bloc.z + 0.5));
        }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.BlockLocation

    } else if (cmd.equals("teleport") || cmd.equals("tp")) {
      Permission.COMMAND_TELEPORT.handle(p);
      if (!prop.restore()) {
        p.sendMessage(ChatColor.RED + "Cart location could not be found: Cart is lost");
      } else {
        BlockLocation bloc = prop.getLocation();
        World world = bloc.getWorld();
        if (world == null) {
          p.sendMessage(ChatColor.RED + "Cart is on a world that is not loaded (" + bloc.world + ")");
        } else {
          EntityUtil.teleport(p, new Location(world, bloc.x + 0.5, bloc.y + 0.5, bloc.z + 0.5));
        }
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.BlockLocation

    // Towny regen
    if (TownySettings.getRegenDelay() > 0) {
      if (event.getClickedBlock().getState().getData() instanceof Attachable) {
        Attachable attachable = (Attachable) event.getClickedBlock().getState().getData();
        BlockLocation attachedToBlock = new BlockLocation(event.getClickedBlock().getRelative(attachable.getAttachedFace()).getLocation());
        // Prevent attached blocks from falling off when interacting
        if (plugin.getTownyUniverse().hasProtectionRegenTask(attachedToBlock)) {
          event.setCancelled(true);
        }
      }
View Full Code Here

Examples of eu.stratosphere.core.fs.BlockLocation

      assertNull(blockLocations);

      blockLocations = fs.getFileBlockLocations(fileStatus, 0, SMALL_FILE_SIZE);
      assertEquals(1, blockLocations.length);

      final BlockLocation bl = blockLocations[0];
      assertNotNull(bl.getHosts());
      assertEquals(1, bl.getHosts().length);
      assertEquals(SMALL_FILE_SIZE, bl.getLength());
      assertEquals(0, bl.getOffset());
      final URI s3Uri = fs.getUri();
      assertNotNull(s3Uri);
      assertEquals(s3Uri.getHost(), bl.getHosts()[0]);

      fs.delete(dir, true);

    } catch (IOException ioe) {
      fail(ioe.getMessage());
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.