// Renders the look of the wall in the world public boolean RenderWorldBlock( RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) { BlockCobbleFence blockCobbleFence = (BlockCobbleFence) block; boolean flag = false; // Wall Constants float wallOffset = 0.3F; float wallWidth = 0.7F; float wallBottom = 0.0F; float wallHeight = 0.8F; float postOffset = 0.2F; // 0.375F; float postWidth = 0.8F; // 0.625F; float postHeight = 1.0F; // NSWE Flags for rendering additional fence pieces boolean west = blockCobbleFence.isWallOrGateAt(iblockaccess, i - 1, j, k); boolean east = blockCobbleFence.isWallOrGateAt(iblockaccess, i + 1, j, k); boolean south = blockCobbleFence.isWallOrGateAt(iblockaccess, i, j, k - 1); boolean north = blockCobbleFence.isWallOrGateAt(iblockaccess, i, j, k + 1); /* Couldn't make this look pretty :( //Render Interaction with wooden objects boolean otherWest = blockCobbleFence.isWoodenFenceAt(iblockaccess, i - 1, j, k); boolean otherEast = blockCobbleFence.isWoodenFenceAt(iblockaccess, i + 1, j, k); boolean otherSouth = blockCobbleFence.isWoodenFenceAt(iblockaccess, i, j, k - 1); boolean otherNorth = blockCobbleFence.isWoodenFenceAt(iblockaccess, i, j, k + 1); */ if (north && south && !(east || west)) { // Render full length wall North/South blockCobbleFence.setBlockBounds(wallOffset, wallBottom, 0.0F, wallWidth, wallHeight, 1.0F); renderblocks.renderStandardBlock(blockCobbleFence, i, j, k); } else if (east && west && !(north || south)) { // Render Full length wall East/west blockCobbleFence.setBlockBounds(0.0F, wallBottom, wallOffset, 1.0F, wallHeight, wallWidth); renderblocks.renderStandardBlock(blockCobbleFence, i, j, k); } else { // Render Center Post blockCobbleFence.setBlockBounds( postOffset, 0.0F, postOffset, postWidth, postHeight, postWidth); renderblocks.renderStandardBlock(blockCobbleFence, i, j, k); // render West if (west) { blockCobbleFence.setBlockBounds( 0.0F, wallBottom, wallOffset, wallWidth, wallHeight, wallWidth); renderblocks.renderStandardBlock(blockCobbleFence, i, j, k); } // Render East if (east) { blockCobbleFence.setBlockBounds( wallOffset, wallBottom, wallOffset, 1.0F, wallHeight, wallWidth); renderblocks.renderStandardBlock(blockCobbleFence, i, j, k); } // Render North if (north) { blockCobbleFence.setBlockBounds( wallOffset, wallBottom, wallOffset, wallWidth, wallHeight, 1.0F); renderblocks.renderStandardBlock(blockCobbleFence, i, j, k); } // Render South if (south) { blockCobbleFence.setBlockBounds( wallOffset, wallBottom, 0.0F, wallWidth, wallHeight, wallWidth); renderblocks.renderStandardBlock(blockCobbleFence, i, j, k); } } blockCobbleFence.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); return true; }