Skip to content

Commit d08c062

Browse files
committed
Use a more compact stream codec for transferring the block state in cardboard boxes
1 parent 3110119 commit d08c062

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/mekanism/common/attachments/BlockData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public record BlockData(BlockState blockState, @Nullable CompoundTag blockEntity
4444
CompoundTag.CODEC.optionalFieldOf(SerializationConstants.BLOCK_ENTITY_TAG).forGetter(data -> Optional.ofNullable(data.blockEntityTag))
4545
).apply(instance, (state, tag) -> new BlockData(state, tag.orElse(null))));
4646
public static final StreamCodec<ByteBuf, BlockData> STREAM_CODEC = StreamCodec.composite(
47-
ByteBufCodecs.fromCodecTrusted(BlockState.CODEC), BlockData::blockState,
47+
ByteBufCodecs.idMapper(Block.BLOCK_STATE_REGISTRY), BlockData::blockState,
4848
ByteBufCodecs.optional(ByteBufCodecs.TRUSTED_COMPOUND_TAG), data -> Optional.ofNullable(data.blockEntityTag()),
4949
(state, tag) -> new BlockData(state, tag.orElse(null))
5050
);

0 commit comments

Comments
 (0)