This commit is contained in:
paulevsGitch 2020-10-09 18:59:06 +03:00
parent 7584321c47
commit 819de9ae0a
22 changed files with 419 additions and 3 deletions

View file

@ -77,7 +77,8 @@ public class BlockUnderwaterPlant extends BlockBaseNotFull implements IRenderTyp
@Override
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
BlockState down = world.getBlockState(pos.down());
return isTerrain(down);
state = world.getBlockState(pos);
return isTerrain(down) && state.getFluidState().getFluid().equals(Fluids.WATER.getStill());
}
protected boolean isTerrain(BlockState state) {
@ -87,7 +88,7 @@ public class BlockUnderwaterPlant extends BlockBaseNotFull implements IRenderTyp
@Override
public BlockState getStateForNeighborUpdate(BlockState state, Direction facing, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
if (!canPlaceAt(state, world, pos)) {
return Blocks.AIR.getDefaultState();
return Blocks.WATER.getDefaultState();
}
else {
return state;