Class Vec3i

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

@Unmodifiable public class Vec3i extends Object implements Comparable<Vec3i>
A publicly read-only but mutable vector composed of 3 integers.
Mappings:
Namespace Name
official hc
intermediary net/minecraft/class_2382
named net/minecraft/util/math/Vec3i
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<Vec3i> CODEC
      Mappings:
      Namespace Name Mixin selector
      official f Lhc;f:Lcom/mojang/serialization/Codec;
      intermediary field_25123 Lnet/minecraft/class_2382;field_25123:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/util/math/Vec3i;CODEC:Lcom/mojang/serialization/Codec;
    • ZERO

      public static final Vec3i ZERO
      Mappings:
      Namespace Name Mixin selector
      official g Lhc;g:Lhc;
      intermediary field_11176 Lnet/minecraft/class_2382;field_11176:Lnet/minecraft/class_2382;
      named ZERO Lnet/minecraft/util/math/Vec3i;ZERO:Lnet/minecraft/util/math/Vec3i;
    • x

      private int x
      Mappings:
      Namespace Name Mixin selector
      official a Lhc;a:I
      intermediary field_11175 Lnet/minecraft/class_2382;field_11175:I
      named x Lnet/minecraft/util/math/Vec3i;x:I
    • y

      private int y
      Mappings:
      Namespace Name Mixin selector
      official b Lhc;b:I
      intermediary field_11174 Lnet/minecraft/class_2382;field_11174:I
      named y Lnet/minecraft/util/math/Vec3i;y:I
    • z

      private int z
      Mappings:
      Namespace Name Mixin selector
      official c Lhc;c:I
      intermediary field_11173 Lnet/minecraft/class_2382;field_11173:I
      named z Lnet/minecraft/util/math/Vec3i;z:I
  • Constructor Details

    • Vec3i

      public Vec3i(int x, int y, int z)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lhc;<init>(III)V
      intermediary <init> Lnet/minecraft/class_2382;<init>(III)V
      named <init> Lnet/minecraft/util/math/Vec3i;<init>(III)V
    • Vec3i

      public Vec3i(double x, double y, double z)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lhc;<init>(DDD)V
      intermediary <init> Lnet/minecraft/class_2382;<init>(DDD)V
      named <init> Lnet/minecraft/util/math/Vec3i;<init>(DDD)V
  • Method Details

    • createRangeValidator

      private static Function<Vec3i,com.mojang.serialization.DataResult<Vec3i>> createRangeValidator(int maxAbsValue)
      Mappings:
      Namespace Name Mixin selector
      official a Lhc;a(I)Ljava/util/function/Function;
      intermediary method_39675 Lnet/minecraft/class_2382;method_39675(I)Ljava/util/function/Function;
      named createRangeValidator Lnet/minecraft/util/math/Vec3i;createRangeValidator(I)Ljava/util/function/Function;
    • createOffsetCodec

      public static com.mojang.serialization.Codec<Vec3i> createOffsetCodec(int maxAbsValue)
      Mappings:
      Namespace Name Mixin selector
      official v Lhc;v(I)Lcom/mojang/serialization/Codec;
      intermediary method_39677 Lnet/minecraft/class_2382;method_39677(I)Lcom/mojang/serialization/Codec;
      named createOffsetCodec Lnet/minecraft/util/math/Vec3i;createOffsetCodec(I)Lcom/mojang/serialization/Codec;
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Mappings:
      Namespace Name Mixin selector
      official equals Lhc;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_2382;equals(Ljava/lang/Object;)Z
      named equals Lnet/minecraft/util/math/Vec3i;equals(Ljava/lang/Object;)Z
    • hashCode

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

      public int compareTo(Vec3i vec3i)
      Specified by:
      compareTo in interface Comparable<Vec3i>
      Mappings:
      Namespace Name Mixin selector
      official i Lhc;i(Lhc;)I
      intermediary method_10265 Lnet/minecraft/class_2382;method_10265(Lnet/minecraft/class_2382;)I
      named compareTo Lnet/minecraft/util/math/Vec3i;compareTo(Lnet/minecraft/util/math/Vec3i;)I
    • getX

      public int getX()
      Mappings:
      Namespace Name Mixin selector
      official u Lhc;u()I
      intermediary method_10263 Lnet/minecraft/class_2382;method_10263()I
      named getX Lnet/minecraft/util/math/Vec3i;getX()I
    • getY

      public int getY()
      Mappings:
      Namespace Name Mixin selector
      official v Lhc;v()I
      intermediary method_10264 Lnet/minecraft/class_2382;method_10264()I
      named getY Lnet/minecraft/util/math/Vec3i;getY()I
    • getZ

      public int getZ()
      Mappings:
      Namespace Name Mixin selector
      official w Lhc;w()I
      intermediary method_10260 Lnet/minecraft/class_2382;method_10260()I
      named getZ Lnet/minecraft/util/math/Vec3i;getZ()I
    • setX

      protected Vec3i setX(int x)
      Mappings:
      Namespace Name Mixin selector
      official u Lhc;u(I)Lhc;
      intermediary method_20787 Lnet/minecraft/class_2382;method_20787(I)Lnet/minecraft/class_2382;
      named setX Lnet/minecraft/util/math/Vec3i;setX(I)Lnet/minecraft/util/math/Vec3i;
    • setY

      protected Vec3i setY(int y)
      Mappings:
      Namespace Name Mixin selector
      official t Lhc;t(I)Lhc;
      intermediary method_10099 Lnet/minecraft/class_2382;method_10099(I)Lnet/minecraft/class_2382;
      named setY Lnet/minecraft/util/math/Vec3i;setY(I)Lnet/minecraft/util/math/Vec3i;
    • setZ

      protected Vec3i setZ(int z)
      Mappings:
      Namespace Name Mixin selector
      official s Lhc;s(I)Lhc;
      intermediary method_20788 Lnet/minecraft/class_2382;method_20788(I)Lnet/minecraft/class_2382;
      named setZ Lnet/minecraft/util/math/Vec3i;setZ(I)Lnet/minecraft/util/math/Vec3i;
    • add

      public Vec3i add(double x, double y, double z)
      Mappings:
      Namespace Name Mixin selector
      official b Lhc;b(DDD)Lhc;
      intermediary method_35849 Lnet/minecraft/class_2382;method_35849(DDD)Lnet/minecraft/class_2382;
      named add Lnet/minecraft/util/math/Vec3i;add(DDD)Lnet/minecraft/util/math/Vec3i;
    • add

      public Vec3i add(int x, int y, int z)
      Returns another Vec3i whose coordinates have the parameter x, y, and z added to the coordinates of this vector.

      This method always returns an immutable object.

      Mappings:
      Namespace Name Mixin selector
      official c Lhc;c(III)Lhc;
      intermediary method_34592 Lnet/minecraft/class_2382;method_34592(III)Lnet/minecraft/class_2382;
      named add Lnet/minecraft/util/math/Vec3i;add(III)Lnet/minecraft/util/math/Vec3i;
    • add

      public Vec3i add(Vec3i vec)
      Mappings:
      Namespace Name Mixin selector
      official f Lhc;f(Lhc;)Lhc;
      intermediary method_35853 Lnet/minecraft/class_2382;method_35853(Lnet/minecraft/class_2382;)Lnet/minecraft/class_2382;
      named add Lnet/minecraft/util/math/Vec3i;add(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/Vec3i;
    • subtract

      public Vec3i subtract(Vec3i vec)
      Mappings:
      Namespace Name Mixin selector
      official e Lhc;e(Lhc;)Lhc;
      intermediary method_35852 Lnet/minecraft/class_2382;method_35852(Lnet/minecraft/class_2382;)Lnet/minecraft/class_2382;
      named subtract Lnet/minecraft/util/math/Vec3i;subtract(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/Vec3i;
    • multiply

      public Vec3i multiply(int scale)
      Mappings:
      Namespace Name Mixin selector
      official o Lhc;o(I)Lhc;
      intermediary method_35862 Lnet/minecraft/class_2382;method_35862(I)Lnet/minecraft/class_2382;
      named multiply Lnet/minecraft/util/math/Vec3i;multiply(I)Lnet/minecraft/util/math/Vec3i;
    • up

      public Vec3i up()
      Mappings:
      Namespace Name Mixin selector
      official o Lhc;o()Lhc;
      intermediary method_30931 Lnet/minecraft/class_2382;method_30931()Lnet/minecraft/class_2382;
      named up Lnet/minecraft/util/math/Vec3i;up()Lnet/minecraft/util/math/Vec3i;
    • up

      public Vec3i up(int distance)
      Mappings:
      Namespace Name Mixin selector
      official n Lhc;n(I)Lhc;
      intermediary method_30930 Lnet/minecraft/class_2382;method_30930(I)Lnet/minecraft/class_2382;
      named up Lnet/minecraft/util/math/Vec3i;up(I)Lnet/minecraft/util/math/Vec3i;
    • down

      public Vec3i down()
      Mappings:
      Namespace Name Mixin selector
      official n Lhc;n()Lhc;
      intermediary method_23228 Lnet/minecraft/class_2382;method_23228()Lnet/minecraft/class_2382;
      named down Lnet/minecraft/util/math/Vec3i;down()Lnet/minecraft/util/math/Vec3i;
    • down

      public Vec3i down(int distance)
      Mappings:
      Namespace Name Mixin selector
      official m Lhc;m(I)Lhc;
      intermediary method_23227 Lnet/minecraft/class_2382;method_23227(I)Lnet/minecraft/class_2382;
      named down Lnet/minecraft/util/math/Vec3i;down(I)Lnet/minecraft/util/math/Vec3i;
    • north

      public Vec3i north()
      Mappings:
      Namespace Name Mixin selector
      official m Lhc;m()Lhc;
      intermediary method_35861 Lnet/minecraft/class_2382;method_35861()Lnet/minecraft/class_2382;
      named north Lnet/minecraft/util/math/Vec3i;north()Lnet/minecraft/util/math/Vec3i;
    • north

      public Vec3i north(int distance)
      Mappings:
      Namespace Name Mixin selector
      official l Lhc;l(I)Lhc;
      intermediary method_35860 Lnet/minecraft/class_2382;method_35860(I)Lnet/minecraft/class_2382;
      named north Lnet/minecraft/util/math/Vec3i;north(I)Lnet/minecraft/util/math/Vec3i;
    • south

      public Vec3i south()
      Mappings:
      Namespace Name Mixin selector
      official l Lhc;l()Lhc;
      intermediary method_35859 Lnet/minecraft/class_2382;method_35859()Lnet/minecraft/class_2382;
      named south Lnet/minecraft/util/math/Vec3i;south()Lnet/minecraft/util/math/Vec3i;
    • south

      public Vec3i south(int distance)
      Mappings:
      Namespace Name Mixin selector
      official k Lhc;k(I)Lhc;
      intermediary method_35858 Lnet/minecraft/class_2382;method_35858(I)Lnet/minecraft/class_2382;
      named south Lnet/minecraft/util/math/Vec3i;south(I)Lnet/minecraft/util/math/Vec3i;
    • west

      public Vec3i west()
      Mappings:
      Namespace Name Mixin selector
      official k Lhc;k()Lhc;
      intermediary method_35857 Lnet/minecraft/class_2382;method_35857()Lnet/minecraft/class_2382;
      named west Lnet/minecraft/util/math/Vec3i;west()Lnet/minecraft/util/math/Vec3i;
    • west

      public Vec3i west(int distance)
      Mappings:
      Namespace Name Mixin selector
      official j Lhc;j(I)Lhc;
      intermediary method_35856 Lnet/minecraft/class_2382;method_35856(I)Lnet/minecraft/class_2382;
      named west Lnet/minecraft/util/math/Vec3i;west(I)Lnet/minecraft/util/math/Vec3i;
    • east

      public Vec3i east()
      Mappings:
      Namespace Name Mixin selector
      official j Lhc;j()Lhc;
      intermediary method_35855 Lnet/minecraft/class_2382;method_35855()Lnet/minecraft/class_2382;
      named east Lnet/minecraft/util/math/Vec3i;east()Lnet/minecraft/util/math/Vec3i;
    • east

      public Vec3i east(int distance)
      Mappings:
      Namespace Name Mixin selector
      official i Lhc;i(I)Lhc;
      intermediary method_35854 Lnet/minecraft/class_2382;method_35854(I)Lnet/minecraft/class_2382;
      named east Lnet/minecraft/util/math/Vec3i;east(I)Lnet/minecraft/util/math/Vec3i;
    • offset

      public Vec3i offset(Direction direction)
      Mappings:
      Namespace Name Mixin selector
      official b Lhc;b(Lgm;)Lhc;
      intermediary method_35851 Lnet/minecraft/class_2382;method_35851(Lnet/minecraft/class_2350;)Lnet/minecraft/class_2382;
      named offset Lnet/minecraft/util/math/Vec3i;offset(Lnet/minecraft/util/math/Direction;)Lnet/minecraft/util/math/Vec3i;
    • offset

      public Vec3i offset(Direction direction, int distance)
      Mappings:
      Namespace Name Mixin selector
      official b Lhc;b(Lgm;I)Lhc;
      intermediary method_23226 Lnet/minecraft/class_2382;method_23226(Lnet/minecraft/class_2350;I)Lnet/minecraft/class_2382;
      named offset Lnet/minecraft/util/math/Vec3i;offset(Lnet/minecraft/util/math/Direction;I)Lnet/minecraft/util/math/Vec3i;
    • offset

      public Vec3i offset(Direction.Axis axis, int distance)
      Mappings:
      Namespace Name Mixin selector
      official b Lhc;b(Lgm$a;I)Lhc;
      intermediary method_35850 Lnet/minecraft/class_2382;method_35850(Lnet/minecraft/class_2350$class_2351;I)Lnet/minecraft/class_2382;
      named offset Lnet/minecraft/util/math/Vec3i;offset(Lnet/minecraft/util/math/Direction$Axis;I)Lnet/minecraft/util/math/Vec3i;
    • crossProduct

      public Vec3i crossProduct(Vec3i vec)
      Mappings:
      Namespace Name Mixin selector
      official d Lhc;d(Lhc;)Lhc;
      intermediary method_10259 Lnet/minecraft/class_2382;method_10259(Lnet/minecraft/class_2382;)Lnet/minecraft/class_2382;
      named crossProduct Lnet/minecraft/util/math/Vec3i;crossProduct(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/Vec3i;
    • isWithinDistance

      public boolean isWithinDistance(Vec3i vec, double distance)
      Mappings:
      Namespace Name Mixin selector
      official a Lhc;a(Lhc;D)Z
      intermediary method_19771 Lnet/minecraft/class_2382;method_19771(Lnet/minecraft/class_2382;D)Z
      named isWithinDistance Lnet/minecraft/util/math/Vec3i;isWithinDistance(Lnet/minecraft/util/math/Vec3i;D)Z
    • isWithinDistance

      public boolean isWithinDistance(Position pos, double distance)
      Mappings:
      Namespace Name Mixin selector
      official a Lhc;a(Lgu;D)Z
      intermediary method_19769 Lnet/minecraft/class_2382;method_19769(Lnet/minecraft/class_2374;D)Z
      named isWithinDistance Lnet/minecraft/util/math/Vec3i;isWithinDistance(Lnet/minecraft/util/math/Position;D)Z
    • getSquaredDistance

      public double getSquaredDistance(Vec3i vec)
      Mappings:
      Namespace Name Mixin selector
      official j Lhc;j(Lhc;)D
      intermediary method_10262 Lnet/minecraft/class_2382;method_10262(Lnet/minecraft/class_2382;)D
      named getSquaredDistance Lnet/minecraft/util/math/Vec3i;getSquaredDistance(Lnet/minecraft/util/math/Vec3i;)D
    • getSquaredDistance

      public double getSquaredDistance(Position pos, boolean treatAsBlockPos)
      Mappings:
      Namespace Name Mixin selector
      official a Lhc;a(Lgu;Z)D
      intermediary method_19770 Lnet/minecraft/class_2382;method_19770(Lnet/minecraft/class_2374;Z)D
      named getSquaredDistance Lnet/minecraft/util/math/Vec3i;getSquaredDistance(Lnet/minecraft/util/math/Position;Z)D
    • getSquaredDistance

      public double getSquaredDistance(Vec3i vec, boolean treatAsBlockPos)
      Mappings:
      Namespace Name Mixin selector
      official a Lhc;a(Lhc;Z)D
      intermediary method_33106 Lnet/minecraft/class_2382;method_33106(Lnet/minecraft/class_2382;Z)D
      named getSquaredDistance Lnet/minecraft/util/math/Vec3i;getSquaredDistance(Lnet/minecraft/util/math/Vec3i;Z)D
    • getSquaredDistance

      public double getSquaredDistance(double x, double y, double z, boolean treatAsBlockPos)
      Mappings:
      Namespace Name Mixin selector
      official a Lhc;a(DDDZ)D
      intermediary method_10268 Lnet/minecraft/class_2382;method_10268(DDDZ)D
      named getSquaredDistance Lnet/minecraft/util/math/Vec3i;getSquaredDistance(DDDZ)D
    • getManhattanDistance

      public int getManhattanDistance(Vec3i vec)
      Mappings:
      Namespace Name Mixin selector
      official k Lhc;k(Lhc;)I
      intermediary method_19455 Lnet/minecraft/class_2382;method_19455(Lnet/minecraft/class_2382;)I
      named getManhattanDistance Lnet/minecraft/util/math/Vec3i;getManhattanDistance(Lnet/minecraft/util/math/Vec3i;)I
    • getComponentAlongAxis

      public int getComponentAlongAxis(Direction.Axis axis)
      Mappings:
      Namespace Name Mixin selector
      official a Lhc;a(Lgm$a;)I
      intermediary method_30558 Lnet/minecraft/class_2382;method_30558(Lnet/minecraft/class_2350$class_2351;)I
      named getComponentAlongAxis Lnet/minecraft/util/math/Vec3i;getComponentAlongAxis(Lnet/minecraft/util/math/Direction$Axis;)I
    • toString

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

      public String toShortString()
      Mappings:
      Namespace Name Mixin selector
      official x Lhc;x()Ljava/lang/String;
      intermediary method_23854 Lnet/minecraft/class_2382;method_23854()Ljava/lang/String;
      named toShortString Lnet/minecraft/util/math/Vec3i;toShortString()Ljava/lang/String;