Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #131 Updated farmland block shape for waterlogging state #156

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading