Package net.commoble.exmachina.api

# Interface SignalComponent

All Known Implementing Classes:
  `CubeSignalComponent`, `DefaultSignalComponent`, `FloorSignalComponent`, `NoneTransmitter`, `WallFloorCeilingSignalComponent`

public interface SignalComponent

A SignalComponent is a signal graph component assignable to Blocks, which

- Can be connected to by the graph
- Can connect to further graph nodes
- Can be notified of signal power updates
- Can read redstone power from non-graph blocks adjacent to the graph
- Exists at a unique node (level + BlockPos + NodeShape + Channel) in any graph

SignalComponents can be assigned to blocks via the exmachina:signal_component block datamap:

     data/exmachina/data_maps/block/signal_component.json
     [
       "namespace:blockid": {
         "type": "namespace:signal_component_type_id", // referring to a registered signal_component_type (a SignalComponent codec)
         // additional fields
       }
     ]

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.Codec<SignalComponent>`
`CODEC`
Master dispatch codec for SignalComponents

## Method Summary

Modifier and Type
Method
Description
`com.mojang.serialization.MapCodec<? extends SignalComponent>`
`codec()`
Returns the sub-codec for this component type registered via `ExMachinaRegistries.SIGNAL_COMPONENT_TYPE`
`Collection<TransmissionNode>`
`getTransmissionNodes(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> levelKey, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, Channel channel)`
Defines the TransmissionNode at a given pos/face/channel
`default boolean`
`updateSelfFromNeighborsAfterGraphUpdate(net.minecraft.world.level.LevelReader level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos)`
If true, neighborChanged will be invoked on this block after a graph update occurs (default false)

## Field Details

### CODEC

static final com.mojang.serialization.Codec<SignalComponent> CODEC
Master dispatch codec for SignalComponents

## Method Details

### codec

com.mojang.serialization.MapCodec<? extends SignalComponent> codec()
Returns the sub-codec for this component type registered via `ExMachinaRegistries.SIGNAL_COMPONENT_TYPE`

Returns:
  sub-codec

### getTransmissionNodes

Collection<TransmissionNode> getTransmissionNodes(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> levelKey, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, Channel channel)
Defines the TransmissionNode at a given pos/face/channel

Parameters:
  `levelKey` - ResourceKey of the blockgetter
  `level` - BlockGetter where the SignalComponent block is
  `pos` - BlockPos where this SignalComponent block is
  `state` - BlockState of this SignalComponent block
  `channel` - Channel to get nodes for
Returns:
  Collection of TransmissionNodes for the provided context. Any transmission nodes at the same level+pos+channel must have a unique NodeShape.

### updateSelfFromNeighborsAfterGraphUpdate

default boolean updateSelfFromNeighborsAfterGraphUpdate(net.minecraft.world.level.LevelReader level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos)
If true, neighborChanged will be invoked on this block after a graph update occurs (default false)

Parameters:
  `level` - LevelReader where the block is
  `state` - BlockState of the block
  `pos` - BlockPos where the block is
Returns:
  boolean indicating that the block should receive neighbor updates after a graph update if true