Basic reformat, hit once, hope never again
This commit is contained in:
@@ -62,15 +62,15 @@ public class ToolDebugCard extends AEBaseItem
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
if( Platform.isClient() )
|
||||
return false;
|
||||
|
||||
if ( player.isSneaking() )
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
int grids = 0;
|
||||
int totalNodes = 0;
|
||||
|
||||
for ( Grid g : TickHandler.INSTANCE.getGridList() )
|
||||
for( Grid g : TickHandler.INSTANCE.getGridList() )
|
||||
{
|
||||
grids++;
|
||||
totalNodes += g.getNodes().size();
|
||||
@@ -83,10 +83,10 @@ public class ToolDebugCard extends AEBaseItem
|
||||
{
|
||||
TileEntity te = world.getTileEntity( x, y, z );
|
||||
|
||||
if ( te instanceof IGridHost )
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
GridNode node = (GridNode) ( (IGridHost) te ).getGridNode( ForgeDirection.getOrientation( side ) );
|
||||
if ( node != null )
|
||||
if( node != null )
|
||||
{
|
||||
Grid g = node.getInternalGrid();
|
||||
IGridNode center = g.getPivot();
|
||||
@@ -94,7 +94,7 @@ public class ToolDebugCard extends AEBaseItem
|
||||
this.outputMsg( player, "Center Node: " + center.toString() );
|
||||
|
||||
IPathingGrid pg = g.getCache( IPathingGrid.class );
|
||||
if ( pg.getControllerState() == ControllerState.CONTROLLER_ONLINE )
|
||||
if( pg.getControllerState() == ControllerState.CONTROLLER_ONLINE )
|
||||
{
|
||||
int length = 0;
|
||||
|
||||
@@ -104,46 +104,46 @@ public class ToolDebugCard extends AEBaseItem
|
||||
int maxLength = 10000;
|
||||
|
||||
outer:
|
||||
while ( !next.isEmpty() )
|
||||
while( !next.isEmpty() )
|
||||
{
|
||||
Iterable<IGridNode> current = next;
|
||||
next = new HashSet<IGridNode>();
|
||||
|
||||
for ( IGridNode n : current )
|
||||
for( IGridNode n : current )
|
||||
{
|
||||
if ( n.getMachine() instanceof TileController )
|
||||
if( n.getMachine() instanceof TileController )
|
||||
break outer;
|
||||
|
||||
for ( IGridConnection c : n.getConnections() )
|
||||
for( IGridConnection c : n.getConnections() )
|
||||
next.add( c.getOtherSide( n ) );
|
||||
}
|
||||
|
||||
length++;
|
||||
|
||||
if ( length > maxLength )
|
||||
if( length > maxLength )
|
||||
break;
|
||||
}
|
||||
|
||||
this.outputMsg( player, "Cable Distance: " + length );
|
||||
}
|
||||
|
||||
if ( center.getMachine() instanceof PartP2PTunnel )
|
||||
if( center.getMachine() instanceof PartP2PTunnel )
|
||||
{
|
||||
this.outputMsg( player, "Freq: " + ( (PartP2PTunnel) center.getMachine() ).freq );
|
||||
}
|
||||
|
||||
TickManagerCache tmc = g.getCache( ITickManager.class );
|
||||
for ( Class<? extends IGridHost> c : g.getMachineClasses() )
|
||||
for( Class<? extends IGridHost> c : g.getMachineClasses() )
|
||||
{
|
||||
int o = 0;
|
||||
long nanos = 0;
|
||||
for ( IGridNode oj : g.getMachines( c ) )
|
||||
for( IGridNode oj : g.getMachines( c ) )
|
||||
{
|
||||
o++;
|
||||
nanos += tmc.getAvgNanoTime( oj );
|
||||
}
|
||||
|
||||
if ( nanos < 0 )
|
||||
if( nanos < 0 )
|
||||
{
|
||||
this.outputMsg( player, c.getSimpleName() + " - " + o );
|
||||
}
|
||||
@@ -159,32 +159,32 @@ public class ToolDebugCard extends AEBaseItem
|
||||
else
|
||||
this.outputMsg( player, "Not Networked Block" );
|
||||
|
||||
if ( te instanceof IPartHost )
|
||||
if( te instanceof IPartHost )
|
||||
{
|
||||
IPart center = ( (IPartHost) te ).getPart( ForgeDirection.UNKNOWN );
|
||||
( (IPartHost) te ).markForUpdate();
|
||||
if ( center != null )
|
||||
if( center != null )
|
||||
{
|
||||
GridNode n = (GridNode) center.getGridNode();
|
||||
this.outputMsg( player, "Node Channels: " + n.usedChannels() );
|
||||
for ( IGridConnection gc : n.getConnections() )
|
||||
for( IGridConnection gc : n.getConnections() )
|
||||
{
|
||||
ForgeDirection fd = gc.getDirection( n );
|
||||
if ( fd != ForgeDirection.UNKNOWN )
|
||||
if( fd != ForgeDirection.UNKNOWN )
|
||||
this.outputMsg( player, fd.toString() + ": " + gc.getUsedChannels() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( te instanceof IAEPowerStorage )
|
||||
if( te instanceof IAEPowerStorage )
|
||||
{
|
||||
IAEPowerStorage ps = (IAEPowerStorage) te;
|
||||
this.outputMsg( player, "Energy: " + ps.getAECurrentPower() + " / " + ps.getAEMaxPower() );
|
||||
|
||||
if ( te instanceof IGridHost )
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
IGridNode node = ( (IGridHost) te ).getGridNode( ForgeDirection.getOrientation( side ) );
|
||||
if ( node != null && node.getGrid() != null )
|
||||
if( node != null && node.getGrid() != null )
|
||||
{
|
||||
IEnergyGrid eg = node.getGrid().getCache( IEnergyGrid.class );
|
||||
this.outputMsg( player, "GridEnergy: " + eg.getStoredPower() + " : " + eg.getEnergyDemand( Double.MAX_VALUE ) );
|
||||
@@ -203,7 +203,7 @@ public class ToolDebugCard extends AEBaseItem
|
||||
public String timeMeasurement( long nanos )
|
||||
{
|
||||
long ms = nanos / 100000;
|
||||
if ( nanos <= 100000 )
|
||||
if( nanos <= 100000 )
|
||||
return nanos + "ns";
|
||||
return ( ms / 10.0f ) + "ms";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user