Package net.commoble.exmachina.internal.util

# Class StateReader

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

public final class StateReader extends Object
Utility for reading a blockstate predicate in blockstate-file format

## 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`

## 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