Hi! I recently got into minecraft modding and I'm having a bit of trouble finding the right function to make the blocks behave as they normally do in the vanilla game. Basically I spawn the water block, however it will just sit there upon spawning. I want it to flow as a normal water block would (Similar to a water bucket when its clicked on a block).
Here's my current code:
BlockPos pos = new BlockPos((myChunk.xPosition * 16) + x + 1, y + 2, (myChunk.zPosition * 16) + z);
//Set block to current position and set it to flow.
//State 8 is flowing water, 9 is water.
//TODO: Test differences between state 8 and 9.
world.setBlockState(pos, BlockLiquid.getFlowingBlock(Material.water).getDefaultState());
Right now the code obviously isn't correct. I was experimenting with a few different changes. The ones I stumbled across mentioned setBlockMetadataWithNotify, however that seems to be deprecated with IBlockStates, however I'm not sure what state to change it to to make it flow. I've also tried notify however I'm probably using it wrong. If there's any function to say "Hey world/chunk, you need to update this block according to vanilla water properties", that would be great.
Any advice/tips/response would be appreciated. -Thanks.