Package net.minecraft.util.math
Class BlockPos
- java.lang.Object
-
- net.minecraft.util.Vec3i
-
- net.minecraft.util.math.BlockPos
-
- All Implemented Interfaces:
java.lang.Comparable<Vec3i>
- Direct Known Subclasses:
BlockPos.MutableBlockPos
@Immutable public class BlockPos extends Vec3i
Pasted in from 1.9, with the Vec3d constructor removed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlockPos.MutableBlockPos
static class
BlockPos.PooledMutableBlockPos
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockPos
add(double x, double y, double z)
Add the given coordinates to the coordinates of this BlockPosBlockPos
add(int x, int y, int z)
Add the given coordinates to the coordinates of this BlockPosBlockPos
add(Vec3i vec)
Add the given Vector to this BlockPosBlockPos
crossProduct(Vec3i vec)
Calculate the cross product of this and the given VectorBlockPos
down()
Offset this BlockPos 1 block downBlockPos
down(double n)
Offset this BlockPos n blocks downBlockPos
east()
Offset this BlockPos 1 block in eastern directionBlockPos
east(double n)
Offset this BlockPos n blocks in eastern directionstatic BlockPos
fromLong(long serialized)
Create a BlockPos from a serialized long value (created by toLong)static java.lang.Iterable<BlockPos>
getAllInBox(BlockPos from, BlockPos to)
Create an Iterable that returns all positions in the box specified by the given cornersBlockPos
north()
Offset this BlockPos 1 block in northern directionBlockPos
north(double n)
Offset this BlockPos n blocks in northern directionBlockPos
offset(net.minecraft.util.EnumFacing facing)
Offset this BlockPos 1 block in the given directionBlockPos
offset(net.minecraft.util.EnumFacing facing, double n)
Offsets this BlockPos n blocks in the given directionBlockPos
south()
Offset this BlockPos 1 block in southern directionBlockPos
south(double n)
Offset this BlockPos n blocks in southern directionlong
toLong()
Serialize this BlockPos into a long valueBlockPos
up()
Offset this BlockPos 1 block upBlockPos
up(double n)
Offset this BlockPos n blocks upBlockPos
west()
Offset this BlockPos 1 block in western directionBlockPos
west(double n)
Offset this BlockPos n blocks in western direction
-
-
-
Field Detail
-
ORIGIN
public static final BlockPos ORIGIN
The BlockPos with all coordinates 0
-
-
Constructor Detail
-
BlockPos
public BlockPos(int x, int y, int z)
-
BlockPos
public BlockPos(double x, double y, double z)
-
BlockPos
public BlockPos(net.minecraft.entity.Entity source)
-
BlockPos
public BlockPos(Vec3i source)
-
-
Method Detail
-
add
public BlockPos add(double x, double y, double z)
Add the given coordinates to the coordinates of this BlockPos
-
add
public BlockPos add(int x, int y, int z)
Add the given coordinates to the coordinates of this BlockPos
-
up
public BlockPos up()
Offset this BlockPos 1 block up
-
up
public BlockPos up(double n)
Offset this BlockPos n blocks up
-
down
public BlockPos down()
Offset this BlockPos 1 block down
-
down
public BlockPos down(double n)
Offset this BlockPos n blocks down
-
north
public BlockPos north()
Offset this BlockPos 1 block in northern direction
-
north
public BlockPos north(double n)
Offset this BlockPos n blocks in northern direction
-
south
public BlockPos south()
Offset this BlockPos 1 block in southern direction
-
south
public BlockPos south(double n)
Offset this BlockPos n blocks in southern direction
-
west
public BlockPos west()
Offset this BlockPos 1 block in western direction
-
west
public BlockPos west(double n)
Offset this BlockPos n blocks in western direction
-
east
public BlockPos east()
Offset this BlockPos 1 block in eastern direction
-
east
public BlockPos east(double n)
Offset this BlockPos n blocks in eastern direction
-
offset
public BlockPos offset(net.minecraft.util.EnumFacing facing)
Offset this BlockPos 1 block in the given direction
-
offset
public BlockPos offset(net.minecraft.util.EnumFacing facing, double n)
Offsets this BlockPos n blocks in the given direction
-
crossProduct
public BlockPos crossProduct(Vec3i vec)
Calculate the cross product of this and the given Vector- Overrides:
crossProduct
in classVec3i
-
toLong
public long toLong()
Serialize this BlockPos into a long value
-
fromLong
public static BlockPos fromLong(long serialized)
Create a BlockPos from a serialized long value (created by toLong)
-
-