Posted May 13, 201312 yr is there a way to get the direction of which the water is flowing? i noticed that there is one in the WaterMoving block. but every water blocked i checked only is an instance of WaterStill. so is there a way to check the water flow direction? http://www.minecraftforum.net/topic/1937703-162smpforge-pet-mastery-hatch-level-battle/
May 13, 201312 yr Author ah never knew that thx for info. but... im making a water wheel which is rotating around its z-axel. and i need to know which way the wheel needs to rotate. so any ideas how to do that? http://www.minecraftforum.net/topic/1937703-162smpforge-pet-mastery-hatch-level-battle/
May 13, 201312 yr If you find the source, then you find the direction? Or check two blocks and find out how far from it's source they are, then you know it's direction as well If you guys dont get it.. then well ya.. try harder...
May 13, 201312 yr Author thx a lot for anyone who also wants to know which way the water is flowing here is the code i made: public static ForgeDirection getWaterFlowDirection(World par1, int par2, int par3, int par4){ int var1 = par1.getBlockMetadata(par2, par3, par4); if(par1.getBlockId(par2, par3, par4) != Block.waterStill.blockID || var1 == 0){ return null; } for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS){ int x = par2 + direction.offsetX; int y = par3 + direction.offsetY; int z = par4 + direction.offsetZ; int var2 = par1.getBlockId(x, y, z); if(var2 == Block.waterStill.blockID){ int var3 = par1.getBlockMetadata(x, y, z); if(var3 > var1){ return direction; } } } return ForgeDirection.UNKNOWN; } http://www.minecraftforum.net/topic/1937703-162smpforge-pet-mastery-hatch-level-battle/
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.