Gets the collision {@link AxisAlignedBB} for the {@link Block} as the {@link BlockPos} coordinates.

@param world the world
@param block the block
@param pos the pos
@return the collision bounding boxes
540695
public static AxisAlignedBB[] getCollisionBoundingBoxes(World world, Block block, BlockPos pos)
	{
		return getCollisionBoundingBoxes(world, new MBlockState(pos, block), false);
	}
769387
public RootNode parseInternal(StringBuilderVar block) {
        char[] chars = block.getChars();
        int[] ixMap = new int[chars.length + 1]; // map of cleaned indices to original indices
        
        // strip out CROSSED_OUT characters and build index map
        StringBuilder clean = new StringBuilder();
        for (int i = 0; i < chars.length; i++) {
            char c = chars[i];
            if (c != CROSSED_OUT) {
                ixMap[clean.length()] = i;
                clean.append(c);
            }
        }
        ixMap[clean.length()] = chars.length;
        
        // run inner parse
        char[] cleaned = new char[clean.length()];
        clean.getChars(0, cleaned.length, cleaned, 0);
        RootNode rootNode = parseInternal(cleaned);
        
        // correct AST indices with index map
        fixIndices(rootNode, ixMap);
        
        return rootNode;
    }
715735
@SuppressWarnings("unchecked")
	private <T> ChunkData<T> createChunkData(String identifier, World world, BlockPos pos)
	{
		Chunk chunk = world.getChunkFromBlockCoords(pos);

		//System.out.println("createChunkData (" + chunk.xPosition + "/" + chunk.zPosition + ") for " + identifier);

		ChunkData<T> chunkData = new ChunkData<>((HandlerInfo<T>) handlerInfos.get(identifier));
		datas.get().put(identifier, chunk, chunkData);
		return chunkData;
	}
1233612
public static Block fromElementBlock(int positionCount, Optional<boolean[]> valueIsNull, int[] arrayOffset, Block values)
    {
        validateConstructorArguments(0, positionCount, valueIsNull.orElse(null), arrayOffset, values);
        // for performance reasons per element checks are only performed on the public construction
        for (int i = 0; i < positionCount; i++) {
            int offset = arrayOffset[i];
            int length = arrayOffset[i + 1] - offset;
            if (length < 0) {
                throw new IllegalArgumentException(format("Offset is not monotonically ascending. offsets[%s]=%s, offsets[%s]=%s", i, arrayOffset[i], i + 1, arrayOffset[i + 1]));
            }
            if (valueIsNull.isPresent() && valueIsNull.get()[i] && length != 0) {
                throw new IllegalArgumentException("A null array must have zero entries");
            }
        }
        return new ArrayBlock(0, positionCount, valueIsNull.orElse(null), arrayOffset, values);
    }
96241
function getKeyframesBlocks() {
  const type = NodeType.BlockType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const keyframesBlocksEnd = token.block_end;
  let content = [];

  while (pos < keyframesBlocksEnd) {
    if (checkSC(pos)) content = content.concat(getSC());
    else if (checkKeyframesBlock(pos)) content.push(getKeyframesBlock());
    else if (checkAtrule(pos)) content.push(getAtrule()); // @content
    else break;
  }

  return newNode(type, content, line, column);
}
1176875
@Override
  public BlockLocationsResponse getBlockLocations(GetBlockLocationsRequest req) throws IOException {
    Server.setOrignalCaller(req.getOriginalCaller());
    return new BlockLocationsResponse(getBlockLocationsInternal(req.getSrc(), req.getOffset(),
        req.getLength(), BlockMetaInfoType.NONE));
  }
842153
public static String getAChars(byte[] block, int pos, int length) {
        return new String(block, pos - 1, length).trim();
    }
1321482
public static BlockAndLocation[] locatedBlocks2BlockLocations(
     LocatedBlocks blocks) {
   if (blocks == null) {
     return new BlockAndLocation[0];
   }
   int nrBlocks = blocks.locatedBlockCount();
   BlockAndLocation[] blkLocations = new BlockAndLocation[nrBlocks];
   if (nrBlocks == 0) {
     return blkLocations;
   }
   int idx = 0;
   for (LocatedBlock blk : blocks.getLocatedBlocks()) {
     assert idx < nrBlocks : "Incorrect index";
     DatanodeInfo[] locations = blk.getLocations();
     String[] hosts = new String[locations.length];
     String[] names = new String[locations.length];
     String[] racks = new String[locations.length];
     for (int hCnt = 0; hCnt < locations.length; hCnt++) {
       hosts[hCnt] = locations[hCnt].getHostName();
       names[hCnt] = locations[hCnt].getName();
       NodeBase node = new NodeBase(names[hCnt],
                                    locations[hCnt].getNetworkLocation());
       racks[hCnt] = node.toString();
     }
     Block block = blk.getBlock();
     blkLocations[idx] = new BlockAndLocation(block.getBlockId(),
                                           block.getGenerationStamp(),
                                           names, hosts, racks,
                                           blk.getStartOffset(),
                                           block.getNumBytes(),
                                           blk.isCorrupt());
     idx++;
   }
   return blkLocations;
 }
1234557
public static AxisAlignedBB identity(BlockPos pos)
	{
		return new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);
	}
367874
public RayTraceResult getRayTraceResult(World world, Pair<Point, Point> infos, RayTraceResult result, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock)
	{
		if (infos == null)
			return result;

		RayTraceResult tmp = new RaytraceChunk(world, infos.getLeft(), infos.getRight()).trace();
		result = Raytrace.getClosestHit(Type.BLOCK, infos.getLeft(), result, tmp);
		return returnLastUncollidableBlock || result == null || result.typeOfHit == Type.BLOCK ? result : null;
	}
1238454
public static Optional<Chunk> getLoadedChunk(World world, BlockPos pos)
	{
		if (world.getChunkProvider() == null)
			return Optional.empty();

		return Optional.ofNullable(world.getChunkProvider().getLoadedChunk(pos.getX() >> 4, pos.getZ() >> 4));
	}
943620
public static int getBlockNrForAlignPos(AFPChain afpChain, int aligPos){
		// moved here from DisplayAFP;

		int blockNum = afpChain.getBlockNum();

		int[] optLen = afpChain.getOptLen();
		int[][][] optAln = afpChain.getOptAln();

		int len = 0;
		int p1b=0;
		int p2b=0;

		for(int i = 0; i < blockNum; i ++)  {

			for(int j = 0; j < optLen[i]; j ++) {

				int p1 = optAln[i][0][j];
				int p2 = optAln[i][1][j];

				if (len != 0) {
					// check for gapped region
					int lmax = (p1 - p1b - 1)>(p2 - p2b - 1)?(p1 - p1b - 1):(p2 - p2b - 1);
					for(int k = 0; k < lmax; k ++)      {
						len++;
					}
				}


				p1b = p1;
				p2b = p2;
				if ( len >= aligPos) {

					return i;
				}
				len++;
			}
		}

		return blockNum;

	}
1156675
static ArrayBlock createArrayBlockInternal(int arrayOffset, int positionCount, @Nullable boolean[] valueIsNull, int[] offsets, Block values)
    {
        validateConstructorArguments(arrayOffset, positionCount, valueIsNull, offsets, values);
        return new ArrayBlock(arrayOffset, positionCount, valueIsNull, offsets, values);
    }
1173484
public static Rect getTilesRect(final BoundingBox pBB,
                                    final int pZoomLevel){
        final int mapTileUpperBound = 1 << pZoomLevel;
        final int right = MapView.getTileSystem().getTileXFromLongitude(pBB.getLonEast(), pZoomLevel);
        final int bottom = MapView.getTileSystem().getTileYFromLatitude(pBB.getLatSouth(), pZoomLevel);
        final int left = MapView.getTileSystem().getTileXFromLongitude(pBB.getLonWest(), pZoomLevel);
        final int top = MapView.getTileSystem().getTileYFromLatitude(pBB.getLatNorth(), pZoomLevel);
        int width = right - left + 1; // handling the modulo
        if (width <= 0) {
            width += mapTileUpperBound;
        }
        int height = bottom - top + 1; // handling the modulo
        if (height <= 0) {
            height += mapTileUpperBound;
        }
        return new Rect(left, top, left + width - 1, top + height - 1);
    }
1145304
private void addCoord(World world, BlockPos pos, int size)
	{
		getAffectedChunks(world, pos.getX(), pos.getZ(), size).forEach(c -> addCoord(c, pos));
	}
217901
public AlignedBox3d toBoundingBoxWithCtrlPoints() {
		AlignedBox3d bb = this.logicalBounds==null ? null : this.logicalBounds.get();
		if (bb==null) {
			bb = new AlignedBox3d();
			buildLogicalBoundingBox(bb);
			this.logicalBounds = new SoftReference<>(bb);
		}
		return bb;
	}
134201
@Pure
	public Point2d getPosition2D() {
		final Rectangle2d b = getBoundingBox();
		if (b == null) {
			return null;
		}
		return new Point2d(b.getCenterX(), b.getCenterY());
	}