Simple Sponge

Simple Sponge

4M Downloads

Underwater plants become water source blocks

ThatOneMendel opened this issue ยท 3 comments

commented

heya.

When I place down a vanilla sponge it destroys all the plants nearby (seaweed, kept, etc)

But when I use this sponge they remain, and become water source blocks. I have to destroy the plant before I can get the sponge to clear the water source.

Is this a bug or a feature?

commented

Fixed in 5.1

commented

Most likely a bug, because when I first started porting this mod from 1.12 over to 1.13+, I added a bit of code that accounts for waterlogged blocks (i.e. non-full blocks with water in them) to prevent them from having water:

if (material.isLiquid()) {
hitLava |= material == Material.LAVA;
world.setBlockState(workPos, Blocks.AIR.getDefaultState());
} else if (state.hasProperty(BlockStateProperties.WATERLOGGED) && state.get(BlockStateProperties.WATERLOGGED)) {
world.setBlockState(workPos, state.with(BlockStateProperties.WATERLOGGED, false));
}

I guess I didn't account for the underwater plants as well when I did that, so now this happened. I'll just make the sponges behave closer to vanilla ones with handling the underwater plants.

commented

Awesome, thanks! I look forward to it!