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
    • STREAM_CODEC

      public static final StreamCodec<io.netty.buffer.ByteBuf, Vec3i> STREAM_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 maxOffsetPerAxis)
    • equals

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

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

      public int compareTo(Vec3i pos)
      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 x, int y, int z)
    • offset

      public Vec3i offset(Vec3i vec)
    • subtract

      public Vec3i subtract(Vec3i vec)
    • multiply

      public Vec3i multiply(int scale)
    • multiply

      public Vec3i multiply(int xScale, int yScale, int zScale)
    • above

      public Vec3i above()
    • above

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

      public Vec3i below()
    • below

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

      public Vec3i north()
    • north

      public Vec3i north(int steps)
    • south

      public Vec3i south()
    • south

      public Vec3i south(int steps)
    • west

      public Vec3i west()
    • west

      public Vec3i west(int steps)
    • east

      public Vec3i east()
    • east

      public Vec3i east(int steps)
    • relative

      public Vec3i relative(Direction direction)
    • relative

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

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

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

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

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

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

      public double distToCenterSqr(Position pos)
    • 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 pos)
    • distChessboard

      public int distChessboard(Vec3i pos)
    • get

      public int get(Direction.Axis axis)
    • toMutable

      public Vector3i toMutable()
    • toString

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

      public String toShortString()