-
[1.12.1] placing a fluid block in the world which places flow blocks itself
That sucks. Thanks though!
-
[1.12.1] placing a fluid block in the world which places flow blocks itself
I did, but it didn't help me a lot. I think I did find how Minecraft calculates where the fluid flows to, but I don't know how to apply that to the placed fluid block, b/c it theoretically should do that on its own.
-
[1.12.1] placing a fluid block in the world which places flow blocks itself
Yes, but that seemed to have no effect.
-
[1.12.1] placing a fluid block in the world which places flow blocks itself
Hello, I've recently begun to get into modding and want to make a block that can register if there's a fluid block next to it and then make a copy of the fluid on free sides of the block, but with a reduced liquid height, as if the liquid would flow through it. Currently I'm having some problems though, at the moment it does create a copy of the fluid with a reduced liquid height (on the opposite site, I've reduced it to this case atm), this liquid, however, doesn't flow. Here's a picture of the problem: (I'll add the textures later, right now I'm just trying to get the main concept to work) And here's what I've come up with so far: public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) { for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { if (worldIn.getBlockState(pos.offset(enumfacing)).getMaterial().isLiquid() && worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).getMaterial() == Material.AIR) { //Block BlockFacing = worldIn.getBlockState(pos.offset(enumfacing)).getBlock(); IBlockState blockstate = worldIn.getBlockState(pos.offset(enumfacing)); int LiquidHeightInt = (int) worldIn.getBlockState(pos.offset(enumfacing)).getProperties().get(BlockLiquid.LEVEL); if(LiquidHeightInt <= 3) { //sets the blockstate on the opposite side of the block to be the one of the source, but with decreased fluid level by 2 worldIn.setBlockState(pos.offset(enumfacing.getOpposite()), blockstate.cycleProperty(BlockLiquid.LEVEL).cycleProperty(BlockLiquid.LEVEL), 2); //updates the neighbouring blocks so that there will be no fluid on a side of the block if the initial source has been removed worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).neighborChanged(worldIn, pos.offset(enumfacing.getOpposite()), worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).getBlock(), pos); } } // TODO add cases } } I will probably later make a tileentity do this, so that the liquid can flow through multiple block etc., but I'd first like to get it to work at all. If you need it, here is my GitHub Repo. I think the problem may be that the source fluid block creates other "flow" blocks, and b/c I'm not placing a fluid source block, it doesn't place the other "fllow" blocks. If this is the case, I have no idea though how to fix it. I've tried looking at BlockDynamicLiquid and BlockLiquid, but wasn't able to come up with a solution. Am I maybe approaching this wrong and should try to make a block that doesn't have a collision box so that a fluid can flow through it, but still somehow make it so that entities can't pass through it? Is it even possible to have two blocks in the same space? Anyway, thanks in advance!
IPS spam blocked by CleanTalk.