2525import java .util .Map ;
2626import java .util .function .Supplier ;
2727import net .minecraft .block .AbstractChestBlock ;
28+ import net .minecraft .block .Block ;
2829import net .minecraft .block .BlockState ;
2930import net .minecraft .block .ChestBlock ;
3031import net .minecraft .block .ShapeContext ;
4142import org .spongepowered .asm .mixin .Final ;
4243import org .spongepowered .asm .mixin .Mixin ;
4344import org .spongepowered .asm .mixin .Shadow ;
45+ import org .spongepowered .asm .mixin .Unique ;
4446import org .spongepowered .asm .mixin .injection .At ;
4547import org .spongepowered .asm .mixin .injection .Inject ;
4648import org .spongepowered .asm .mixin .injection .callback .CallbackInfoReturnable ;
4749
4850@ Mixin (ChestBlock .class )
4951public abstract class MixinChestBlock extends AbstractChestBlock <ChestBlockEntity > {
5052
53+ //https://bugs-legacy.mojang.com/browse/MCPE-94126
54+ @ Unique
55+ private static final VoxelShape viaFabricPlus$shape_bedrock = Block .createColumnShape (15.15F , 0.0F , 15.15F );
56+
5157 @ Shadow
5258 @ Final
5359 private static Map <Direction , VoxelShape > DOUBLE_SHAPES_BY_DIRECTION ;
@@ -64,12 +70,15 @@ protected MixinChestBlock(Settings settings, Supplier<BlockEntityType<? extends
6470 private void changeOutlineShape (BlockState state , BlockView world , BlockPos pos , ShapeContext context , CallbackInfoReturnable <VoxelShape > cir ) {
6571 if (ProtocolTranslator .getTargetVersion ().olderThanOrEqualTo (LegacyProtocolVersion .r1_4_2 )) {
6672 cir .setReturnValue (VoxelShapes .fullCube ());
73+ } else if (ProtocolTranslator .getTargetVersion ().equalTo (BedrockProtocolVersion .bedrockLatest )) {
74+ cir .setReturnValue (viaFabricPlus$shape_bedrock );
6775 }
6876 }
6977
7078 @ Override
7179 public VoxelShape getCullingShape (BlockState state ) {
72- if (ProtocolTranslator .getTargetVersion ().olderThanOrEqualTo (LegacyProtocolVersion .r1_4_2 )) {
80+ if (ProtocolTranslator .getTargetVersion ().olderThanOrEqualTo (LegacyProtocolVersion .r1_4_2 )
81+ || ProtocolTranslator .getTargetVersion ().equalTo (BedrockProtocolVersion .bedrockLatest )) {
7382 if (state .get (ChestBlock .CHEST_TYPE ) == ChestType .SINGLE ) {
7483 return SINGLE_SHAPE ;
7584 } else {
0 commit comments