Class 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static BlockPos ORIGIN
      The BlockPos with all coordinates 0
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockPos​(double x, double y, double z)  
      BlockPos​(int x, int y, int z)  
      BlockPos​(net.minecraft.entity.Entity source)  
      BlockPos​(Vec3i source)  
    • 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 BlockPos
      BlockPos add​(int x, int y, int z)
      Add the given coordinates to the coordinates of this BlockPos
      BlockPos add​(Vec3i vec)
      Add the given Vector to this BlockPos
      BlockPos crossProduct​(Vec3i vec)
      Calculate the cross product of this and the given Vector
      BlockPos down()
      Offset this BlockPos 1 block down
      BlockPos down​(double n)
      Offset this BlockPos n blocks down
      BlockPos east()
      Offset this BlockPos 1 block in eastern direction
      BlockPos east​(double n)
      Offset this BlockPos n blocks in eastern direction
      static 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 corners
      BlockPos north()
      Offset this BlockPos 1 block in northern direction
      BlockPos north​(double n)
      Offset this BlockPos n blocks in northern direction
      BlockPos offset​(net.minecraft.util.EnumFacing facing)
      Offset this BlockPos 1 block in the given direction
      BlockPos offset​(net.minecraft.util.EnumFacing facing, double n)
      Offsets this BlockPos n blocks in the given direction
      BlockPos south()
      Offset this BlockPos 1 block in southern direction
      BlockPos south​(double n)
      Offset this BlockPos n blocks in southern direction
      long toLong()
      Serialize this BlockPos into a long value
      BlockPos up()
      Offset this BlockPos 1 block up
      BlockPos up​(double n)
      Offset this BlockPos n blocks up
      BlockPos west()
      Offset this BlockPos 1 block in western direction
      BlockPos west​(double n)
      Offset this BlockPos n blocks in western direction
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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
      • add

        public BlockPos add​(Vec3i vec)
        Add the given Vector to 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 class Vec3i
      • 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)
      • getAllInBox

        public static java.lang.Iterable<BlockPos> getAllInBox​(BlockPos from,
                                                               BlockPos to)
        Create an Iterable that returns all positions in the box specified by the given corners