'getOutlineShape is deprecated, is there another method to change the hitbox?

I'm making a block that does not occupy a full block in Fabric 1.18.

I've tried the following code as suggested on the Fabric wiki.

protected static final VoxelShape SHAPE = Block.createCuboidShape(2.d, .0d, 2.d, 14.d, 4.d, 14.d);

@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
    return SHAPE;
}

It does work, just that a deprecated warning shows in the IDE and the console.

Is there something else I should use for this?



Solution 1:[1]

Vanilla deprecated the methods in Block that should be called with BlockState. It's ok to override them.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Squid233