Block brightAir = GCBlocks.brightAir;
Block brightBreatheableAir = GCBlocks.brightBreatheableAir;
HashSet<BlockVec3> checked = new HashSet();
LinkedList<BlockVec3> currentLayer = new LinkedList();
LinkedList<BlockVec3> nextLayer = new LinkedList();
BlockVec3 thisvec = new BlockVec3(this);
currentLayer.add(thisvec);
World world = this.worldObj;
int sideskip1 = this.sideRear;
int sideskip2 = this.facingSide ^ 1;
for (int i = 0; i < 6; i++)
{
if (i != sideskip1 && i != sideskip2 && i != (sideskip1 ^ 1) && i != (sideskip2 ^ 1))
{
BlockVec3 onEitherSide = thisvec.newVecSide(i);
Block b = onEitherSide.getBlockIDsafe_noChunkLoad(world);
if (b != null && b.getLightOpacity() < 15)
{
currentLayer.add(onEitherSide);
}
}
}
BlockVec3 inFront = new BlockVec3(this);
for (int i = 0; i < 5; i++)
{
inFront = inFront.newVecSide(this.facingSide).newVecSide(sideskip1 ^ 1);
Block b = inFront.getBlockIDsafe_noChunkLoad(world);
if (b != null && b.getLightOpacity() < 15)
{
currentLayer.add(inFront);
}
}
for (int count = 0; count < 14; count++)
{
int side;
for (BlockVec3 vec : currentLayer)
{
side = 0;
boolean allAir = true;
do
{
//Skip the side which this was entered from
//and never go 'backwards'
if (!vec.sideDone[side])
{
BlockVec3 sideVec = vec.newVecSide(side);
if (!checked.contains(sideVec))
{
checked.add(sideVec);
Block b = sideVec.getBlockIDsafe_noChunkLoad(world);
if (b instanceof BlockAir)
{
if (side != sideskip1 && side != sideskip2)
{
nextLayer.add(sideVec);