Package net.commoble.exmachina.api.content

# Record Class RawNode.RawConnection

java.lang.Object
java.lang.Record
net.commoble.exmachina.api.content.RawNode.RawConnection

Record Components:
  `direction` - Direction to neighbor; if not present, indicates the target node is in the same block as the targeting node
  `neighborShape` - NodeShape of target node to attempt to connect to
  `parity` - Parity of connection; if negative, inverts direction of rotation (think two parallel gears meshed together)
  `teeth` - number of teeth this node has when connecting to target node; if both nodes connect with teeth > 0, causes a gearshift based on teeth ratio

Enclosing class:
  `RawNode`

public static record RawNode.RawConnection(Optional<net.minecraft.core.Direction> direction, NodeShape neighborShape, Parity parity, int teeth) extends Record
Relative connection from a RawNode to a neighbor node

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.Codec<RawNode.RawConnection>`
`CODEC`
{ "direction": "south", // optional field, defaults to none "neighbor_shape": e.g.

## Constructor Summary

Constructors
Constructor
Description
`RawConnection(Optional<net.minecraft.core.Direction> direction, NodeShape neighborShape, Parity parity, int teeth)`
Creates an instance of a `RawConnection` record class.

## Method Summary

Modifier and Type
Method
Description
`Optional<net.minecraft.core.Direction>`
`direction()`
Returns the value of the `direction` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`final int`
`hashCode()`
Returns a hash code value for this object.
`NodeShape`
`neighborShape()`
Returns the value of the `neighborShape` record component.
`Parity`
`parity()`
Returns the value of the `parity` record component.
`int`
`teeth()`
Returns the value of the `teeth` record component.
`final String`
`toString()`
Returns a string representation of this record class.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### CODEC

public static final com.mojang.serialization.Codec<RawNode.RawConnection> CODEC

     {
       "direction": "south", // optional field, defaults to none
       "neighbor_shape": e.g. "cube", "north", {"face": "north", "side": "down"},
       "parity": "negative", // optional field, defaults to positive
       "teeth": 40 // optional field, defaults to 0
     }

## Constructor Details

### RawConnection

public RawConnection(Optional<net.minecraft.core.Direction> direction, NodeShape neighborShape, Parity parity, int teeth)
Creates an instance of a `RawConnection` record class.

Parameters:
  `direction` - the value for the `direction` record component
  `neighborShape` - the value for the `neighborShape` record component
  `parity` - the value for the `parity` record component
  `teeth` - the value for the `teeth` record component

## Method Details

### 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

### hashCode

public final 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

### equals

public final boolean equals(Object o)
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:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### direction

public Optional<net.minecraft.core.Direction> direction()
Returns the value of the `direction` record component.

Returns:
  the value of the `direction` record component

### neighborShape

public NodeShape neighborShape()
Returns the value of the `neighborShape` record component.

Returns:
  the value of the `neighborShape` record component

### parity

public Parity parity()
Returns the value of the `parity` record component.

Returns:
  the value of the `parity` record component

### teeth

public int teeth()
Returns the value of the `teeth` record component.

Returns:
  the value of the `teeth` record component