Posted February 25, 201411 yr I'm trying to do the following: If two blocks from my mod collide by one (or more) faces, then those faces, which collides, shouldn't be rendered. And i have the following problem: Those two block are one next to other and their top and bottom faces a colliding, but the don't become "invisible": https://dl.dropboxusercontent.com/u/184200482/img/side_error_1.png[/img] But if move the block above, (1 meter) up, then the top face of the lower block becomes invisible: https://dl.dropboxusercontent.com/u/184200482/img/side_error_2.png[/img] And if the block is "alone", the side renders correctly: https://dl.dropboxusercontent.com/u/184200482/img/side_error_3.png[/img] Here is my code @Override public boolean shouldSideBeRendered(IBlockAccess block, int x, int y, int z, int side) { // -Y if(side == 0 && isBlockACamouflage(block.getBlockId(x, y - 1, z))) { return false; } // +Y if(side == 1 && isBlockACamouflage(block.getBlockId(x, y + 1, z))) { return false; } // -Z if(side == 2) { return false; } else { return true; } } PS: isBlockACamouflage() only check is the block is one added my the mod or not Thanks for helping.
February 26, 201411 yr Hi BlockBreakable:: * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given * coordinates. Args: blockAccess, x, y, z, side public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int x, int y, int z, int side) { int i1 = par1IBlockAccess.getBlockId(x, y, z); return !this.localFlag && i1 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, x, y, z, side); } x,y,z is the coordinates of the adjacent block, not the block being rendered. -TGG
February 26, 201411 yr Author Hi BlockBreakable:: * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given * coordinates. Args: blockAccess, x, y, z, side public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int x, int y, int z, int side) { int i1 = par1IBlockAccess.getBlockId(x, y, z); return !this.localFlag && i1 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, x, y, z, side); } x,y,z is the coordinates of the adjacent block, not the block being rendered. -TGG Okay, thanks, it works
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.