Package net.commoble.exmachina.api

# Interface SignalSource

All Known Implementing Classes:
  `CubeSource`, `DefaultSource`, `FloorSource`, `NoneSource`, `WallFloorCeilingSource`

public interface SignalSource

A SignalSource is a signal graph node assignable to Blocks, which

- Can be connected to by the graph
- Will not connect to further graph nodes
- Can provide signal power to the graph

SignalSources can be assigned to blocks using the exmachina:signal_source block data map:

     data/exmachina/data_maps/block/signal_source.json
     [
       "namespace:blockid": {
         "type": "namespace:receiver_type_id",
         // additional fields
       }
     ]

## Field Summary

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

## Method Summary

Modifier and Type
Method
Description
`com.mojang.serialization.MapCodec<? extends SignalSource>`
`codec()`
Returns sub-codec for this source type registered via `ExMachinaRegistries.SIGNAL_SOURCE_TYPE`.
`Map<Channel,ToIntFunction<net.minecraft.world.level.LevelReader>>`
`getSupplierEndpoints(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos supplierPos, net.minecraft.world.level.block.state.BlockState supplierState, net.minecraft.core.Direction supplierSide, Face connectedFace)`
Describes how much redstone signal power is provided on each channel relevant to this SignalSource for the given context

## Field Details

### CODEC

static final com.mojang.serialization.Codec<SignalSource> CODEC
Master dispatch codec for SignalSources

## Method Details

### codec

com.mojang.serialization.MapCodec<? extends SignalSource> codec()
Returns sub-codec for this source type registered via `ExMachinaRegistries.SIGNAL_SOURCE_TYPE`.

Returns:
  sub-codec for this source type registered via `ExMachinaRegistries.SIGNAL_SOURCE_TYPE`

### getSupplierEndpoints

Map<Channel,ToIntFunction<net.minecraft.world.level.LevelReader>> getSupplierEndpoints(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos supplierPos, net.minecraft.world.level.block.state.BlockState supplierState, net.minecraft.core.Direction supplierSide, Face connectedFace)
Describes how much redstone signal power is provided on each channel relevant to this SignalSource for the given context

Parameters:
  `level` - Level where the signal graph exists
  `supplierPos` - BlockPos of this SignalSource's block
  `supplierState` - BlockState of this SignalSource's block
  `supplierSide` - Direction internal to this SignalSource's position (e.g. down -> the bottom of the supplierPos)
  `connectedFace` - Face (BlockPos + Direction) of the node attempting to connect to this SignalSource
Returns:
  Map of Channel to LevelReader-> int function which provides signal power in range [0,15] on the given channel(s)