Package net.commoble.exmachina.api.content

# Record Class CubeSignalComponent

java.lang.Object
java.lang.Record
net.commoble.exmachina.api.content.CubeSignalComponent

Record Components:
  `receivesPower` - boolean which indicates neighbor updates should be invoked on this block after a graph update

All Implemented Interfaces:
  `SignalComponent`

public record CubeSignalComponent(boolean receivesPower) extends Record implements SignalComponent
SignalComponent for a Block that can connect to the signal graph on all sides, providing their vanilla redstone signal output to the graph.

    {
            "type": "exmachina:cube",
            "receives_power": false // optional boolean; if true, will recheck neighbor power after a graph update
    }

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.MapCodec<CubeSignalComponent>`
`CODEC`
{ "type": "exmachina:cube", "receives_power": false // optional boolean; if true, will recheck neighbor power after a graph update }
`static final net.minecraft.resources.ResourceKey<com.mojang.serialization.MapCodec<? extends SignalComponent>>`
`KEY`
exmachina:signal_component_type / exmachina:cube

## Constructor Summary

Constructors
Constructor
Description
`CubeSignalComponent(boolean receivesPower)`
Creates an instance of a `CubeSignalComponent` record class.

## 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`
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`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
`final int`
`hashCode()`
Returns a hash code value for this object.
`boolean`
`receivesPower()`
Returns the value of the `receivesPower` record component.
`final String`
`toString()`
Returns a string representation of this record class.
`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)

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

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

## Field Details

### KEY

public static final net.minecraft.resources.ResourceKey<com.mojang.serialization.MapCodec<? extends SignalComponent>> KEY
exmachina:signal_component_type / exmachina:cube

### CODEC

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

            {
                    "type": "exmachina:cube",
                    "receives_power": false // optional boolean; if true, will recheck neighbor power after a graph update
            }

## Constructor Details

### CubeSignalComponent

public CubeSignalComponent(boolean receivesPower)
Creates an instance of a `CubeSignalComponent` record class.

Parameters:
  `receivesPower` - the value for the `receivesPower` record component

## Method Details

### codec

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

Specified by:
  `codec` in interface `SignalComponent`
Returns:
  sub-codec

### getTransmissionNodes

public 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)
Description copied from interface: `SignalComponent`
Defines the TransmissionNode at a given pos/face/channel

Specified by:
  `getTransmissionNodes` in interface `SignalComponent`
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

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

Specified by:
  `updateSelfFromNeighborsAfterGraphUpdate` in interface `SignalComponent`
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

### 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. All components in this record class 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.

### receivesPower

public boolean receivesPower()
Returns the value of the `receivesPower` record component.

Returns:
  the value of the `receivesPower` record component