Package net.commoble.exmachina.api

# Interface NodeShape

All Known Implementing Classes:
  `NodeShape.Cube`, `NodeShape.Side`, `NodeShape.SideSide`

public sealed interface NodeShape permits NodeShape.Cube, NodeShape.Side, NodeShape.SideSide
Representation of the volume or connectibility of a graph node

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static enum`
`NodeShape.Cube`
NodeShape which encompasses an entire BlockPos
`static final record`
`NodeShape.Side`
NodeShape which represents a node on the internal face of a blockpos
`static final record`
`NodeShape.SideSide`
NodeShape which represents a node which lies on the internal face of a BlockPos but on touches one of its four orthagonal neighbors

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.Codec<NodeShape>`
`CODEC`
Three valid formats:
`static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,NodeShape>`
`STREAM_CODEC`
codec but stream

## Method Summary

Modifier and Type
Method
Description
`boolean`
`isValidFor(NodeShape preferredNode)`
Returns true if this targeted NodeShape is usable when a preferred node is requested for a connection.
`static NodeShape`
`ofCube()`
Returns NodeShape which encompasses an entire BlockPos.
`static NodeShape`
`ofSide(net.minecraft.core.Direction directionToNeighbor)`
Returns NodeShape which represents a node on the internal face of a blockpos.
`static NodeShape`
`ofSideSide(net.minecraft.core.Direction directionToNeighbor, net.minecraft.core.Direction secondaryDirection)`
Returns NodeShape which represents a node which lies on the internal face of a BlockPos but on touches one of its four orthagonal neighbors.

## Field Details

### CODEC

static final com.mojang.serialization.Codec<NodeShape> CODEC
Three valid formats:

     {
       "someCubeNode": "cube",
       "someSideNode": "north", // any direction
       "someSideSideNode": {"face": "north", "side": "down"} // any two directions
     }

### STREAM_CODEC

static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,NodeShape> STREAM_CODEC
codec but stream

## Method Details

### ofCube

static NodeShape ofCube()
Returns NodeShape which encompasses an entire BlockPos.

Returns:
  NodeShape which encompasses an entire BlockPos

### ofSide

static NodeShape ofSide(net.minecraft.core.Direction directionToNeighbor)
Returns NodeShape which represents a node on the internal face of a blockpos.

Parameters:
  `directionToNeighbor` - Direction from the node's BlockPos to its neighbor
Returns:
  NodeShape which represents a node on the internal face of a blockpos

### ofSideSide

static NodeShape ofSideSide(net.minecraft.core.Direction directionToNeighbor, net.minecraft.core.Direction secondaryDirection)
Returns NodeShape which represents a node which lies on the internal face of a BlockPos but on touches one of its four orthagonal neighbors.

Parameters:
  `directionToNeighbor` - Direction from the center of the blockpos to the face on which the node lies
  `secondaryDirection` - Direction from the center of the primary face to the neighbor which can connect to that node
Returns:
  NodeShape which represents a node which lies on the internal face of a BlockPos but on touches one of its four orthagonal neighbors

### isValidFor

boolean isValidFor(NodeShape preferredNode)
Returns true if this targeted NodeShape is usable when a preferred node is requested for a connection.

Parameters:
  `preferredNode` - NodeShape which another node is trying to form a connection to
Returns:
  true if this targeted NodeShape is usable when a preferred node is requested for a connection