Class Vec3i

java.lang.Object
net.minecraft.util.math.Vec3i
All Implemented Interfaces:
Comparable<Vec3i>
Direct Known Subclasses:
BlockPos, ChunkSectionPos

@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
    • x

      private int x
    • y

      private int y
    • z

      private int z
  • Constructor Details

    • Vec3i

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

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

    • equals

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

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

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

      public int getX()
    • getY

      public int getY()
    • getZ

      public int getZ()
    • setX

      protected void setX​(int x)
    • setY

      protected void setY​(int y)
    • setZ

      protected void setZ​(int z)
    • up

      public Vec3i up()
    • up

      public Vec3i up​(int distance)
    • down

      public Vec3i down()
    • down

      public Vec3i down​(int distance)
    • offset

      public Vec3i offset​(Direction direction, int distance)
    • crossProduct

      public Vec3i crossProduct​(Vec3i vec)
    • isWithinDistance

      public boolean isWithinDistance​(Vec3i vec, double distance)
    • isWithinDistance

      public boolean isWithinDistance​(Position pos, double distance)
    • getSquaredDistance

      public double getSquaredDistance​(Vec3i vec)
    • getSquaredDistance

      public double getSquaredDistance​(Position pos, boolean treatAsBlockPos)
    • getSquaredDistance

      public double getSquaredDistance​(double x, double y, double z, boolean treatAsBlockPos)
    • getManhattanDistance

      public int getManhattanDistance​(Vec3i vec)
    • getComponentAlongAxis

      public int getComponentAlongAxis​(Direction.Axis axis)
    • toString

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

      @Environment(CLIENT) public String toShortString()