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
+3 -3
View File
@@ -51,15 +51,15 @@ public enum AEApi
HELD_API = (IAppEngApi) apiField.get( apiClass );
}
catch( ClassNotFoundException e )
catch( final ClassNotFoundException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FQN + " class, without it being declared." );
}
catch( NoSuchFieldException e )
catch( final NoSuchFieldException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without it being declared." );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without enough access permissions." );
}
@@ -30,22 +30,22 @@ public enum AccessRestriction
private final int permissionBit;
AccessRestriction( int v )
AccessRestriction( final int v )
{
this.permissionBit = v;
}
public boolean hasPermission( AccessRestriction ar )
public boolean hasPermission( final AccessRestriction ar )
{
return ( this.permissionBit & ar.permissionBit ) == ar.permissionBit;
}
public AccessRestriction restrictPermissions( AccessRestriction ar )
public AccessRestriction restrictPermissions( final AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit & ar.permissionBit );
}
private AccessRestriction getPermByBit( int bit )
private AccessRestriction getPermByBit( final int bit )
{
switch( bit )
{
@@ -61,12 +61,12 @@ public enum AccessRestriction
}
}
public AccessRestriction addPermissions( AccessRestriction ar )
public AccessRestriction addPermissions( final AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit | ar.permissionBit );
}
public AccessRestriction removePermissions( AccessRestriction ar )
public AccessRestriction removePermissions( final AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit & ( ~ar.permissionBit ) );
}
@@ -32,13 +32,13 @@ public enum FuzzyMode
public final float breakPoint;
public final float percentage;
FuzzyMode( float p )
FuzzyMode( final float p )
{
this.percentage = p;
this.breakPoint = p / 100.0f;
}
public int calculateBreakPoint( int maxDamage )
public int calculateBreakPoint( final int maxDamage )
{
return (int) ( ( this.percentage * maxDamage ) / 100.0f );
}
@@ -33,12 +33,12 @@ public enum PowerMultiplier
*/
public double multiplier = 1.0;
public double multiply( double in )
public double multiply( final double in )
{
return in * this.multiplier;
}
public double divide( double in )
public double divide( final double in )
{
return in / this.multiplier;
}
@@ -41,7 +41,7 @@ public enum PowerUnits
*/
public double conversionRatio = 1.0;
PowerUnits( String un )
PowerUnits( final String un )
{
this.unlocalizedName = un;
}
@@ -58,7 +58,7 @@ public enum PowerUnits
*
* @return value converted to target units, from this units.
*/
public double convertTo( PowerUnits target, double value )
public double convertTo( final PowerUnits target, final double value )
{
return ( value * this.conversionRatio ) / target.conversionRatio;
}
+1 -1
View File
@@ -61,7 +61,7 @@ public enum Settings
private final EnumSet<? extends Enum<?>> values;
Settings( @Nonnull EnumSet<? extends Enum<?>> possibleOptions )
Settings( @Nonnull final EnumSet<? extends Enum<?>> possibleOptions )
{
if( possibleOptions.isEmpty() )
{
+4 -4
View File
@@ -49,7 +49,7 @@ public enum Upgrades
private final int tier;
private final Map<ItemStack, Integer> supportedMax = new HashMap<>();
Upgrades( int tier )
Upgrades( final int tier )
{
this.tier = tier;
}
@@ -68,10 +68,10 @@ public enum Upgrades
* @param item machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem( IItemDefinition item, int maxSupported )
public void registerItem( final IItemDefinition item, final int maxSupported )
{
final Optional<ItemStack> maybeStack = item.maybeStack( 1 );
for( ItemStack stack : maybeStack.asSet() )
for( final ItemStack stack : maybeStack.asSet() )
{
this.registerItem( stack, maxSupported );
}
@@ -83,7 +83,7 @@ public enum Upgrades
* @param stack machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem( ItemStack stack, int maxSupported )
public void registerItem( final ItemStack stack, final int maxSupported )
{
if( stack != null )
{
@@ -39,7 +39,7 @@ public class LocatableEventAnnounce extends Event
public final ILocatable target;
public final LocatableEvent change;
public LocatableEventAnnounce( ILocatable o, LocatableEvent ev )
public LocatableEventAnnounce( final ILocatable o, final LocatableEvent ev )
{
this.target = o;
this.change = ev;
@@ -29,7 +29,7 @@ public class AppEngException extends Exception
private static final long serialVersionUID = -9051434206368465494L;
public AppEngException( String t )
public AppEngException( final String t )
{
super( t );
}
@@ -3,7 +3,7 @@ package appeng.api.exceptions;
public class CoreInaccessibleException extends RuntimeException
{
public CoreInaccessibleException( String message )
public CoreInaccessibleException( final String message )
{
super( message );
}
@@ -3,7 +3,7 @@ package appeng.api.exceptions;
public class MissingDefinition extends RuntimeException
{
public MissingDefinition( String message )
public MissingDefinition( final String message )
{
super( message );
}
@@ -29,7 +29,7 @@ public class MissingIngredientError extends Exception
private static final long serialVersionUID = -998858343831371697L;
public MissingIngredientError( String n )
public MissingIngredientError( final String n )
{
super( n );
}
@@ -29,7 +29,7 @@ public class ModNotInstalled extends Exception
private static final long serialVersionUID = -9052435206368425494L;
public ModNotInstalled( String t )
public ModNotInstalled( final String t )
{
super( t );
}
@@ -29,7 +29,7 @@ public class RecipeError extends Exception
private static final long serialVersionUID = -6602870588617670262L;
public RecipeError( String n )
public RecipeError( final String n )
{
super( n );
}
@@ -29,7 +29,7 @@ public class RegistrationError extends Exception
private static final long serialVersionUID = -6602870588617670263L;
public RegistrationError( String n )
public RegistrationError( final String n )
{
super( n );
}
@@ -33,7 +33,7 @@ public class TransitionResult
public final boolean success;
public final double energyUsage;
public TransitionResult( boolean _success, double power )
public TransitionResult( final boolean _success, final double power )
{
this.success = _success;
this.energyUsage = power;
@@ -36,7 +36,7 @@ public class MENetworkChannelChanged extends MENetworkEvent
public final IGridNode node;
public MENetworkChannelChanged( IGridNode n )
public MENetworkChannelChanged( final IGridNode n )
{
this.node = n;
}
@@ -32,7 +32,7 @@ public class MENetworkCraftingCpuChange extends MENetworkEvent
public final IGridNode node;
public MENetworkCraftingCpuChange( IGridNode n )
public MENetworkCraftingCpuChange( final IGridNode n )
{
this.node = n;
}
@@ -34,7 +34,7 @@ public class MENetworkCraftingPatternChange extends MENetworkEvent
public final ICraftingProvider provider;
public final IGridNode node;
public MENetworkCraftingPatternChange( ICraftingProvider p, IGridNode n )
public MENetworkCraftingPatternChange( final ICraftingProvider p, final IGridNode n )
{
this.provider = p;
this.node = n;
@@ -71,7 +71,7 @@ public class MENetworkEvent
*
* @param v current number of visitors
*/
public void setVisitedObjects( int v )
public void setVisitedObjects( final int v )
{
this.visited = v;
}
@@ -39,7 +39,7 @@ public class MENetworkPowerIdleChange extends MENetworkEvent
public final IGridNode node;
public MENetworkPowerIdleChange( IGridNode nodeThatChanged )
public MENetworkPowerIdleChange( final IGridNode nodeThatChanged )
{
this.node = nodeThatChanged;
}
@@ -42,7 +42,7 @@ public class MENetworkPowerStorage extends MENetworkEvent
public final IAEPowerStorage storage;
public final PowerEventType type;
public MENetworkPowerStorage( IAEPowerStorage t, PowerEventType y )
public MENetworkPowerStorage( final IAEPowerStorage t, final PowerEventType y )
{
this.storage = t;
this.type = y;
@@ -39,7 +39,7 @@ public class MENetworkSpatialEvent extends MENetworkEvent
* @param SpatialIO ( INSTANCE of the SpatialIO block )
* @param EnergyUsage ( the amount of energy that the SpatialIO uses)
*/
public MENetworkSpatialEvent( IGridHost SpatialIO, double EnergyUsage )
public MENetworkSpatialEvent( final IGridHost SpatialIO, final double EnergyUsage )
{
this.host = SpatialIO;
this.spatialEnergyUsage = EnergyUsage;
@@ -42,7 +42,7 @@ public class MENetworkStorageEvent extends MENetworkEvent
public final IMEMonitor monitor;
public final StorageChannel channel;
public MENetworkStorageEvent( IMEMonitor o, StorageChannel chan )
public MENetworkStorageEvent( final IMEMonitor o, final StorageChannel chan )
{
this.monitor = o;
this.channel = chan;
@@ -29,7 +29,7 @@ public class MachineSource extends BaseActionSource
public final IActionHost via;
public MachineSource( IActionHost v )
public MachineSource( final IActionHost v )
{
this.via = v;
}
@@ -33,7 +33,7 @@ public class PlayerSource extends BaseActionSource
public final EntityPlayer player;
public final IActionHost via;
public PlayerSource( EntityPlayer p, IActionHost v )
public PlayerSource( final EntityPlayer p, final IActionHost v )
{
this.player = p;
this.via = v;
@@ -60,7 +60,7 @@ public class TickingRequest
*/
public final boolean canBeAlerted;
public TickingRequest( int min, int max, boolean sleep, boolean alertable )
public TickingRequest( final int min, final int max, final boolean sleep, final boolean alertable )
{
this.minTickRate = min;
this.maxTickRate = max;
@@ -33,7 +33,7 @@ public enum CableRenderMode
public final boolean transparentFacades;
public final boolean opaqueFacades;
CableRenderMode( boolean hideFacades )
CableRenderMode( final boolean hideFacades )
{
this.transparentFacades = hideFacades;
this.opaqueFacades = !hideFacades;
+2 -2
View File
@@ -47,7 +47,7 @@ public abstract class LayerBase extends TileEntity // implements IPartHost
*
* @return the part for the requested side.
*/
public IPart getPart( AEPartLocation side )
public IPart getPart( final AEPartLocation side )
{
return null; // place holder.
}
@@ -61,7 +61,7 @@ public abstract class LayerBase extends TileEntity // implements IPartHost
*
* @return the part for the requested side.
*/
public IPart getPart( EnumFacing side )
public IPart getPart( final EnumFacing side )
{
return null; // place holder.
}
@@ -55,14 +55,14 @@ public class SelectedPart
this.side = AEPartLocation.INTERNAL;
}
public SelectedPart( IPart part, AEPartLocation side )
public SelectedPart( final IPart part, final AEPartLocation side )
{
this.part = part;
this.facade = null;
this.side = side;
}
public SelectedPart( IFacadePart facade, AEPartLocation side )
public SelectedPart( final IFacadePart facade, final AEPartLocation side )
{
this.part = null;
this.facade = facade;
@@ -34,14 +34,14 @@ public class ResolverResult
public final int damageValue;
public final NBTTagCompound compound;
public ResolverResult( String name, int damage )
public ResolverResult( final String name, final int damage )
{
this.itemName = name;
this.damageValue = damage;
this.compound = null;
}
public ResolverResult( String name, int damage, NBTTagCompound data )
public ResolverResult( final String name, final int damage, final NBTTagCompound data )
{
this.itemName = name;
this.damageValue = damage;
@@ -36,7 +36,7 @@ public class ResolverResultSet
public final String name;
public final List<ItemStack> results;
public ResolverResultSet( String myName, ItemStack... set )
public ResolverResultSet( final String myName, final ItemStack... set )
{
this.results = Arrays.asList( set );
this.name = myName;
@@ -52,32 +52,32 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
protected boolean hasChanged = true;
public MEMonitorHandler( IMEInventoryHandler<StackType> t )
public MEMonitorHandler( final IMEInventoryHandler<StackType> t )
{
this.internalHandler = t;
this.cachedList = t.getChannel().createList();
}
public MEMonitorHandler( IMEInventoryHandler<StackType> t, StorageChannel chan )
public MEMonitorHandler( final IMEInventoryHandler<StackType> t, final StorageChannel chan )
{
this.internalHandler = t;
this.cachedList = chan.createList();
}
@Override
public void addListener( IMEMonitorHandlerReceiver<StackType> l, Object verificationToken )
public void addListener( final IMEMonitorHandlerReceiver<StackType> l, final Object verificationToken )
{
this.listeners.put( l, verificationToken );
}
@Override
public void removeListener( IMEMonitorHandlerReceiver<StackType> l )
public void removeListener( final IMEMonitorHandlerReceiver<StackType> l )
{
this.listeners.remove( l );
}
@Override
public StackType injectItems( StackType input, Actionable mode, BaseActionSource src )
public StackType injectItems( final StackType input, final Actionable mode, final BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
@@ -91,9 +91,9 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
return this.internalHandler;
}
private StackType monitorDifference( IAEStack original, StackType leftOvers, boolean extraction, BaseActionSource src )
private StackType monitorDifference( final IAEStack original, final StackType leftOvers, final boolean extraction, final BaseActionSource src )
{
StackType diff = (StackType) original.copy();
final StackType diff = (StackType) original.copy();
if( extraction )
{
@@ -112,19 +112,19 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
return leftOvers;
}
protected void postChangesToListeners( Iterable<StackType> changes, BaseActionSource src )
protected void postChangesToListeners( final Iterable<StackType> changes, final BaseActionSource src )
{
this.notifyListenersOfChange( changes, src );
}
protected void notifyListenersOfChange( Iterable<StackType> diff, BaseActionSource src )
protected void notifyListenersOfChange( final Iterable<StackType> diff, final BaseActionSource src )
{
this.hasChanged = true;// need to update the cache.
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
final Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
while( i.hasNext() )
{
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
final Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
final IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
if( receiver.isValid( o.getValue() ) )
{
receiver.postChange( this, diff, src );
@@ -142,7 +142,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
}
@Override
public StackType extractItems( StackType request, Actionable mode, BaseActionSource src )
public StackType extractItems( final StackType request, final Actionable mode, final BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
@@ -175,17 +175,17 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
}
@Override
public boolean isPrioritized( StackType input )
public boolean isPrioritized( final StackType input )
{
return this.getHandler().isPrioritized( input );
}
@Override
public boolean canAccept( StackType input )
public boolean canAccept( final StackType input )
{
return this.getHandler().canAccept( input );
} @Override
public IItemList<StackType> getAvailableItems( IItemList out )
public IItemList<StackType> getAvailableItems( final IItemList out )
{
return this.getHandler().getAvailableItems( out );
}
@@ -203,7 +203,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
}
@Override
public boolean validForPass( int i )
public boolean validForPass( final int i )
{
return this.getHandler().validForPass( i );
}
@@ -45,7 +45,7 @@ public enum StorageChannel
public final Class<? extends IAEStack> type;
StorageChannel( Class<? extends IAEStack> t )
StorageChannel( final Class<? extends IAEStack> t )
{
this.type = t;
}
@@ -19,7 +19,7 @@ public class AEAxisAlignedBB
return AxisAlignedBB.fromBounds( minX, minY, minZ, maxX, maxY, maxZ );
}
public AEAxisAlignedBB(double a,double b, double c, double d, double e, double f)
public AEAxisAlignedBB( final double a, final double b, final double c, final double d, final double e, final double f)
{
minX=a;
minY=b;
@@ -30,18 +30,18 @@ public class AEAxisAlignedBB
}
public static AEAxisAlignedBB fromBounds(
double a,
double b,
double c,
double d,
double e,
double f )
final double a,
final double b,
final double c,
final double d,
final double e,
final double f )
{
return new AEAxisAlignedBB(a,b,c,d,e,f);
}
public static AEAxisAlignedBB fromBounds(
AxisAlignedBB bb )
final AxisAlignedBB bb )
{
return new AEAxisAlignedBB( bb.minX,
bb.minY,
+2 -2
View File
@@ -100,7 +100,7 @@ public enum AEColor
*/
public final EnumDyeColor dye;
AEColor( String unlocalizedName, EnumDyeColor dye, int blackHex, int medHex, int whiteHex )
AEColor( final String unlocalizedName, final EnumDyeColor dye, final int blackHex, final int medHex, final int whiteHex )
{
this.unlocalizedName = unlocalizedName;
this.blackVariant = blackHex;
@@ -112,7 +112,7 @@ public enum AEColor
/**
* Logic to see which colors match each other.. special handle for Transparent
*/
public boolean matches( AEColor color )
public boolean matches( final AEColor color )
{
return this == Transparent || color == Transparent || this == color;
}
@@ -51,7 +51,7 @@ public enum AEPartLocation
public static final AEPartLocation[] SIDE_LOCATIONS = {DOWN, UP, NORTH, SOUTH, WEST, EAST};
private AEPartLocation(int x, int y, int z)
private AEPartLocation( final int x, final int y, final int z)
{
xOffset = x;
yOffset = y;
@@ -61,7 +61,7 @@ public enum AEPartLocation
/**
* @return Part Location
*/
public static AEPartLocation fromOrdinal(int id)
public static AEPartLocation fromOrdinal( final int id)
{
if (id >= 0 && id < SIDE_LOCATIONS.length)
return SIDE_LOCATIONS[id];
@@ -75,7 +75,7 @@ public enum AEPartLocation
* @param side
* @return proper Part Location for a facing enum.
*/
public static AEPartLocation fromFacing(EnumFacing side)
public static AEPartLocation fromFacing( final EnumFacing side)
{
if ( side == null ) return INTERNAL;
return values()[side.ordinal()];
@@ -38,28 +38,28 @@ public class DimensionalCoord extends WorldCoord
private final World w;
private final int dimId;
public DimensionalCoord( DimensionalCoord s )
public DimensionalCoord( final DimensionalCoord s )
{
super( s.x, s.y, s.z );
this.w = s.w;
this.dimId = s.dimId;
}
public DimensionalCoord( TileEntity s )
public DimensionalCoord( final TileEntity s )
{
super( s );
this.w = s.getWorld();
this.dimId = this.w.provider.getDimensionId();
}
public DimensionalCoord( World _w, int x, int y, int z )
public DimensionalCoord( final World _w, final int x, final int y, final int z )
{
super( x,y,z );
this.w = _w;
this.dimId = _w.provider.getDimensionId();
}
public DimensionalCoord( World _w, BlockPos pos )
public DimensionalCoord( final World _w, final BlockPos pos )
{
super( pos );
this.w = _w;
@@ -79,12 +79,12 @@ public class DimensionalCoord extends WorldCoord
}
@Override
public boolean equals( Object obj )
public boolean equals( final Object obj )
{
return obj instanceof DimensionalCoord && this.isEqual( (DimensionalCoord) obj );
}
public boolean isEqual( DimensionalCoord c )
public boolean isEqual( final DimensionalCoord c )
{
return this.x == c.x && this.y == c.y && this.z == c.z && c.w == this.w;
}
@@ -95,7 +95,7 @@ public class DimensionalCoord extends WorldCoord
return "dimension=" + this.dimId + ", " + super.toString();
}
public boolean isInWorld( World world )
public boolean isInWorld( final World world )
{
return this.w == world;
}
+18 -18
View File
@@ -39,12 +39,12 @@ public class WorldCoord
public int y;
public int z;
public WorldCoord( TileEntity s )
public WorldCoord( final TileEntity s )
{
this( s.getPos() );
}
public WorldCoord( int _x, int _y, int _z )
public WorldCoord( final int _x, final int _y, final int _z )
{
this.x = _x;
this.y = _y;
@@ -52,14 +52,14 @@ public class WorldCoord
}
public WorldCoord(
BlockPos pos )
final BlockPos pos )
{
x = pos.getX();
y = pos.getY();
z = pos.getZ();
}
public WorldCoord subtract( AEPartLocation direction, int length )
public WorldCoord subtract( final AEPartLocation direction, final int length )
{
this.x -= direction.xOffset * length;
this.y -= direction.yOffset * length;
@@ -67,7 +67,7 @@ public class WorldCoord
return this;
}
public WorldCoord add( int _x, int _y, int _z )
public WorldCoord add( final int _x, final int _y, final int _z )
{
this.x += _x;
this.y += _y;
@@ -75,7 +75,7 @@ public class WorldCoord
return this;
}
public WorldCoord subtract( int _x, int _y, int _z )
public WorldCoord subtract( final int _x, final int _y, final int _z )
{
this.x -= _x;
this.y -= _y;
@@ -83,7 +83,7 @@ public class WorldCoord
return this;
}
public WorldCoord multiple( int _x, int _y, int _z )
public WorldCoord multiple( final int _x, final int _y, final int _z )
{
this.x *= _x;
this.y *= _y;
@@ -91,7 +91,7 @@ public class WorldCoord
return this;
}
public WorldCoord divide( int _x, int _y, int _z )
public WorldCoord divide( final int _x, final int _y, final int _z )
{
this.x /= _x;
this.y /= _y;
@@ -102,15 +102,15 @@ public class WorldCoord
/**
* Will Return NULL if it's at some diagonal!
*/
public AEPartLocation directionTo( WorldCoord loc )
public AEPartLocation directionTo( final WorldCoord loc )
{
int ox = this.x - loc.x;
int oy = this.y - loc.y;
int oz = this.z - loc.z;
final int ox = this.x - loc.x;
final int oy = this.y - loc.y;
final int oz = this.z - loc.z;
int xlen = Math.abs( ox );
int ylen = Math.abs( oy );
int zlen = Math.abs( oz );
final int xlen = Math.abs( ox );
final int ylen = Math.abs( oy );
final int zlen = Math.abs( oz );
if( loc.isEqual( this.copy().add( AEPartLocation.EAST, xlen ) ) )
{
@@ -145,12 +145,12 @@ public class WorldCoord
return null;
}
public boolean isEqual( WorldCoord c )
public boolean isEqual( final WorldCoord c )
{
return this.x == c.x && this.y == c.y && this.z == c.z;
}
public WorldCoord add( AEPartLocation direction, int length )
public WorldCoord add( final AEPartLocation direction, final int length )
{
this.x += direction.xOffset * length;
this.y += direction.yOffset * length;
@@ -170,7 +170,7 @@ public class WorldCoord
}
@Override
public boolean equals( Object obj )
public boolean equals( final Object obj )
{
return obj instanceof WorldCoord && this.isEqual( (WorldCoord) obj );
}