Redundancy in Region.cs

Aug 31, 2013 at 7:29 PM
if (neighbourType == BlockType.Water)
                {
                    if (blockType == BlockType.None)
                    {
                        if (blockType == BlockType.Water)
                        {
                            _world.AddWaterFace(bx, by, bz, bFace);
                        }
                        else
                        {
                            _world.AddSolidFace(bx, by, bz, bFace);
                        }
                    }
                    else if (blockType == BlockType.Water)
                    {
                        // Removed ajoining faces if both blocks are water
                        _world.RemoveWaterFace(bx, by, bz, bFace);
                        _world.RemoveWaterFace(nx, ny, nz, nFace);

                    }
                    else if (BlockInformation.IsModelBlock(blockType))
                    {
                        _world.AddModelFace(bx, by, bz, bFace);
                        _world.AddWaterFace(nx, ny, nz, nFace);
                    }
                    else
                    {
                        // Can always see face through water
                        if (blockType == BlockType.Water)
                        {
                            _world.AddWaterFace(bx, by, bz, bFace);
                        }
                        else
                        {
                            _world.AddSolidFace(bx, by, bz, bFace);
                        }
                        _world.RemoveWaterFace(nx, ny, nz, nFace);
                    }
                }
Right off the bat,
 if (blockType == BlockType.None)
then obvious the next line
if (blockType == BlockType.Water)
                        {
                            _world.AddWaterFace(bx, by, bz, bFace);
                        }
is never going to happen.
else if (blockType == BlockType.Water)
Right here you check if blockType is water. Further down in the else block you have:
if (blockType == BlockType.Water)
                        {
                            _world.AddWaterFace(bx, by, bz, bFace);
                        }
Which is never going to be ran. You already have that condition taken care of.
Aug 31, 2013 at 7:31 PM
Edited Aug 31, 2013 at 8:50 PM
 if (neighbourType == BlockType.Water)
                {
                    if (blockType == BlockType.None)
                    {
                        _world.AddSolidFace(bx, by, bz, bFace);
                    }
                    
                    else if (blockType == BlockType.Water)
                    {
                        // Removed ajoining faces if both blocks are water
                        _world.RemoveWaterFace(bx, by, bz, bFace);
                        _world.RemoveWaterFace(nx, ny, nz, nFace);
                    }
                    else if (BlockInformation.IsModelBlock(blockType))
                    {
                        _world.AddModelFace(bx, by, bz, bFace);
                        _world.AddWaterFace(nx, ny, nz, nFace);
                    }
                    else
                    {
                        _world.AddSolidFace(bx, by, bz, bFace);
                        _world.RemoveWaterFace(nx, ny, nz, nFace);
                    }
                }
Condensed code. Probably could just make this an else if{} as well to reduce the use of another bracket instead of else { if{ } . Make the code easier for a user to read.