public class BlockState extends BlockBehaviour.BlockStateBase implements FabricBlockState {
11
public static final Codec<BlockState> FULL_CODEC = codec(BuiltInRegistries.BLOCK.byNameCodec(), Block::defaultBlockState, Block::getStateDefinition).stable();
12
private static final Codec<Either<Block, BlockState>> CONSTANT_OR_DISPATCH_CODEC = Codec.either(BuiltInRegistries.BLOCK.byNameCodec(), FULL_CODEC);
13
public static final Codec<BlockState> CODEC = CONSTANT_OR_DISPATCH_CODEC.xmap(
14
either -> either.map(Block::defaultBlockState, f -> (BlockState)f),
15
state -> state == state.getBlock().defaultBlockState() ? Either.left(state.getBlock()) : Either.right(state)
16
);
17
18
public BlockState(final Block owner, final Property<?>[] propertyKeys, final Comparable<?>[] propertyValues) {
19
super(owner, propertyKeys, propertyValues);
20
}
21
22
@Override
23
protected BlockState asState() {
24
return this;
25
}
26
}
27
Decompiled Minecraft 26.3 source of BlockState (net/minecraft/world/level/block/state/BlockState.java) with Mojang official mappings, stored verbatim on the site.