KubeJS

KubeJS

69M Downloads

BlockStateComponent is not reversable

Notenoughmail opened this issue ยท 1 comments

commented

Minecraft Version

1.20

KubeJS Version

2001.6.3-build.89

Rhino Version

2001.2.2-build.11

Architectury Version

9.1.12

Forge/Fabric Version

Forge 47.1.3

Describe your issue

BlockStateComponent#write relies on the block state's toString() method to write its value, unfortunately this does not produce a string which UtilsJS#parseBlockState nor vanilla's own block state parser can handle. This is due to the block state relying on the base block's toString() method which wraps its id in Block{}.

Recreation

final BlockState testState = Blocks.ACACIA_STAIRS.defaultBlockState();
final BlockState processedState = BlockStateComponent.BLOCK.read(null, BlockStateComponent.BLOCK.write(null, testState));

Put this code somewhere and get an exception similar to the crash attached, where I put it in my mod's constructor

Crash report/logs

https://mclo.gs/BqXJNWo

commented

Fixed in the newest release, thanks for the report!