Class BlockPos.Mutable

All Implemented Interfaces:
Comparable<Vec3i>
Enclosing class:
BlockPos

public static class BlockPos.Mutable
extends BlockPos
  • Constructor Details

    • Mutable

      public Mutable()
    • Mutable

      public Mutable​(int x, int y, int z)
    • Mutable

      public Mutable​(double x, double y, double z)
  • Method Details

    • add

      public BlockPos add​(double x, double y, double z)
      Overrides:
      add in class BlockPos
    • add

      public BlockPos add​(int x, int y, int z)
      Overrides:
      add in class BlockPos
    • offset

      public BlockPos offset​(Direction direction, int int2)
      Overrides:
      offset in class BlockPos
    • offset

      public BlockPos offset​(Direction.Axis axis, int distance)
      Overrides:
      offset in class BlockPos
    • rotate

      public BlockPos rotate​(BlockRotation rotation)
      Overrides:
      rotate in class BlockPos
    • set

      public BlockPos.Mutable set​(int x, int y, int z)
      Sets the x, y, and z of this mutable block position.
    • set

      public BlockPos.Mutable set​(double x, double y, double z)
    • set

      public BlockPos.Mutable set​(Vec3i pos)
    • set

      public BlockPos.Mutable set​(long pos)
    • set

      public BlockPos.Mutable set​(AxisCycleDirection axis, int x, int y, int z)
    • set

      public BlockPos.Mutable set​(Vec3i pos, Direction direction)
      Sets this mutable block position to the offset position of the given pos by the given direction.
    • set

      public BlockPos.Mutable set​(Vec3i pos, int x, int y, int z)
      Sets this mutable block position to the sum of the given position and the given x, y, and z.
    • move

      public BlockPos.Mutable move​(Direction direction)
      Moves this mutable block position by 1 block in the given direction.
    • move

      public BlockPos.Mutable move​(Direction direction, int distance)
      Moves this mutable block position by the given distance in the given direction.
    • move

      public BlockPos.Mutable move​(int dx, int dy, int dz)
      Moves the mutable block position by the delta x, y, and z provided.
    • move

      public BlockPos.Mutable move​(Vec3i vec)
    • clamp

      public BlockPos.Mutable clamp​(Direction.Axis axis, int min, int max)
      Clamps the component corresponding to the given axis between min and max.
    • setX

      public void setX​(int x)
      Overrides:
      setX in class Vec3i
    • setY

      public void setY​(int y)
      Overrides:
      setY in class Vec3i
    • setZ

      public void setZ​(int z)
      Overrides:
      setZ in class Vec3i
    • toImmutable

      public BlockPos toImmutable()
      Returns an immutable block position with the same x, y, and z as this position.

      This method should be called when a block position is used as map keys as to prevent side effects of mutations of mutable block positions.

      Overrides:
      toImmutable in class BlockPos