Package net.commoble.exmachina.api

# Interface MechanicalBlockComponent

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MechanicalBlockComponent
Cached and validated MechanicalComponent for the block the component is assigned to. The purpose of this is to allow json formats sensitive to e.g. blockstate properties or block classes to verify that the format is correct for the given block and log errors immediately after datapack registries load.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final MechanicalBlockComponent`
`EMPTY`
MechanicalBlockComponent for blocks which have no assigned component

## Method Summary

Modifier and Type
Method
Description
`MechanicalStateComponent`
`bake(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.RegistryAccess registries)`
Creates a MechanicalStateComponent for the given blockstate.
`default boolean`
`isPresent()`
Returns true if this is a "real" component, false if this is the EMPTY component (e.g. because validation failed).

## Field Details

### EMPTY

static final MechanicalBlockComponent EMPTY
MechanicalBlockComponent for blocks which have no assigned component

## Method Details

### bake

MechanicalStateComponent bake(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.RegistryAccess registries)
Creates a MechanicalStateComponent for the given blockstate. Called once per blockstate when first needed during server runtime.

Parameters:
  `state` - BlockState to bake the component for
  `registries` - RegistryAccess containing datapack registries, if needed
Returns:
  MechanicalStateComponent for the given blockstate

### isPresent

default boolean isPresent()
Returns true if this is a "real" component, false if this is the EMPTY component (e.g. because validation failed).

Returns:
  true if this is a "real" component, false if this is the EMPTY component (e.g. because validation failed)