Class SFVec3i

java.lang.Object
com.soulfiremc.server.pathfinding.SFVec3i

public final class SFVec3i extends Object
A simple 3D integer vector. This class is used instead of BlockPos because this uses direct field access instead of getters. Even though the JIT compiler could optimize this, it's still faster to use this class.
  • Field Details

    • ZERO

      public static final SFVec3i ZERO
    • x

      public final int x
    • y

      public final int y
    • z

      public final int z
  • Constructor Details

    • SFVec3i

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

    • fromDouble

      public static SFVec3i fromDouble(net.minecraft.world.phys.Vec3 vec)
    • fromInt

      public static SFVec3i fromInt(net.minecraft.core.BlockPos vec)
    • from

      public static SFVec3i from(int x, int y, int z)
    • longHash

      public static long longHash(int x, int y, int z)
    • equals

      public boolean equals(SFVec3i other)
    • equals

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

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

      public long asMinecraftLong()
    • add

      public SFVec3i add(int x, int y, int z)
    • add

      public SFVec3i add(SFVec3i other)
    • sub

      public SFVec3i sub(int x, int y, int z)
    • sub

      public SFVec3i sub(SFVec3i other)
    • toVec3

      public net.minecraft.world.phys.Vec3 toVec3()
    • toBlockPos

      public net.minecraft.core.BlockPos toBlockPos()
    • toString

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

      public String formatXYZ()
    • distance

      public double distance(SFVec3i goal)