Record Class NodePos

java.lang.Object
java.lang.Record
net.jcm.vsch.api.pipe.NodePos
All Implemented Interfaces:
Comparable<NodePos>

public record NodePos(net.minecraft.core.BlockPos blockPos, net.minecraft.core.Direction.Axis axis, int index) extends Record implements Comparable<NodePos>
  • Field Details

  • Constructor Details

    • NodePos

      public NodePos(net.minecraft.core.BlockPos blockPos, net.minecraft.core.Direction.Axis axis, int index)
      Creates an instance of a NodePos record class.
      Parameters:
      blockPos - the value for the blockPos record component
      axis - the value for the axis record component
      index - the value for the index record component
  • Method Details

    • uniqueIndex

      public int uniqueIndex()
    • originOf

      public static NodePos originOf(net.minecraft.core.BlockPos blockPos)
    • fromUniqueIndex

      public static NodePos fromUniqueIndex(net.minecraft.core.BlockPos blockPos, int uniqueIndex)
    • fromHitResult

      public static NodePos fromHitResult(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos blockPos, net.minecraft.world.phys.Vec3 pos, double size)
    • fromVec3

      public static NodePos fromVec3(net.minecraft.world.phys.Vec3 pos, double size)
    • isOrigin

      public boolean isOrigin()
    • isOnAxis

      public boolean isOnAxis(net.minecraft.core.Direction.Axis axis)
    • equals

      public boolean equals(Object otherObj)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      otherObj - the object with which to compare
      Returns:
      true if this object is the same as the otherObj argument; false otherwise.
    • compareTo

      public int compareTo(NodePos other)
      Specified by:
      compareTo in interface Comparable<NodePos>
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • getCenter

      public net.minecraft.world.phys.Vec3 getCenter()
    • manhattanDistTo

      public double manhattanDistTo(NodePos other)
    • getAABB

      public net.minecraft.world.phys.AABB getAABB(double size)
    • canAnchoredIn

      public boolean canAnchoredIn(net.minecraft.world.level.Level level, double size)
    • writeTo

      public void writeTo(net.minecraft.network.FriendlyByteBuf buf)
    • readFrom

      public static NodePos readFrom(net.minecraft.network.FriendlyByteBuf buf)
    • streamNodePosOn

      public static Stream<NodePos> streamNodePosOn(net.minecraft.core.BlockPos pos)
    • streamPlaceHint

      public static Stream<NodePos> streamPlaceHint(NodeLevel level, net.minecraft.core.BlockPos pos)
    • streamPossibleToConnect

      public Stream<NodePos> streamPossibleToConnect()
    • connectPathTo

      public net.minecraft.core.Direction[] connectPathTo(NodePos other)
    • asRelative

      public RelativeNodePos asRelative(net.minecraft.core.BlockPos blockPos)
    • streamTouchingBlocks

      public Stream<net.minecraft.core.BlockPos> streamTouchingBlocks(net.minecraft.world.level.Level level)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • blockPos

      public net.minecraft.core.BlockPos blockPos()
      Returns the value of the blockPos record component.
      Returns:
      the value of the blockPos record component
    • axis

      public net.minecraft.core.Direction.Axis axis()
      Returns the value of the axis record component.
      Returns:
      the value of the axis record component
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component