Skip to content

Commit

Permalink
Merge pull request #156 from GrowthcraftCE/131-hitbox-of-cultivated-f…
Browse files Browse the repository at this point in the history
…armland

Fixed #131 Updated farmland block shape for waterlogging state
  • Loading branch information
Alatyami authored Sep 6, 2024
2 parents be969f2 + d1f411e commit fa441fe
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ public class CultivatedFarmlandBlock extends Block implements SimpleWaterloggedB
public static final IntegerProperty MOISTURE = BlockStateProperties.MOISTURE;
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;

protected static final VoxelShape SHAPE = Block.box(
0.0D, 0.0D, 0.0D,
16.0D, 15.0D, 16.0D
);
protected static final VoxelShape[] SHAPES = new VoxelShape[] {
Block.box(0.0D, 0.0D, 0.0D, 16.0D, 14.0D, 16.0D),
Block.box(0.0D, 0.0D, 0.0D, 16.0D, 14.5D, 16.0D)
};

public static final int MAX_MOISTURE = 7;

Expand Down Expand Up @@ -76,8 +76,8 @@ public boolean useShapeForLightOcclusion(BlockState p_53295_) {
}

@Override
public VoxelShape getShape(BlockState p_53290_, BlockGetter p_53291_, BlockPos p_53292_, CollisionContext p_53293_) {
return SHAPE;
public VoxelShape getShape(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, CollisionContext context) {
return blockState.getValue(WATERLOGGED) ? SHAPES[1] : SHAPES[0];
}

@Override
Expand Down

0 comments on commit fa441fe

Please sign in to comment.