Class Vec3i

java.lang.Object
net.minecraft.core.Vec3i
All Implemented Interfaces:
Comparable<Vec3i>
Direct Known Subclasses:
BlockPos, SectionPos

@Immutable public class Vec3i extends Object implements Comparable<Vec3i>
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<Vec3i> CODEC
    • ZERO

      public static final Vec3i ZERO
      An immutable vector with zero as all coordinates.
    • x

      private int x
    • y

      private int y
    • z

      private int z
  • Constructor Details

    • Vec3i

      public Vec3i(int x, int y, int z)
  • Method Details

    • offsetCodec

      public static com.mojang.serialization.Codec<Vec3i> offsetCodec(int maxOffset)
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(Vec3i other)
      Specified by:
      compareTo in interface Comparable<Vec3i>
    • getX

      public int getX()
    • getY

      public int getY()
    • getZ

      public int getZ()
    • setX

      protected Vec3i setX(int x)
    • setY

      protected Vec3i setY(int y)
    • setZ

      protected Vec3i setZ(int z)
    • offset

      public Vec3i offset(int dx, int dy, int dz)
    • offset

      public Vec3i offset(Vec3i vector)
    • subtract

      public Vec3i subtract(Vec3i vector)
    • multiply

      public Vec3i multiply(int scalar)
    • above

      public Vec3i above()
    • above

      public Vec3i above(int distance)
      Offset this vector upwards by the given distance.
    • below

      public Vec3i below()
    • below

      public Vec3i below(int distance)
      Offset this vector downwards by the given distance.
    • north

      public Vec3i north()
    • north

      public Vec3i north(int distance)
    • south

      public Vec3i south()
    • south

      public Vec3i south(int distance)
    • west

      public Vec3i west()
    • west

      public Vec3i west(int distance)
    • east

      public Vec3i east()
    • east

      public Vec3i east(int distance)
    • relative

      public Vec3i relative(Direction direction)
    • relative

      public Vec3i relative(Direction direction, int distance)
      Offsets this Vector by the given distance in the specified direction.
    • relative

      public Vec3i relative(Direction.Axis axis, int amount)
    • cross

      public Vec3i cross(Vec3i vector)
      Calculate the cross product of this and the given Vector
    • closerThan

      public boolean closerThan(Vec3i vector, double distance)
    • closerToCenterThan

      public boolean closerToCenterThan(Position position, double distance)
    • distSqr

      public double distSqr(Vec3i vector)
      Calculate squared distance to the given Vector
    • distToCenterSqr

      public double distToCenterSqr(Position position)
    • distToCenterSqr

      public double distToCenterSqr(double x, double y, double z)
    • distToLowCornerSqr

      public double distToLowCornerSqr(double x, double y, double z)
    • distManhattan

      public int distManhattan(Vec3i vector)
    • get

      public int get(Direction.Axis axis)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toShortString

      public String toShortString()