Class BlockPos
java.lang.Object
net.minecraft.core.Vec3i
net.minecraft.core.BlockPos
- All Implemented Interfaces:
Comparable<Vec3i>
- Direct Known Subclasses:
BlockPos.MutableBlockPos
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BlockPos> static final intstatic final intprivate static final longstatic final intprivate static final longprivate static final longstatic final StreamCodec<io.netty.buffer.ByteBuf, BlockPos> private static final intprivate static final intprivate static final intstatic final BlockPos -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabove()above(int steps) longasLong()static longasLong(int x, int y, int z) atY(int y) below()below(int steps) betweenClosed(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) betweenClosed(BlockPos a, BlockPos b) betweenClosed(AABB box) betweenClosedStream(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) betweenClosedStream(BoundingBox boundingBox) betweenClosedStream(AABB box) betweenCornersInDirection(int firstCornerX, int firstCornerY, int firstCornerZ, int secondCornerX, int secondCornerY, int secondCornerZ, Vec3 direction) betweenCornersInDirection(BlockPos firstCorner, BlockPos secondCorner, Vec3 direction) betweenCornersInDirection(AABB aabb, Vec3 direction) static intbreadthFirstTraversal(BlockPos startPos, int maxDepth, int maxCount, BiConsumer<BlockPos, Consumer<BlockPos>> neighbourProvider, Function<BlockPos, BlockPos.TraversalNodeStatus> nodeProcessor) clampLocationWithin(Vec3 location) static BlockPoscontaining(double x, double y, double z) static BlockPoscontaining(Position pos) east()east(int steps) findClosestMatch(BlockPos startPos, int horizontalSearchRadius, int verticalSearchRadius, Predicate<BlockPos> predicate) static longgetFlatIndex(long neighborBlockNode) static intgetX(long blockNode) static intgetY(long blockNode) static intgetZ(long blockNode) static BlockPosstatic BlockPosmultiply(int scale) mutable()north()north(int steps) static BlockPosof(long blockNode) offset(int x, int y, int z) static longoffset(long blockNode, int stepX, int stepY, int stepZ) static longrandomBetweenClosed(RandomSource random, int limit, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) randomInCube(RandomSource random, int limit, BlockPos center, int sizeToScanInAllDirections) relative(Direction.Axis axis, int steps) south()south(int steps) static Iterable<BlockPos.MutableBlockPos> spiralAround(BlockPos center, int radius, Direction firstDirection, Direction secondDirection) squareOutSouthEast(BlockPos from) Deprecated.west()west(int steps) withinManhattan(BlockPos origin, int reachX, int reachY, int reachZ) withinManhattanStream(BlockPos origin, int reachX, int reachY, int reachZ) Methods inherited from class Vec3i
closerThan, closerToCenterThan, compareTo, distChessboard, distManhattan, distSqr, distToCenterSqr, distToCenterSqr, distToLowCornerSqr, equals, get, getX, getY, getZ, hashCode, multiply, offsetCodec, setX, setY, setZ, toMutable, toShortString, toString
-
Field Details
-
CODEC
-
STREAM_CODEC
-
ZERO
-
PACKED_HORIZONTAL_LENGTH
public static final int PACKED_HORIZONTAL_LENGTH -
PACKED_Y_LENGTH
public static final int PACKED_Y_LENGTH -
PACKED_X_MASK
private static final long PACKED_X_MASK -
PACKED_Y_MASK
private static final long PACKED_Y_MASK -
PACKED_Z_MASK
private static final long PACKED_Z_MASK -
Y_OFFSET
private static final int Y_OFFSET- See Also:
-
Z_OFFSET
private static final int Z_OFFSET -
X_OFFSET
private static final int X_OFFSET -
MAX_HORIZONTAL_COORDINATE
public static final int MAX_HORIZONTAL_COORDINATE
-
-
Constructor Details
-
BlockPos
public BlockPos(int x, int y, int z) -
BlockPos
-
-
Method Details
-
offset
-
offset
public static long offset(long blockNode, int stepX, int stepY, int stepZ) -
getX
public static int getX(long blockNode) -
getY
public static int getY(long blockNode) -
getZ
public static int getZ(long blockNode) -
of
-
containing
-
containing
-
min
-
max
-
asLong
public long asLong() -
asLong
public static long asLong(int x, int y, int z) -
getFlatIndex
public static long getFlatIndex(long neighborBlockNode) -
offset
-
getCenter
-
getBottomCenter
-
offset
-
subtract
-
multiply
-
above
-
above
-
below
-
below
-
north
-
north
-
south
-
south
-
west
-
west
-
east
-
east
-
relative
-
relative
-
relative
-
rotate
-
cross
-
atY
-
immutable
-
mutable
-
clampLocationWithin
-
randomInCube
public static Iterable<BlockPos> randomInCube(RandomSource random, int limit, BlockPos center, int sizeToScanInAllDirections) -
squareOutSouthEast
Deprecated. -
randomBetweenClosed
public static Iterable<BlockPos> randomBetweenClosed(RandomSource random, int limit, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) -
withinManhattan
-
findClosestMatch
-
withinManhattanStream
-
betweenClosed
-
betweenClosed
-
betweenClosedStream
-
betweenClosedStream
-
betweenClosedStream
-
betweenClosedStream
-
betweenClosed
-
spiralAround
public static Iterable<BlockPos.MutableBlockPos> spiralAround(BlockPos center, int radius, Direction firstDirection, Direction secondDirection) -
breadthFirstTraversal
public static int breadthFirstTraversal(BlockPos startPos, int maxDepth, int maxCount, BiConsumer<BlockPos, Consumer<BlockPos>> neighbourProvider, Function<BlockPos, BlockPos.TraversalNodeStatus> nodeProcessor) -
betweenCornersInDirection
-
betweenCornersInDirection
-
betweenCornersInDirection
-