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 pX, int pY, int pZ)
  • Method Details

    • offsetCodec

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

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

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

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

      public int getX()
    • getY

      public int getY()
    • getZ

      public int getZ()
    • setX

      protected Vec3i setX(int pX)
    • setY

      protected Vec3i setY(int pY)
    • setZ

      protected Vec3i setZ(int pZ)
    • offset

      public Vec3i offset(int pDx, int pDy, int pDz)
    • offset

      public Vec3i offset(Vec3i pVector)
    • subtract

      public Vec3i subtract(Vec3i pVector)
    • multiply

      public Vec3i multiply(int pScalar)
    • above

      public Vec3i above()
    • above

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

      public Vec3i below()
    • below

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

      public Vec3i north()
    • north

      public Vec3i north(int pDistance)
    • south

      public Vec3i south()
    • south

      public Vec3i south(int pDistance)
    • west

      public Vec3i west()
    • west

      public Vec3i west(int pDistance)
    • east

      public Vec3i east()
    • east

      public Vec3i east(int pDistance)
    • relative

      public Vec3i relative(Direction pDirection)
    • relative

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

      public Vec3i relative(Direction.Axis pAxis, int pAmount)
    • cross

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

      public boolean closerThan(Vec3i pVector, double pDistance)
    • closerToCenterThan

      public boolean closerToCenterThan(Position pPosition, double pDistance)
    • distSqr

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

      public double distToCenterSqr(Position pPosition)
    • distToCenterSqr

      public double distToCenterSqr(double pX, double pY, double pZ)
    • distToLowCornerSqr

      public double distToLowCornerSqr(double pX, double pY, double pZ)
    • distManhattan

      public int distManhattan(Vec3i pVector)
    • get

      public int get(Direction.Axis pAxis)
    • toString

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

      public String toShortString()