Package commoble.exmachina.engine.api

# Interface Connector

All Known Implementing Classes:
  `AllDirectionsConnector`, `BlockStateConnector`, `DirectionsConnector`, `NoneConnector`, `UnionConnector`

public interface Connector
Connectors are properties assigned to block instances that determine which positions a block at a given position could potentially connect to in a circuit. If blocks at two positions are both capable of connecting to each other's position, then a circuit network can and will extend from one position to the other. Subcodecs of Connector can be registered to `ExMachinaRegistries.CONNECTOR_TYPE`.

    {
            "type": "modid:registered_type_id",
            // the rest of the subtype fields
    }

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static interface`
`Connector.BlockConnector`
`static interface`
`Connector.StateConnector`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.Codec<Connector>`
`CODEC`

## Method Summary

Modifier and Type
Method
Description
`com.mojang.serialization.DataResult<Connector.BlockConnector>`
`bake(net.minecraft.world.level.block.Block block)`
Bakes a BakedConnector function for the associated block.
`com.mojang.serialization.Codec<? extends Connector>`
`codec()`
Returns Codec registered to `ExMachinaRegistries.CONNECTOR_TYPE`.
`default boolean`
`isPresent()`
Returns whether this is a valid Connector.

## Field Details

### CODEC

static final com.mojang.serialization.Codec<Connector> CODEC

## Method Details

### bake

com.mojang.serialization.DataResult<Connector.BlockConnector> bake(net.minecraft.world.level.block.Block block)
Bakes a BakedConnector function for the associated block. Caching and validation can be done.

Parameters:
  `block` - Block this connector is associated with
Returns:
  DataResult with success holding a BakedConnector if block is valid, error result otherwise

### codec

com.mojang.serialization.Codec<? extends Connector> codec()
Returns Codec registered to `ExMachinaRegistries.CONNECTOR_TYPE`..

Returns:
  Codec registered to `ExMachinaRegistries.CONNECTOR_TYPE`

### isPresent

default boolean isPresent()
Returns whether this is a valid Connector. If false, will be ignored by the graph builder. Consider using `CircuitComponent.empty()` instead of overriding.

Returns:
  Whether the component can be part of a circuit.