Package commoble.exmachina.engine.internal.util

# Class StateReader

java.lang.Object
commoble.exmachina.engine.internal.util.StateReader

public class StateReader extends Object

## Constructor Summary

Constructors
Constructor
Description
`StateReader()`

## Method Summary

Modifier and Type
Method
Description
`static Predicate<net.minecraft.world.level.block.state.BlockState>`
`parseVariantKey(net.minecraft.world.level.block.state.StateDefinition<net.minecraft.world.level.block.Block,net.minecraft.world.level.block.state.BlockState> stateContainer, String keyList)`
This is based on how blockstate jsons are parsed in ModelBakery; we need it to be available for server data.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### StateReader

public StateReader()

## Method Details

### parseVariantKey

public static Predicate<net.minecraft.world.level.block.state.BlockState> parseVariantKey(net.minecraft.world.level.block.state.StateDefinition<net.minecraft.world.level.block.Block,net.minecraft.world.level.block.state.BlockState> stateContainer, String keyList) throws IllegalArgumentException
This is based on how blockstate jsons are parsed in ModelBakery; we need it to be available for server data. Parses a blockstate property filter string into a blockstate predicate.

Parameters:
  `stateContainer` - A statecontainer from a Block
  `keyList` - A blockstate property filter (same format as blockstate .jsons)
Returns:
  A Predicate that returns true for the states specified by the string and false otherwise
Throws:
  `IllegalArgumentException` - if keyList cannot be parsed