Package net.jcm.vsch.api.pipe
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionNodePos(net.minecraft.core.BlockPos blockPos, net.minecraft.core.Direction.Axis axis, int index) Creates an instance of aNodePosrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasRelative(net.minecraft.core.BlockPos blockPos) net.minecraft.core.Direction.Axisaxis()Returns the value of theaxisrecord component.net.minecraft.core.BlockPosblockPos()Returns the value of theblockPosrecord component.booleancanAnchoredIn(net.minecraft.world.level.Level level, double size) intnet.minecraft.core.Direction[]connectPathTo(NodePos other) booleanIndicates whether some other object is "equal to" this one.static NodePosfromHitResult(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos blockPos, net.minecraft.world.phys.Vec3 pos, double size) static NodePosfromUniqueIndex(net.minecraft.core.BlockPos blockPos, int uniqueIndex) static NodePosfromVec3(net.minecraft.world.phys.Vec3 pos, double size) net.minecraft.world.phys.AABBgetAABB(double size) net.minecraft.world.phys.Vec3inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.booleanisOnAxis(net.minecraft.core.Direction.Axis axis) booleanisOrigin()doublemanhattanDistTo(NodePos other) static NodePosoriginOf(net.minecraft.core.BlockPos blockPos) static NodePosreadFrom(net.minecraft.network.FriendlyByteBuf buf) streamNodePosOn(net.minecraft.core.BlockPos pos) streamPlaceHint(NodeLevel level, net.minecraft.core.BlockPos pos) Stream<net.minecraft.core.BlockPos>streamTouchingBlocks(net.minecraft.world.level.Level level) final StringtoString()Returns a string representation of this record class.intvoidwriteTo(net.minecraft.network.FriendlyByteBuf buf)
-
Field Details
-
INDEX_BOUND
public static final int INDEX_BOUND- See Also:
-
UNIQUE_INDEX_BOUND
public static final int UNIQUE_INDEX_BOUND- See Also:
-
-
Constructor Details
-
NodePos
public NodePos(net.minecraft.core.BlockPos blockPos, net.minecraft.core.Direction.Axis axis, int index) Creates an instance of aNodePosrecord class.- Parameters:
blockPos- the value for theblockPosrecord componentaxis- the value for theaxisrecord componentindex- the value for theindexrecord component
-
-
Method Details
-
uniqueIndex
public int uniqueIndex() -
originOf
-
fromUniqueIndex
-
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
-
isOrigin
public boolean isOrigin() -
isOnAxis
public boolean isOnAxis(net.minecraft.core.Direction.Axis axis) -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
compareTo
- Specified by:
compareToin interfaceComparable<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. -
getCenter
public net.minecraft.world.phys.Vec3 getCenter() -
manhattanDistTo
-
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
-
streamNodePosOn
-
streamPlaceHint
-
streamPossibleToConnect
-
connectPathTo
-
asRelative
-
streamTouchingBlocks
public Stream<net.minecraft.core.BlockPos> streamTouchingBlocks(net.minecraft.world.level.Level level) -
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. -
blockPos
public net.minecraft.core.BlockPos blockPos()Returns the value of theblockPosrecord component.- Returns:
- the value of the
blockPosrecord component
-
axis
public net.minecraft.core.Direction.Axis axis()Returns the value of theaxisrecord component.- Returns:
- the value of the
axisrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-