Upload my Code Changes/Format/imports

This commit is contained in:
Alexander committed 2014-02-16 14:23:50 -05:00
1 parent 5bcdb7ca46
commit 5d4e38c0cb
264 files changed
+4014 -3972

No files matched your search

@@ -11,7 +11,6 @@ import mantle.blocks.iface.IServantLogic;
import mantle.world.CoordTuple;
import mantle.world.CoordTupleSort;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagIntArray;
import net.minecraft.nbt.NBTTagList;
@@ -39,7 +38,14 @@ public class TankLayerScan extends LogicComponent
protected CoordTuple returnStone;
private static boolean debug = System.getenv("DBG_MANTLE_TankLayerScan") != null;
private static int MAX_LAYER_RECURSION_DEPTH = System.getProperty("os.arch").equals("amd64") ? 4000 : 2000; // Recursion causes overflows on 32-bit, so reduce if not 64-bit
private static int MAX_LAYER_RECURSION_DEPTH = System.getProperty("os.arch").equals("amd64") ? 4000 : 2000; // Recursion
// causes
// overflows
// on
// 32-bit,
// so reduce
// if not
// 64-bit
public TankLayerScan(TileEntity te, Block... ids)
{
@@ -66,7 +72,7 @@ public class TankLayerScan extends LogicComponent
blockCoords.clear();
airCoords.clear();
boolean validAir = false;
//Check for air space in front of and behind the structure
// Check for air space in front of and behind the structure
byte dir = getDirection();
switch (getDirection())
{
@@ -82,7 +88,7 @@ public class TankLayerScan extends LogicComponent
break;
}
//Recurse the structure
// Recurse the structure
boolean validBlocks = false;
int xPos = 0, zPos = 0;
@@ -120,7 +126,7 @@ public class TankLayerScan extends LogicComponent
blockCoords.clear();
bricks = 0;
//Does the actual adding of blocks in the ring
// Does the actual adding of blocks in the ring
boolean sealed = floodTest(master.xCoord + xPos, master.yCoord, master.zCoord + zPos);
if (!world.isRemote && debug)
{
@@ -130,7 +136,7 @@ public class TankLayerScan extends LogicComponent
if (sealed)
{
blockCoords.add(new CoordTuple(master.xCoord, master.yCoord, master.zCoord)); //Don't forget me!
blockCoords.add(new CoordTuple(master.xCoord, master.yCoord, master.zCoord)); // Don't forget me!
layerAirCoords = new HashSet<CoordTuple>(airCoords);
layerBlockCoords = new HashSet<CoordTuple>(blockCoords);
@@ -151,7 +157,7 @@ public class TankLayerScan extends LogicComponent
}
}
//@SuppressWarnings({ "unchecked" })
// @SuppressWarnings({ "unchecked" })
protected void finalizeStructure ()
{
Collections.sort(blockCoords, new CoordTupleSort());
@@ -198,7 +204,8 @@ public class TankLayerScan extends LogicComponent
protected boolean checkAir (int x, int y, int z)
{
Block block = world.getBlock(x, y, z);
if (block == null || block == Blocks.air)// || block == TContent.tankAir)
if (block == null || world.isAirBlock(x, y, z))// || block ==
// TContent.tankAir)
return true;
return false;
@@ -207,7 +214,7 @@ public class TankLayerScan extends LogicComponent
protected boolean checkServant (int x, int y, int z)
{
Block block = world.getBlock(x, y, z);
if (block == null || block == Blocks.air || !isValidBlock(x, y, z))
if (block == null || world.isAirBlock(x, y, z) || !isValidBlock(x, y, z))
return false;
if (!block.hasTileEntity(world.getBlockMetadata(x, y, z)))
@@ -297,9 +304,9 @@ public class TankLayerScan extends LogicComponent
if (checkAir(coord.x, y, coord.z))
{
boolean valid = true;
addAirBlock(coord.x, y, coord.z); //Don't skip first one
addAirBlock(coord.x, y, coord.z); // Don't skip first one
//Air blocks
// Air blocks
while (i.hasNext())
{
coord = (CoordTuple) i.next();
@@ -314,7 +321,7 @@ public class TankLayerScan extends LogicComponent
}
}
//Bricks
// Bricks
i = layerBlockCoords.iterator();
while (i.hasNext())
{
@@ -334,7 +341,7 @@ public class TankLayerScan extends LogicComponent
}
else if (checkServant(coord.x, y, coord.z))
{
//Bottom floor. All blocks, please vacate the elevator
// Bottom floor. All blocks, please vacate the elevator
boolean valid = true;
while (i.hasNext())
{
@@ -367,7 +374,7 @@ public class TankLayerScan extends LogicComponent
{
boolean valid = true;
//Bricks
// Bricks
while (i.hasNext())
{
coord = (CoordTuple) i.next();
@@ -381,7 +388,7 @@ public class TankLayerScan extends LogicComponent
}
}
//Air blocks
// Air blocks
if (valid)
{
i = layerAirCoords.iterator();
@@ -446,7 +453,7 @@ public class TankLayerScan extends LogicComponent
}
else
{
if (structureTop == 0) //Workaround for missing data
if (structureTop == 0) // Workaround for missing data
{
for (CoordTuple coord : blockCoords)
structureTop = coord.y;
@@ -481,7 +488,10 @@ public class TankLayerScan extends LogicComponent
}
}
/** Do any necessary cleanup here. Remove air blocks, invalidate servants, etc */
/**
* Do any necessary cleanup here. Remove air blocks, invalidate servants,
* etc
*/
public void cleanup ()
{
Iterator i = blockCoords.iterator();
@@ -575,4 +585,4 @@ public class TankLayerScan extends LogicComponent
{
tags.setBoolean("Complete", completeStructure);
}
}
}