Package net.commoble.exmachina.api.content

# Record Class SimpleMechanicalStateComponent

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

Record Components:
  `save` - boolean which if true causes mechanical update results to be automatically stored/persisted in `MechanicalNodeStates` data attachment
  `bakedNodes` - List of RawNodes provided by this component's blockstate

All Implemented Interfaces:
  `MechanicalStateComponent`

public record SimpleMechanicalStateComponent(boolean save, List<RawNode> bakedNodes) extends Record implements MechanicalStateComponent
MechanicalStateComponent used by `VariantsMechanicalComponent` and `MultipartMechanicalComponent` to provide mechanical nodes

## Field Summary

### Fields inherited from interface net.commoble.exmachina.api.MechanicalStateComponent

`EMPTY`

## Constructor Summary

Constructors
Constructor
Description
`SimpleMechanicalStateComponent(boolean save, List<RawNode> bakedNodes)`
Creates an instance of a `SimpleMechanicalStateComponent` record class.

## Method Summary

Modifier and Type
Method
Description
`List<RawNode>`
`bakedNodes()`
Returns the value of the `bakedNodes` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`Collection<MechanicalNode>`
`getNodes(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> levelKey, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)`
Provides the MechanicalNodes at a given position where this blockstate is
`final int`
`hashCode()`
Returns a hash code value for this object.
`boolean`
`save()`
Returns the value of the `save` record component.
`final String`
`toString()`
Returns a string representation of this record class.

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

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

### Methods inherited from interface net.commoble.exmachina.api.MechanicalStateComponent

`isPresent`

## Constructor Details

### SimpleMechanicalStateComponent

public SimpleMechanicalStateComponent(boolean save, List<RawNode> bakedNodes)
Creates an instance of a `SimpleMechanicalStateComponent` record class.

Parameters:
  `save` - the value for the `save` record component
  `bakedNodes` - the value for the `bakedNodes` record component

## Method Details

### getNodes

public Collection<MechanicalNode> getNodes(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> levelKey, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)
Description copied from interface: `MechanicalStateComponent`
Provides the MechanicalNodes at a given position where this blockstate is

Specified by:
  `getNodes` in interface `MechanicalStateComponent`
Parameters:
  `levelKey` - ResourceKey identifying the level where this component is
  `level` - BlockGetter where this component is
  `pos` - BlockPos where this component is
Returns:
  Collection of MechanicalNodes at the given position

### 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. Reference components are compared with `Objects::equals(Object,Object)`; primitive components 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.

### save

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

Returns:
  the value of the `save` record component

### bakedNodes

public List<RawNode> bakedNodes()
Returns the value of the `bakedNodes` record component.

Returns:
  the value of the `bakedNodes` record component