22
33import org .jspecify .annotations .Nullable ;
44
5- import com .mojang .serialization .Codec ;
65import com .mojang .serialization .MapCodec ;
76
87import fn10 .musicexpansion .blocks .entity .StereoBlockEntity ;
98import net .minecraft .core .BlockPos ;
109import net .minecraft .core .Direction ;
1110import net .minecraft .world .item .context .BlockPlaceContext ;
11+ import net .minecraft .world .level .BlockGetter ;
1212import net .minecraft .world .level .block .BaseEntityBlock ;
1313import net .minecraft .world .level .block .Block ;
1414import net .minecraft .world .level .block .entity .BlockEntity ;
1515import net .minecraft .world .level .block .state .BlockState ;
1616import net .minecraft .world .level .block .state .StateDefinition .Builder ;
1717import net .minecraft .world .level .block .state .properties .BooleanProperty ;
18+ import net .minecraft .world .phys .shapes .CollisionContext ;
19+ import net .minecraft .world .phys .shapes .VoxelShape ;
1820
1921public class StereoBlock extends RotatedBaseEntityBlock {
2022
2123 public static final BooleanProperty LOADED = BooleanProperty .create ("loaded" );
2224
2325 public StereoBlock (Properties properties ) {
24- super (properties );
26+ super (properties . noOcclusion () );
2527 registerDefaultState (defaultBlockState ().setValue (FACING , Direction .NORTH ).setValue (LOADED , false ));
2628 }
2729
@@ -45,4 +47,16 @@ protected MapCodec<? extends BaseEntityBlock> codec() {
4547 return simpleCodec (StereoBlock ::new );
4648 }
4749
50+ @ Override
51+ protected VoxelShape getCollisionShape (BlockState blockState , BlockGetter blockGetter , BlockPos blockPos ,
52+ CollisionContext collisionContext ) {
53+ return Block .box (0d , 0d , 0d , 16d , 14d , 16d );
54+ }
55+
56+ @ Override
57+ protected VoxelShape getShape (BlockState blockState , BlockGetter blockGetter , BlockPos blockPos ,
58+ CollisionContext collisionContext ) {
59+ return getCollisionShape (blockState , blockGetter , blockPos , collisionContext );
60+ }
61+
4862}
0 commit comments