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 classBlockPos.MutableBlockPosstatic classBlockPos.PooledMutableBlockPos
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockPosadd(double x, double y, double z)Add the given coordinates to the coordinates of this BlockPosBlockPosadd(int x, int y, int z)Add the given coordinates to the coordinates of this BlockPosBlockPosadd(Vec3i vec)Add the given Vector to this BlockPosBlockPoscrossProduct(Vec3i vec)Calculate the cross product of this and the given VectorBlockPosdown()Offset this BlockPos 1 block downBlockPosdown(double n)Offset this BlockPos n blocks downBlockPoseast()Offset this BlockPos 1 block in eastern directionBlockPoseast(double n)Offset this BlockPos n blocks in eastern directionstatic BlockPosfromLong(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 cornersBlockPosnorth()Offset this BlockPos 1 block in northern directionBlockPosnorth(double n)Offset this BlockPos n blocks in northern directionBlockPosoffset(net.minecraft.util.EnumFacing facing)Offset this BlockPos 1 block in the given directionBlockPosoffset(net.minecraft.util.EnumFacing facing, double n)Offsets this BlockPos n blocks in the given directionBlockPossouth()Offset this BlockPos 1 block in southern directionBlockPossouth(double n)Offset this BlockPos n blocks in southern directionlongtoLong()Serialize this BlockPos into a long valueBlockPosup()Offset this BlockPos 1 block upBlockPosup(double n)Offset this BlockPos n blocks upBlockPoswest()Offset this BlockPos 1 block in western directionBlockPoswest(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:
crossProductin 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)
-
-