Package net.commoble.exmachina.api.content

# Enum Class DefaultSource

java.lang.Object
java.lang.Enum<DefaultSource>
net.commoble.exmachina.api.content.DefaultSource

All Implemented Interfaces:
  `Serializable`, `Comparable<DefaultSource>`, `Constable`, `SignalSource`

public enum DefaultSource extends Enum<DefaultSource> implements SignalSource
Default SignalSource used for blocks that have no source assigned to them. Permits a given Face in the block to connect to a graph if: if the block's support shape touches the outer side of the blockpos cube

- `IBlockStateExtension.canRedstoneConnectTo(net.minecraft.world.level.BlockGetter, net.minecraft.core.BlockPos, net.minecraft.core.Direction)` is true for this block
- The Face of this block shares the same Direction as the connecting face
- The connecting block is adjacent to this block
- This block's support shape touches the outer side of the blockpos cube
- and this block's support shape on the touching face is at least 2x2 sixteenths on the center edge:

    /----------------\
    |       xx       |
    |       xx       |
    |                |
    |                |
    |                |
    |                |
    |                |
    |xx            xx|
    |xx            xx|
    |                |
    |                |
    |                |
    |                |
    |                |
    |       xx       |
    |       xx       |
    \----------------/

    {
            "type": "exmachina:default"
    }

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`INSTANCE`
Singleton instance of DefaultSource

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.MapCodec<DefaultSource>`
`CODEC`
{"type": "exmachina:default"}
`static final net.minecraft.resources.ResourceKey<com.mojang.serialization.MapCodec<? extends SignalSource>>`
`KEY`
exmachina:signal_source_type / exmachina:default

## 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
`static DefaultSource`
`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static DefaultSource[]`
`values()`
Returns an array containing the constants of this enum class, in the order they are declared.

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

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### INSTANCE

public static final DefaultSource INSTANCE
Singleton instance of DefaultSource

## Field Details

### KEY

public static final net.minecraft.resources.ResourceKey<com.mojang.serialization.MapCodec<? extends SignalSource>> KEY
exmachina:signal_source_type / exmachina:default

### CODEC

public static final com.mojang.serialization.MapCodec<DefaultSource> CODEC

    {"type": "exmachina:default"}

## Method Details

### values

public static DefaultSource[] values()
Returns an array containing the constants of this enum class, in the order they are declared.

Returns:
  an array containing the constants of this enum class, in the order they are declared

### valueOf

public static DefaultSource valueOf(String name)
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum class has no constant with the specified name
  `NullPointerException` - if the argument is null

### codec

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

Specified by:
  `codec` in interface `SignalSource`
Returns:
  sub-codec for this source type registered via `ExMachinaRegistries.SIGNAL_SOURCE_TYPE`

### getSupplierEndpoints

public 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)
Description copied from interface: `SignalSource`
Describes how much redstone signal power is provided on each channel relevant to this SignalSource for the given context

Specified by:
  `getSupplierEndpoints` in interface `SignalSource`
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)