final variables and parameters

seeing some methods it does actually help to enforce the parameters
This commit is contained in:
thatsIch
2015-09-25 23:10:56 +02:00
parent e52400bf26
commit 410d2f1e0d
819 changed files with 9390 additions and 9396 deletions
+10 -10
View File
@@ -31,7 +31,7 @@ public final class AECommand extends CommandBase
{
private final MinecraftServer srv;
public AECommand( MinecraftServer server )
public AECommand( final MinecraftServer server )
{
this.srv = server;
}
@@ -46,7 +46,7 @@ public final class AECommand extends CommandBase
* wtf?
*/
@Override
public int compareTo( Object arg0 )
public int compareTo( final Object arg0 )
{
return 1;
}
@@ -58,13 +58,13 @@ public final class AECommand extends CommandBase
}
@Override
public String getCommandUsage( ICommandSender icommandsender )
public String getCommandUsage( final ICommandSender icommandsender )
{
return "commands.ae2.usage";
}
@Override
public void processCommand( ICommandSender sender, String[] args )
public void processCommand( final ICommandSender sender, final String[] args )
{
if( args.length == 0 )
{
@@ -76,15 +76,15 @@ public final class AECommand extends CommandBase
{
if( args.length > 1 )
{
Commands c = Commands.valueOf( args[1] );
final Commands c = Commands.valueOf( args[1] );
throw new WrongUsageException( c.command.getHelp( this.srv ) );
}
}
catch( WrongUsageException wrong )
catch( final WrongUsageException wrong )
{
throw wrong;
}
catch( Throwable er )
catch( final Throwable er )
{
throw new WrongUsageException( "commands.ae2.usage" );
}
@@ -97,7 +97,7 @@ public final class AECommand extends CommandBase
{
try
{
Commands c = Commands.valueOf( args[0] );
final Commands c = Commands.valueOf( args[0] );
if( sender.canCommandSenderUseCommand( c.level, this.getCommandName() ) )
{
c.command.call( this.srv, args, sender );
@@ -107,11 +107,11 @@ public final class AECommand extends CommandBase
throw new WrongUsageException( "commands.ae2.permissions" );
}
}
catch( WrongUsageException wrong )
catch( final WrongUsageException wrong )
{
throw wrong;
}
catch( Throwable er )
catch( final Throwable er )
{
throw new WrongUsageException( "commands.ae2.usage" );
}
+1 -1
View File
@@ -30,7 +30,7 @@ public enum Commands
public final int level;
public final ISubCommand command;
Commands( int level, ISubCommand w )
Commands( final int level, final ISubCommand w )
{
this.level = level;
this.command = w;
+15 -15
View File
@@ -62,7 +62,7 @@ public class ServerHelper extends CommonHelper
}
@Override
public void bindTileEntitySpecialRenderer( Class tile, AEBaseBlock blk )
public void bindTileEntitySpecialRenderer( final Class tile, final AEBaseBlock blk )
{
throw new UnsupportedOperationException( "This is a server..." );
}
@@ -72,7 +72,7 @@ public class ServerHelper extends CommonHelper
{
if( !Platform.isClient() )
{
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
final MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
if( server != null )
{
@@ -84,22 +84,22 @@ public class ServerHelper extends CommonHelper
}
@Override
public void sendToAllNearExcept( EntityPlayer p, double x, double y, double z, double dist, World w, AppEngPacket packet )
public void sendToAllNearExcept( final EntityPlayer p, final double x, final double y, final double z, final double dist, final World w, final AppEngPacket packet )
{
if( Platform.isClient() )
{
return;
}
for( EntityPlayer o : this.getPlayers() )
for( final EntityPlayer o : this.getPlayers() )
{
EntityPlayerMP entityplayermp = (EntityPlayerMP) o;
final EntityPlayerMP entityplayermp = (EntityPlayerMP) o;
if( entityplayermp != p && entityplayermp.worldObj == w )
{
double dX = x - entityplayermp.posX;
double dY = y - entityplayermp.posY;
double dZ = z - entityplayermp.posZ;
final double dX = x - entityplayermp.posX;
final double dY = y - entityplayermp.posY;
final double dZ = z - entityplayermp.posZ;
if( dX * dX + dY * dY + dZ * dZ < dist * dist )
{
@@ -110,13 +110,13 @@ public class ServerHelper extends CommonHelper
}
@Override
public void spawnEffect( EffectType type, World worldObj, double posX, double posY, double posZ, Object o )
public void spawnEffect( final EffectType type, final World worldObj, final double posX, final double posY, final double posZ, final Object o )
{
// :P
}
@Override
public boolean shouldAddParticles( Random r )
public boolean shouldAddParticles( final Random r )
{
return false;
}
@@ -128,7 +128,7 @@ public class ServerHelper extends CommonHelper
}
@Override
public void doRenderItem( ItemStack sis, World tile )
public void doRenderItem( final ItemStack sis, final World tile )
{
}
@@ -150,17 +150,17 @@ public class ServerHelper extends CommonHelper
return this.renderModeForPlayer( this.renderModeBased );
}
protected CableRenderMode renderModeForPlayer( EntityPlayer player )
protected CableRenderMode renderModeForPlayer( final EntityPlayer player )
{
if( player != null )
{
for( int x = 0; x < InventoryPlayer.getHotbarSize(); x++ )
{
ItemStack is = player.inventory.getStackInSlot( x );
final ItemStack is = player.inventory.getStackInSlot( x );
if( is != null && is.getItem() instanceof ToolNetworkTool )
{
NBTTagCompound c = is.getTagCompound();
final NBTTagCompound c = is.getTagCompound();
if( c != null && c.getBoolean( "hideFacades" ) )
{
return CableRenderMode.CableView;
@@ -179,7 +179,7 @@ public class ServerHelper extends CommonHelper
}
@Override
public void updateRenderMode( EntityPlayer player )
public void updateRenderMode( final EntityPlayer player )
{
this.renderModeBased = player;
}
@@ -39,7 +39,7 @@ public class ChunkLogger implements ISubCommand
boolean enabled = false;
@SubscribeEvent
public void onChunkLoadEvent( ChunkEvent.Load event )
public void onChunkLoadEvent( final ChunkEvent.Load event )
{
if( !event.world.isRemote )
{
@@ -53,7 +53,7 @@ public class ChunkLogger implements ISubCommand
if( AEConfig.instance.isFeatureEnabled( AEFeature.ChunkLoggerTrace ) )
{
boolean output = false;
for( StackTraceElement e : Thread.currentThread().getStackTrace() )
for( final StackTraceElement e : Thread.currentThread().getStackTrace() )
{
if( output )
{
@@ -68,7 +68,7 @@ public class ChunkLogger implements ISubCommand
}
@SubscribeEvent
public void onChunkUnloadEvent( ChunkEvent.Unload unload )
public void onChunkUnloadEvent( final ChunkEvent.Unload unload )
{
if( !unload.world.isRemote )
{
@@ -78,13 +78,13 @@ public class ChunkLogger implements ISubCommand
}
@Override
public String getHelp( MinecraftServer srv )
public String getHelp( final MinecraftServer srv )
{
return "commands.ae2.ChunkLogger";
}
@Override
public void call( MinecraftServer srv, String[] data, ICommandSender sender )
public void call( final MinecraftServer srv, final String[] data, final ICommandSender sender )
{
this.enabled = !this.enabled;
@@ -32,15 +32,15 @@ public class Supporters implements ISubCommand
{
@Override
public String getHelp( MinecraftServer srv )
public String getHelp( final MinecraftServer srv )
{
return "commands.ae2.Supporters";
}
@Override
public void call( MinecraftServer srv, String[] data, ICommandSender sender )
public void call( final MinecraftServer srv, final String[] data, final ICommandSender sender )
{
String[] who = { "Stig Halvorsen", "Josh Ricker", "Jenny \"Othlon\" Sutherland", "Hristo Bogdanov", "BevoLJ" };
final String[] who = { "Stig Halvorsen", "Josh Ricker", "Jenny \"Othlon\" Sutherland", "Hristo Bogdanov", "BevoLJ" };
sender.addChatMessage( new ChatComponentText( "Special thanks to " + Joiner.on( ", " ).join( who ) ) );
}
}