final variables and parameters

This commit is contained in:
thatsIch
2015-09-30 14:24:40 +02:00
parent 059523f543
commit 8b3a954f73
732 changed files with 9253 additions and 9256 deletions
@@ -44,7 +44,7 @@ public class BlockChunkloader extends AEBaseTileBlock implements LoadingCallback
}
@Override
public void ticketsLoaded( List<Ticket> tickets, World world )
public void ticketsLoaded( final List<Ticket> tickets, final World world )
{
}
@@ -42,15 +42,15 @@ public class BlockCubeGenerator extends AEBaseTileBlock
@Override
public boolean onActivated(
World w,
BlockPos pos,
EntityPlayer player,
EnumFacing side,
float hitX,
float hitY,
float hitZ )
final World w,
final BlockPos pos,
final EntityPlayer player,
final EnumFacing side,
final float hitX,
final float hitY,
final float hitZ )
{
TileCubeGenerator tcg = this.getTileEntity( w, pos );
final TileCubeGenerator tcg = this.getTileEntity( w, pos );
if( tcg != null )
{
tcg.click( player );
@@ -42,15 +42,15 @@ public class BlockPhantomNode extends AEBaseTileBlock
@Override
public boolean onActivated(
World w,
BlockPos pos,
EntityPlayer player,
EnumFacing side,
float hitX,
float hitY,
float hitZ )
final World w,
final BlockPos pos,
final EntityPlayer player,
final EnumFacing side,
final float hitX,
final float hitY,
final float hitZ )
{
TilePhantomNode tpn = this.getTileEntity( w, pos );
final TilePhantomNode tpn = this.getTileEntity( w, pos );
tpn.triggerCrashMode();
return true;
}
@@ -65,11 +65,11 @@ public class TileChunkLoader extends AEBaseTile implements IUpdatePlayerListBox
if( this.ct == null )
{
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
final MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
if( server != null )
{
List<EntityPlayerMP> pl = server.getConfigurationManager().playerEntityList;
for( EntityPlayerMP p : pl )
final List<EntityPlayerMP> pl = server.getConfigurationManager().playerEntityList;
for( final EntityPlayerMP p : pl )
{
p.addChatMessage( new ChatComponentText( "Can't chunk load.." ) );
}
@@ -50,7 +50,7 @@ public class TileCubeGenerator extends AEBaseTile implements IUpdatePlayerListBo
if( this.countdown % 20 == 0 )
{
for( EntityPlayer e : CommonHelper.proxy.getPlayers() )
for( final EntityPlayer e : CommonHelper.proxy.getPlayers() )
{
e.addChatMessage( new ChatComponentText( "Spawning in... " + ( this.countdown / 20 ) ) );
}
@@ -67,10 +67,10 @@ public class TileCubeGenerator extends AEBaseTile implements IUpdatePlayerListBo
{
this.worldObj.setBlockToAir( pos );
Item i = this.is.getItem();
EnumFacing side = EnumFacing.UP;
final Item i = this.is.getItem();
final EnumFacing side = EnumFacing.UP;
int half = (int) Math.floor( this.size / 2 );
final int half = (int) Math.floor( this.size / 2 );
for( int y = 0; y < this.size; y++ )
{
@@ -78,18 +78,18 @@ public class TileCubeGenerator extends AEBaseTile implements IUpdatePlayerListBo
{
for( int z = -half; z < half; z++ )
{
BlockPos p = pos.add( x, y-1, z );
final BlockPos p = pos.add( x, y-1, z );
i.onItemUse( this.is.copy(), this.who, this.worldObj, p, side, 0.5f, 0.0f, 0.5f );
}
}
}
}
public void click( EntityPlayer player )
public void click( final EntityPlayer player )
{
if( Platform.isServer() )
{
ItemStack hand = player.inventory.getCurrentItem();
final ItemStack hand = player.inventory.getCurrentItem();
this.who = player;
if( hand == null )
+17 -17
View File
@@ -41,9 +41,9 @@ public class TileItemGen extends AEBaseTile implements IInventory
{
if( POSSIBLE_ITEMS.isEmpty() )
{
for( Object obj : Item.itemRegistry )
for( final Object obj : Item.itemRegistry )
{
Item mi = (Item) obj;
final Item mi = (Item) obj;
if( mi != null )
{
if( mi.isDamageable() )
@@ -55,7 +55,7 @@ public class TileItemGen extends AEBaseTile implements IInventory
}
else
{
List<ItemStack> list = new ArrayList<ItemStack>();
final List<ItemStack> list = new ArrayList<ItemStack>();
mi.getSubItems( mi, mi.getCreativeTab(), list );
POSSIBLE_ITEMS.addAll( list );
}
@@ -71,7 +71,7 @@ public class TileItemGen extends AEBaseTile implements IInventory
}
@Override
public ItemStack getStackInSlot( int i )
public ItemStack getStackInSlot( final int i )
{
return this.getRandomItem();
}
@@ -82,24 +82,24 @@ public class TileItemGen extends AEBaseTile implements IInventory
}
@Override
public ItemStack decrStackSize( int i, int j )
public ItemStack decrStackSize( final int i, final int j )
{
ItemStack a = POSSIBLE_ITEMS.poll();
ItemStack out = a.copy();
final ItemStack a = POSSIBLE_ITEMS.poll();
final ItemStack out = a.copy();
POSSIBLE_ITEMS.add( a );
return out;
}
@Override
public ItemStack getStackInSlotOnClosing( int i )
public ItemStack getStackInSlotOnClosing( final int i )
{
return null;
}
@Override
public void setInventorySlotContents( int i, ItemStack itemstack )
public void setInventorySlotContents( final int i, final ItemStack itemstack )
{
ItemStack a = POSSIBLE_ITEMS.poll();
final ItemStack a = POSSIBLE_ITEMS.poll();
POSSIBLE_ITEMS.add( a );
}
@@ -122,27 +122,27 @@ public class TileItemGen extends AEBaseTile implements IInventory
}
@Override
public boolean isUseableByPlayer( EntityPlayer entityplayer )
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
{
return false;
}
@Override
public void openInventory(
EntityPlayer player )
final EntityPlayer player )
{
}
@Override
public void closeInventory(
EntityPlayer player )
final EntityPlayer player )
{
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
return false;
}
@@ -155,15 +155,15 @@ public class TileItemGen extends AEBaseTile implements IInventory
@Override
public int getField(
int id )
final int id )
{
return 0;
}
@Override
public void setField(
int id,
int value )
final int id,
final int value )
{
}
@@ -35,7 +35,7 @@ public class TilePhantomNode extends AENetworkTile
boolean crashMode = false;
@Override
public IGridNode getGridNode( AEPartLocation dir )
public IGridNode getGridNode( final AEPartLocation dir )
{
if( !this.crashMode )
{
+31 -31
View File
@@ -62,14 +62,14 @@ public class ToolDebugCard extends AEBaseItem
@Override
public boolean onItemUseFirst(
ItemStack stack,
EntityPlayer player,
World world,
BlockPos pos,
EnumFacing side,
float hitX,
float hitY,
float hitZ )
final ItemStack stack,
final EntityPlayer player,
final World world,
final BlockPos pos,
final EnumFacing side,
final float hitX,
final float hitY,
final float hitZ )
{
if( Platform.isClient() )
{
@@ -81,7 +81,7 @@ public class ToolDebugCard extends AEBaseItem
int grids = 0;
int totalNodes = 0;
for( Grid g : TickHandler.INSTANCE.getGridList() )
for( final Grid g : TickHandler.INSTANCE.getGridList() )
{
grids++;
totalNodes += g.getNodes().size();
@@ -92,42 +92,42 @@ public class ToolDebugCard extends AEBaseItem
}
else
{
TileEntity te = world.getTileEntity( pos );
final TileEntity te = world.getTileEntity( pos );
if( te instanceof IGridHost )
{
GridNode node = (GridNode) ( (IGridHost) te ).getGridNode( AEPartLocation.fromFacing( side ) );
final GridNode node = (GridNode) ( (IGridHost) te ).getGridNode( AEPartLocation.fromFacing( side ) );
if( node != null )
{
Grid g = node.getInternalGrid();
IGridNode center = g.getPivot();
final Grid g = node.getInternalGrid();
final IGridNode center = g.getPivot();
this.outputMsg( player, "This Node: " + node.toString() );
this.outputMsg( player, "Center Node: " + center.toString() );
IPathingGrid pg = g.getCache( IPathingGrid.class );
final IPathingGrid pg = g.getCache( IPathingGrid.class );
if( pg.getControllerState() == ControllerState.CONTROLLER_ONLINE )
{
Set<IGridNode> next = new HashSet<IGridNode>();
next.add( node );
int maxLength = 10000;
final int maxLength = 10000;
int length = 0;
outer:
while( !next.isEmpty() )
{
Iterable<IGridNode> current = next;
final Iterable<IGridNode> current = next;
next = new HashSet<IGridNode>();
for( IGridNode n : current )
for( final IGridNode n : current )
{
if( n.getMachine() instanceof TileController )
{
break outer;
}
for( IGridConnection c : n.getConnections() )
for( final IGridConnection c : n.getConnections() )
{
next.add( c.getOtherSide( n ) );
}
@@ -149,12 +149,12 @@ public class ToolDebugCard extends AEBaseItem
this.outputMsg( player, "Freq: " + ( (PartP2PTunnel) center.getMachine() ).freq );
}
TickManagerCache tmc = g.getCache( ITickManager.class );
for( Class<? extends IGridHost> c : g.getMachineClasses() )
final TickManagerCache tmc = g.getCache( ITickManager.class );
for( final Class<? extends IGridHost> c : g.getMachineClasses() )
{
int o = 0;
long nanos = 0;
for( IGridNode oj : g.getMachines( c ) )
for( final IGridNode oj : g.getMachines( c ) )
{
o++;
nanos += tmc.getAvgNanoTime( oj );
@@ -182,15 +182,15 @@ public class ToolDebugCard extends AEBaseItem
if( te instanceof IPartHost )
{
IPart center = ( (IPartHost) te ).getPart( AEPartLocation.INTERNAL );
final IPart center = ( (IPartHost) te ).getPart( AEPartLocation.INTERNAL );
( (IPartHost) te ).markForUpdate();
if( center != null )
{
GridNode n = (GridNode) center.getGridNode();
final GridNode n = (GridNode) center.getGridNode();
this.outputMsg( player, "Node Channels: " + n.usedChannels() );
for( IGridConnection gc : n.getConnections() )
for( final IGridConnection gc : n.getConnections() )
{
AEPartLocation fd = gc.getDirection( n );
final AEPartLocation fd = gc.getDirection( n );
if( fd != AEPartLocation.INTERNAL )
{
this.outputMsg( player, fd.toString() + ": " + gc.getUsedChannels() );
@@ -201,15 +201,15 @@ public class ToolDebugCard extends AEBaseItem
if( te instanceof IAEPowerStorage )
{
IAEPowerStorage ps = (IAEPowerStorage) te;
final IAEPowerStorage ps = (IAEPowerStorage) te;
this.outputMsg( player, "Energy: " + ps.getAECurrentPower() + " / " + ps.getAEMaxPower() );
if( te instanceof IGridHost )
{
IGridNode node = ( (IGridHost) te ).getGridNode( AEPartLocation.fromFacing( side ) );
final IGridNode node = ( (IGridHost) te ).getGridNode( AEPartLocation.fromFacing( side ) );
if( node != null && node.getGrid() != null )
{
IEnergyGrid eg = node.getGrid().getCache( IEnergyGrid.class );
final IEnergyGrid eg = node.getGrid().getCache( IEnergyGrid.class );
this.outputMsg( player, "GridEnergy: " + eg.getStoredPower() + " : " + eg.getEnergyDemand( Double.MAX_VALUE ) );
}
}
@@ -218,14 +218,14 @@ public class ToolDebugCard extends AEBaseItem
return true;
}
private void outputMsg( ICommandSender player, String string )
private void outputMsg( final ICommandSender player, final String string )
{
player.addChatMessage( new ChatComponentText( string ) );
}
public String timeMeasurement( long nanos )
public String timeMeasurement( final long nanos )
{
long ms = nanos / 100000;
final long ms = nanos / 100000;
if( nanos <= 100000 )
{
return nanos + "ns";
+12 -12
View File
@@ -47,21 +47,21 @@ public class ToolEraser extends AEBaseItem
@Override
public boolean onItemUseFirst(
ItemStack stack,
EntityPlayer player,
World world,
BlockPos pos,
EnumFacing side,
float hitX,
float hitY,
float hitZ )
final ItemStack stack,
final EntityPlayer player,
final World world,
final BlockPos pos,
final EnumFacing side,
final float hitX,
final float hitY,
final float hitZ )
{
if( Platform.isClient() )
{
return false;
}
IBlockState state = world.getBlockState( pos );
final IBlockState state = world.getBlockState( pos );
List<BlockPos> next = new LinkedList<BlockPos>();
next.add( pos );
@@ -69,12 +69,12 @@ public class ToolEraser extends AEBaseItem
int blocks = 0;
while( blocks < BLOCK_ERASE_LIMIT && !next.isEmpty() )
{
List<BlockPos> c = next;
final List<BlockPos> c = next;
next = new LinkedList<BlockPos>();
for( BlockPos wc : c )
for( final BlockPos wc : c )
{
IBlockState c_state = world.getBlockState( wc );
final IBlockState c_state = world.getBlockState( wc );
if( state == c_state )
{
@@ -43,22 +43,22 @@ public class ToolMeteoritePlacer extends AEBaseItem
@Override
public boolean onItemUseFirst(
ItemStack stack,
EntityPlayer player,
World world,
BlockPos pos,
EnumFacing side,
float hitX,
float hitY,
float hitZ )
final ItemStack stack,
final EntityPlayer player,
final World world,
final BlockPos pos,
final EnumFacing side,
final float hitX,
final float hitY,
final float hitZ )
{
if( Platform.isClient() )
{
return false;
}
MeteoritePlacer mp = new MeteoritePlacer();
boolean worked = mp.spawnMeteorite( new StandardWorld( world ), pos.getX(),pos.getY(),pos.getZ() );
final MeteoritePlacer mp = new MeteoritePlacer();
final boolean worked = mp.spawnMeteorite( new StandardWorld( world ), pos.getX(),pos.getY(),pos.getZ() );
if( !worked )
{
@@ -53,14 +53,14 @@ public class ToolReplicatorCard extends AEBaseItem
@Override
public boolean onItemUseFirst(
ItemStack stack,
EntityPlayer player,
World world,
BlockPos pos,
EnumFacing side,
float hitX,
float hitY,
float hitZ )
final ItemStack stack,
final EntityPlayer player,
final World world,
final BlockPos pos,
final EnumFacing side,
final float hitX,
final float hitY,
final float hitZ )
{
if( Platform.isClient() )
{
@@ -75,7 +75,7 @@ public class ToolReplicatorCard extends AEBaseItem
{
if( world.getTileEntity( pos ) instanceof IGridHost )
{
NBTTagCompound tag = new NBTTagCompound();
final NBTTagCompound tag = new NBTTagCompound();
tag.setInteger( "x", x );
tag.setInteger( "y", y );
tag.setInteger( "z", z );
@@ -90,49 +90,49 @@ public class ToolReplicatorCard extends AEBaseItem
}
else
{
NBTTagCompound ish = stack.getTagCompound();
final NBTTagCompound ish = stack.getTagCompound();
if( ish != null )
{
int src_x = ish.getInteger( "x" );
int src_y = ish.getInteger( "y" );
int src_z = ish.getInteger( "z" );
int src_side = ish.getInteger( "side" );
int dimid = ish.getInteger( "dimid" );
World src_w = DimensionManager.getWorld( dimid );
final int src_x = ish.getInteger( "x" );
final int src_y = ish.getInteger( "y" );
final int src_z = ish.getInteger( "z" );
final int src_side = ish.getInteger( "side" );
final int dimid = ish.getInteger( "dimid" );
final World src_w = DimensionManager.getWorld( dimid );
TileEntity te = src_w.getTileEntity( new BlockPos( src_x, src_y, src_z ) );
final TileEntity te = src_w.getTileEntity( new BlockPos( src_x, src_y, src_z ) );
if( te instanceof IGridHost )
{
IGridHost gh = (IGridHost) te;
EnumFacing sideOff = EnumFacing.VALUES[src_side];
EnumFacing currentSideOff = side;
IGridNode n = gh.getGridNode( AEPartLocation.fromFacing( sideOff ) );
final IGridHost gh = (IGridHost) te;
final EnumFacing sideOff = EnumFacing.VALUES[src_side];
final EnumFacing currentSideOff = side;
final IGridNode n = gh.getGridNode( AEPartLocation.fromFacing( sideOff ) );
if( n != null )
{
IGrid g = n.getGrid();
final IGrid g = n.getGrid();
if( g != null )
{
ISpatialCache sc = g.getCache( ISpatialCache.class );
final ISpatialCache sc = g.getCache( ISpatialCache.class );
if( sc.isValidRegion() )
{
DimensionalCoord min = sc.getMin();
DimensionalCoord max = sc.getMax();
final DimensionalCoord min = sc.getMin();
final DimensionalCoord max = sc.getMax();
x += currentSideOff.getFrontOffsetX();
y += currentSideOff.getFrontOffsetY();
z += currentSideOff.getFrontOffsetZ();
int min_x = min.x;
int min_y = min.y;
int min_z = min.z;
final int min_x = min.x;
final int min_y = min.y;
final int min_z = min.z;
int rel_x = min.x - src_x + x;
int rel_y = min.y - src_y + y;
int rel_z = min.z - src_z + z;
final int rel_x = min.x - src_x + x;
final int rel_y = min.y - src_y + y;
final int rel_z = min.z - src_z + z;
int scale_x = max.x - min.x;
int scale_y = max.y - min.y;
int scale_z = max.z - min.z;
final int scale_x = max.x - min.x;
final int scale_y = max.y - min.y;
final int scale_z = max.z - min.z;
for( int i = 1; i < scale_x; i++ )
{
@@ -140,17 +140,17 @@ public class ToolReplicatorCard extends AEBaseItem
{
for( int k = 1; k < scale_z; k++ )
{
BlockPos p = new BlockPos( min_x + i, min_y + j, min_z + k );
BlockPos d = new BlockPos( i + rel_x, j + rel_y, k + rel_z );
IBlockState state = src_w.getBlockState( p );
Block blk = state.getBlock();
final BlockPos p = new BlockPos( min_x + i, min_y + j, min_z + k );
final BlockPos d = new BlockPos( i + rel_x, j + rel_y, k + rel_z );
final IBlockState state = src_w.getBlockState( p );
final Block blk = state.getBlock();
world.setBlockState( d, state );
if( blk != null && blk.hasTileEntity( state ) )
{
TileEntity ote = src_w.getTileEntity( p );
TileEntity nte = blk.createTileEntity( world, state );
NBTTagCompound data = new NBTTagCompound();
final TileEntity ote = src_w.getTileEntity( p );
final TileEntity nte = blk.createTileEntity( world, state );
final NBTTagCompound data = new NBTTagCompound();
ote.writeToNBT( data );
nte.readFromNBT( (NBTTagCompound) data.copy() );
world.setTileEntity( d, nte );
@@ -188,7 +188,7 @@ public class ToolReplicatorCard extends AEBaseItem
return true;
}
private void outputMsg( ICommandSender player, String string )
private void outputMsg( final ICommandSender player, final String string )
{
player.addChatMessage( new ChatComponentText( string ) );
}