Basic reformat, hit once, hope never again
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.me.cluster.implementations;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -28,75 +29,44 @@ import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.me.cluster.MBCalculator;
|
||||
import appeng.tile.spatial.TileSpatialPylon;
|
||||
|
||||
|
||||
public class SpatialPylonCalculator extends MBCalculator
|
||||
{
|
||||
|
||||
private final TileSpatialPylon tqb;
|
||||
|
||||
public SpatialPylonCalculator(IAEMultiBlock t) {
|
||||
public SpatialPylonCalculator( IAEMultiBlock t )
|
||||
{
|
||||
super( t );
|
||||
this.tqb = (TileSpatialPylon) t;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidTile(TileEntity te)
|
||||
public boolean checkMultiblockScale( WorldCoord min, WorldCoord max )
|
||||
{
|
||||
return te instanceof TileSpatialPylon;
|
||||
return ( min.x == max.x && min.y == max.y && min.z != max.z ) || ( min.x == max.x && min.y != max.y && min.z == max.z ) || ( min.x != max.x && min.y == max.y && min.z == max.z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkMultiblockScale(WorldCoord min, WorldCoord max)
|
||||
{
|
||||
return (min.x == max.x && min.y == max.y && min.z != max.z) || (min.x == max.x && min.y != max.y && min.z == max.z) || (min.x != max.x && min.y == max.y && min.z == max.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTiles(IAECluster cl, World w, WorldCoord min, WorldCoord max)
|
||||
{
|
||||
SpatialPylonCluster c = (SpatialPylonCluster) cl;
|
||||
|
||||
for (int x = min.x; x <= max.x; x++)
|
||||
{
|
||||
for (int y = min.y; y <= max.y; y++)
|
||||
{
|
||||
for (int z = min.z; z <= max.z; z++)
|
||||
{
|
||||
TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( x, y, z );
|
||||
te.updateStatus( c );
|
||||
c.line.add( (te) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAECluster createCluster(World w, WorldCoord min, WorldCoord max)
|
||||
public IAECluster createCluster( World w, WorldCoord min, WorldCoord max )
|
||||
{
|
||||
return new SpatialPylonCluster( new DimensionalCoord( w, min.x, min.y, min.z ), new DimensionalCoord( w, max.x, max.y, max.z ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnect()
|
||||
{
|
||||
this.tqb.disconnect(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verifyInternalStructure(World w, WorldCoord min, WorldCoord max)
|
||||
public boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max )
|
||||
{
|
||||
|
||||
for (int x = min.x; x <= max.x; x++)
|
||||
for( int x = min.x; x <= max.x; x++ )
|
||||
{
|
||||
for (int y = min.y; y <= max.y; y++)
|
||||
for( int y = min.y; y <= max.y; y++ )
|
||||
{
|
||||
for (int z = min.z; z <= max.z; z++)
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z );
|
||||
|
||||
if ( !te.isValid() )
|
||||
if( !te.isValid() )
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,4 +74,34 @@ public class SpatialPylonCalculator extends MBCalculator
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnect()
|
||||
{
|
||||
this.tqb.disconnect( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max )
|
||||
{
|
||||
SpatialPylonCluster c = (SpatialPylonCluster) cl;
|
||||
|
||||
for( int x = min.x; x <= max.x; x++ )
|
||||
{
|
||||
for( int y = min.y; y <= max.y; y++ )
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( x, y, z );
|
||||
te.updateStatus( c );
|
||||
c.line.add( ( te ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidTile( TileEntity te )
|
||||
{
|
||||
return te instanceof TileSpatialPylon;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user