diff --git a/src/api/java/appeng/api/AEApi.java b/src/api/java/appeng/api/AEApi.java index 6185d79a..baa06a57 100644 --- a/src/api/java/appeng/api/AEApi.java +++ b/src/api/java/appeng/api/AEApi.java @@ -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." ); } diff --git a/src/api/java/appeng/api/config/AccessRestriction.java b/src/api/java/appeng/api/config/AccessRestriction.java index 9b7e4bf3..6788d744 100644 --- a/src/api/java/appeng/api/config/AccessRestriction.java +++ b/src/api/java/appeng/api/config/AccessRestriction.java @@ -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 ) ); } diff --git a/src/api/java/appeng/api/config/FuzzyMode.java b/src/api/java/appeng/api/config/FuzzyMode.java index c5f91e12..665dd551 100644 --- a/src/api/java/appeng/api/config/FuzzyMode.java +++ b/src/api/java/appeng/api/config/FuzzyMode.java @@ -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 ); } diff --git a/src/api/java/appeng/api/config/PowerMultiplier.java b/src/api/java/appeng/api/config/PowerMultiplier.java index a2029f8c..dd50e79e 100644 --- a/src/api/java/appeng/api/config/PowerMultiplier.java +++ b/src/api/java/appeng/api/config/PowerMultiplier.java @@ -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; } diff --git a/src/api/java/appeng/api/config/PowerUnits.java b/src/api/java/appeng/api/config/PowerUnits.java index c1a46be8..10345d42 100644 --- a/src/api/java/appeng/api/config/PowerUnits.java +++ b/src/api/java/appeng/api/config/PowerUnits.java @@ -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; } diff --git a/src/api/java/appeng/api/config/Settings.java b/src/api/java/appeng/api/config/Settings.java index a616276e..e031439e 100644 --- a/src/api/java/appeng/api/config/Settings.java +++ b/src/api/java/appeng/api/config/Settings.java @@ -61,7 +61,7 @@ public enum Settings private final EnumSet> values; - Settings( @Nonnull EnumSet> possibleOptions ) + Settings( @Nonnull final EnumSet> possibleOptions ) { if( possibleOptions.isEmpty() ) { diff --git a/src/api/java/appeng/api/config/Upgrades.java b/src/api/java/appeng/api/config/Upgrades.java index 88e847e3..660d4c78 100644 --- a/src/api/java/appeng/api/config/Upgrades.java +++ b/src/api/java/appeng/api/config/Upgrades.java @@ -49,7 +49,7 @@ public enum Upgrades private final int tier; private final Map 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 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 ) { diff --git a/src/api/java/appeng/api/events/LocatableEventAnnounce.java b/src/api/java/appeng/api/events/LocatableEventAnnounce.java index 8c9ad446..1f59052f 100644 --- a/src/api/java/appeng/api/events/LocatableEventAnnounce.java +++ b/src/api/java/appeng/api/events/LocatableEventAnnounce.java @@ -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; diff --git a/src/api/java/appeng/api/exceptions/AppEngException.java b/src/api/java/appeng/api/exceptions/AppEngException.java index 9734437f..478cfd77 100644 --- a/src/api/java/appeng/api/exceptions/AppEngException.java +++ b/src/api/java/appeng/api/exceptions/AppEngException.java @@ -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 ); } diff --git a/src/api/java/appeng/api/exceptions/CoreInaccessibleException.java b/src/api/java/appeng/api/exceptions/CoreInaccessibleException.java index a952bdc1..88a5725f 100644 --- a/src/api/java/appeng/api/exceptions/CoreInaccessibleException.java +++ b/src/api/java/appeng/api/exceptions/CoreInaccessibleException.java @@ -3,7 +3,7 @@ package appeng.api.exceptions; public class CoreInaccessibleException extends RuntimeException { - public CoreInaccessibleException( String message ) + public CoreInaccessibleException( final String message ) { super( message ); } diff --git a/src/api/java/appeng/api/exceptions/MissingDefinition.java b/src/api/java/appeng/api/exceptions/MissingDefinition.java index 09e05373..f920a9e9 100644 --- a/src/api/java/appeng/api/exceptions/MissingDefinition.java +++ b/src/api/java/appeng/api/exceptions/MissingDefinition.java @@ -3,7 +3,7 @@ package appeng.api.exceptions; public class MissingDefinition extends RuntimeException { - public MissingDefinition( String message ) + public MissingDefinition( final String message ) { super( message ); } diff --git a/src/api/java/appeng/api/exceptions/MissingIngredientError.java b/src/api/java/appeng/api/exceptions/MissingIngredientError.java index 842747a0..81fe40d3 100644 --- a/src/api/java/appeng/api/exceptions/MissingIngredientError.java +++ b/src/api/java/appeng/api/exceptions/MissingIngredientError.java @@ -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 ); } diff --git a/src/api/java/appeng/api/exceptions/ModNotInstalled.java b/src/api/java/appeng/api/exceptions/ModNotInstalled.java index 6f7bfa9b..a3c5eb05 100644 --- a/src/api/java/appeng/api/exceptions/ModNotInstalled.java +++ b/src/api/java/appeng/api/exceptions/ModNotInstalled.java @@ -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 ); } diff --git a/src/api/java/appeng/api/exceptions/RecipeError.java b/src/api/java/appeng/api/exceptions/RecipeError.java index 1973f348..d4d6f90a 100644 --- a/src/api/java/appeng/api/exceptions/RecipeError.java +++ b/src/api/java/appeng/api/exceptions/RecipeError.java @@ -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 ); } diff --git a/src/api/java/appeng/api/exceptions/RegistrationError.java b/src/api/java/appeng/api/exceptions/RegistrationError.java index f3d2bdd0..205df3e9 100644 --- a/src/api/java/appeng/api/exceptions/RegistrationError.java +++ b/src/api/java/appeng/api/exceptions/RegistrationError.java @@ -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 ); } diff --git a/src/api/java/appeng/api/implementations/TransitionResult.java b/src/api/java/appeng/api/implementations/TransitionResult.java index e9896874..9eec763e 100644 --- a/src/api/java/appeng/api/implementations/TransitionResult.java +++ b/src/api/java/appeng/api/implementations/TransitionResult.java @@ -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; diff --git a/src/api/java/appeng/api/networking/events/MENetworkChannelChanged.java b/src/api/java/appeng/api/networking/events/MENetworkChannelChanged.java index 1ddee58d..b8663114 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkChannelChanged.java +++ b/src/api/java/appeng/api/networking/events/MENetworkChannelChanged.java @@ -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; } diff --git a/src/api/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java b/src/api/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java index 34a95c64..4a92e28c 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java +++ b/src/api/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java @@ -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; } diff --git a/src/api/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java b/src/api/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java index 8e064265..77b6a2e3 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java +++ b/src/api/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java @@ -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; diff --git a/src/api/java/appeng/api/networking/events/MENetworkEvent.java b/src/api/java/appeng/api/networking/events/MENetworkEvent.java index 638f6332..4c50e59d 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkEvent.java +++ b/src/api/java/appeng/api/networking/events/MENetworkEvent.java @@ -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; } diff --git a/src/api/java/appeng/api/networking/events/MENetworkPowerIdleChange.java b/src/api/java/appeng/api/networking/events/MENetworkPowerIdleChange.java index 5af71e2c..a9000064 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkPowerIdleChange.java +++ b/src/api/java/appeng/api/networking/events/MENetworkPowerIdleChange.java @@ -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; } diff --git a/src/api/java/appeng/api/networking/events/MENetworkPowerStorage.java b/src/api/java/appeng/api/networking/events/MENetworkPowerStorage.java index 932a05bf..0afde8d8 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkPowerStorage.java +++ b/src/api/java/appeng/api/networking/events/MENetworkPowerStorage.java @@ -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; diff --git a/src/api/java/appeng/api/networking/events/MENetworkSpatialEvent.java b/src/api/java/appeng/api/networking/events/MENetworkSpatialEvent.java index 82a2a7ba..ea666a12 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkSpatialEvent.java +++ b/src/api/java/appeng/api/networking/events/MENetworkSpatialEvent.java @@ -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; diff --git a/src/api/java/appeng/api/networking/events/MENetworkStorageEvent.java b/src/api/java/appeng/api/networking/events/MENetworkStorageEvent.java index e83fa826..60f159c5 100644 --- a/src/api/java/appeng/api/networking/events/MENetworkStorageEvent.java +++ b/src/api/java/appeng/api/networking/events/MENetworkStorageEvent.java @@ -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; diff --git a/src/api/java/appeng/api/networking/security/MachineSource.java b/src/api/java/appeng/api/networking/security/MachineSource.java index a01b5474..40a46536 100644 --- a/src/api/java/appeng/api/networking/security/MachineSource.java +++ b/src/api/java/appeng/api/networking/security/MachineSource.java @@ -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; } diff --git a/src/api/java/appeng/api/networking/security/PlayerSource.java b/src/api/java/appeng/api/networking/security/PlayerSource.java index 49442bc1..fc6cb37e 100644 --- a/src/api/java/appeng/api/networking/security/PlayerSource.java +++ b/src/api/java/appeng/api/networking/security/PlayerSource.java @@ -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; diff --git a/src/api/java/appeng/api/networking/ticking/TickingRequest.java b/src/api/java/appeng/api/networking/ticking/TickingRequest.java index 6a94f252..d14cab92 100644 --- a/src/api/java/appeng/api/networking/ticking/TickingRequest.java +++ b/src/api/java/appeng/api/networking/ticking/TickingRequest.java @@ -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; diff --git a/src/api/java/appeng/api/parts/CableRenderMode.java b/src/api/java/appeng/api/parts/CableRenderMode.java index abe5e707..d9e80bfc 100644 --- a/src/api/java/appeng/api/parts/CableRenderMode.java +++ b/src/api/java/appeng/api/parts/CableRenderMode.java @@ -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; diff --git a/src/api/java/appeng/api/parts/LayerBase.java b/src/api/java/appeng/api/parts/LayerBase.java index d763632d..c1c82bfd 100644 --- a/src/api/java/appeng/api/parts/LayerBase.java +++ b/src/api/java/appeng/api/parts/LayerBase.java @@ -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. } diff --git a/src/api/java/appeng/api/parts/SelectedPart.java b/src/api/java/appeng/api/parts/SelectedPart.java index 253d213a..eade33c8 100644 --- a/src/api/java/appeng/api/parts/SelectedPart.java +++ b/src/api/java/appeng/api/parts/SelectedPart.java @@ -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; diff --git a/src/api/java/appeng/api/recipes/ResolverResult.java b/src/api/java/appeng/api/recipes/ResolverResult.java index 879efab5..51405576 100644 --- a/src/api/java/appeng/api/recipes/ResolverResult.java +++ b/src/api/java/appeng/api/recipes/ResolverResult.java @@ -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; diff --git a/src/api/java/appeng/api/recipes/ResolverResultSet.java b/src/api/java/appeng/api/recipes/ResolverResultSet.java index 884b0f10..7705d830 100644 --- a/src/api/java/appeng/api/recipes/ResolverResultSet.java +++ b/src/api/java/appeng/api/recipes/ResolverResultSet.java @@ -36,7 +36,7 @@ public class ResolverResultSet public final String name; public final List results; - public ResolverResultSet( String myName, ItemStack... set ) + public ResolverResultSet( final String myName, final ItemStack... set ) { this.results = Arrays.asList( set ); this.name = myName; diff --git a/src/api/java/appeng/api/storage/MEMonitorHandler.java b/src/api/java/appeng/api/storage/MEMonitorHandler.java index 10ac963f..217978b3 100644 --- a/src/api/java/appeng/api/storage/MEMonitorHandler.java +++ b/src/api/java/appeng/api/storage/MEMonitorHandler.java @@ -52,32 +52,32 @@ public class MEMonitorHandler implements IMEMonitor< protected boolean hasChanged = true; - public MEMonitorHandler( IMEInventoryHandler t ) + public MEMonitorHandler( final IMEInventoryHandler t ) { this.internalHandler = t; this.cachedList = t.getChannel().createList(); } - public MEMonitorHandler( IMEInventoryHandler t, StorageChannel chan ) + public MEMonitorHandler( final IMEInventoryHandler t, final StorageChannel chan ) { this.internalHandler = t; this.cachedList = chan.createList(); } @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { this.listeners.put( l, verificationToken ); } @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver 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 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 implements IMEMonitor< return leftOvers; } - protected void postChangesToListeners( Iterable changes, BaseActionSource src ) + protected void postChangesToListeners( final Iterable changes, final BaseActionSource src ) { this.notifyListenersOfChange( changes, src ); } - protected void notifyListenersOfChange( Iterable diff, BaseActionSource src ) + protected void notifyListenersOfChange( final Iterable diff, final BaseActionSource src ) { this.hasChanged = true;// need to update the cache. - Iterator, Object>> i = this.getListeners(); + final Iterator, Object>> i = this.getListeners(); while( i.hasNext() ) { - Entry, Object> o = i.next(); - IMEMonitorHandlerReceiver receiver = o.getKey(); + final Entry, Object> o = i.next(); + final IMEMonitorHandlerReceiver receiver = o.getKey(); if( receiver.isValid( o.getValue() ) ) { receiver.postChange( this, diff, src ); @@ -142,7 +142,7 @@ public class MEMonitorHandler 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 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 getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return this.getHandler().getAvailableItems( out ); } @@ -203,7 +203,7 @@ public class MEMonitorHandler implements IMEMonitor< } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return this.getHandler().validForPass( i ); } diff --git a/src/api/java/appeng/api/storage/StorageChannel.java b/src/api/java/appeng/api/storage/StorageChannel.java index e0bd3789..2e57310f 100644 --- a/src/api/java/appeng/api/storage/StorageChannel.java +++ b/src/api/java/appeng/api/storage/StorageChannel.java @@ -45,7 +45,7 @@ public enum StorageChannel public final Class type; - StorageChannel( Class t ) + StorageChannel( final Class t ) { this.type = t; } diff --git a/src/api/java/appeng/api/util/AEAxisAlignedBB.java b/src/api/java/appeng/api/util/AEAxisAlignedBB.java index fb55e6ae..6b36252a 100644 --- a/src/api/java/appeng/api/util/AEAxisAlignedBB.java +++ b/src/api/java/appeng/api/util/AEAxisAlignedBB.java @@ -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, diff --git a/src/api/java/appeng/api/util/AEColor.java b/src/api/java/appeng/api/util/AEColor.java index 873c8513..b7fa2197 100644 --- a/src/api/java/appeng/api/util/AEColor.java +++ b/src/api/java/appeng/api/util/AEColor.java @@ -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; } diff --git a/src/api/java/appeng/api/util/AEPartLocation.java b/src/api/java/appeng/api/util/AEPartLocation.java index d25a9345..9364d6f7 100644 --- a/src/api/java/appeng/api/util/AEPartLocation.java +++ b/src/api/java/appeng/api/util/AEPartLocation.java @@ -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()]; diff --git a/src/api/java/appeng/api/util/DimensionalCoord.java b/src/api/java/appeng/api/util/DimensionalCoord.java index 90008e00..fddcb4c0 100644 --- a/src/api/java/appeng/api/util/DimensionalCoord.java +++ b/src/api/java/appeng/api/util/DimensionalCoord.java @@ -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; } diff --git a/src/api/java/appeng/api/util/WorldCoord.java b/src/api/java/appeng/api/util/WorldCoord.java index 5e6bf5ab..0d207018 100644 --- a/src/api/java/appeng/api/util/WorldCoord.java +++ b/src/api/java/appeng/api/util/WorldCoord.java @@ -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 ); } diff --git a/src/main/java/appeng/block/AEBaseBlock.java b/src/main/java/appeng/block/AEBaseBlock.java index 3f9b2d0b..0fe49df4 100644 --- a/src/main/java/appeng/block/AEBaseBlock.java +++ b/src/main/java/appeng/block/AEBaseBlock.java @@ -93,7 +93,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return isOpaque && isFullSize; } - protected AEBaseBlock( Material mat ) + protected AEBaseBlock( final Material mat ) { this( mat, Optional.absent() ); this.setLightOpacity( 255 ); @@ -102,7 +102,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature this.setHarvestLevel( "pickaxe", 0 ); } - protected AEBaseBlock( Material mat, Optional subName ) + protected AEBaseBlock( final Material mat, final Optional subName ) { super( mat ); @@ -144,9 +144,9 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override final public IBlockState getExtendedState( - IBlockState state, - IBlockAccess world, - BlockPos pos ) + final IBlockState state, + final IBlockAccess world, + final BlockPos pos ) { return ((IExtendedBlockState)super.getExtendedState( state, world, pos ) ).withProperty( AE_BLOCK_POS, pos ).withProperty( AE_BLOCK_ACCESS, world ); } @@ -166,18 +166,18 @@ public abstract class AEBaseBlock extends Block implements IAEFeature try { - Class re = this.getRenderer(); + final Class re = this.getRenderer(); if ( re == null ) return null; // use 1.8 models. final BaseBlockRender renderer = re.newInstance(); this.renderInfo = new BlockRenderInfo( renderer ); return this.renderInfo; } - catch( InstantiationException e ) + catch( final InstantiationException e ) { throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( "Failed to create a new instance of " + this.getRenderer() + " because of permissions.", e ); } @@ -185,9 +185,9 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override public int colorMultiplier( - IBlockAccess worldIn, - BlockPos pos, - int colorTint ) + final IBlockAccess worldIn, + final BlockPos pos, + final int colorTint ) { return colorTint; } @@ -198,7 +198,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return BaseBlockRender.class; } - protected void setFeature( EnumSet f ) + protected void setFeature( final EnumSet f ) { final AEBlockFeatureHandler featureHandler = new AEBlockFeatureHandler( f, this, this.featureSubName ); this.setHandler( featureHandler ); @@ -210,7 +210,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return this.handler; } - protected final void setHandler( IFeatureHandler handler ) + protected final void setHandler( final IFeatureHandler handler ) { this.handler = handler; } @@ -232,7 +232,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return this.isFullSize && this.isOpaque; } - protected ICustomCollision getCustomCollision( World w, BlockPos pos ) + protected ICustomCollision getCustomCollision( final World w, final BlockPos pos ) { if( this instanceof ICustomCollision ) { @@ -242,10 +242,10 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @SideOnly( Side.CLIENT ) - public IAESprite getIcon( IBlockAccess w, BlockPos pos, EnumFacing side ) + public IAESprite getIcon( final IBlockAccess w, final BlockPos pos, final EnumFacing side ) { - IBlockState state =w.getBlockState( pos ); - IOrientable ori = getOrientable( w, pos ); + final IBlockState state =w.getBlockState( pos ); + final IOrientable ori = getOrientable( w, pos ); if ( ori == null ) return getIcon( side,state ); @@ -254,29 +254,29 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @SideOnly( Side.CLIENT ) - public IAESprite getIcon( EnumFacing side, IBlockState state ) + public IAESprite getIcon( final EnumFacing side, final IBlockState state ) { return this.getRendererInstance().getTexture( AEPartLocation.fromFacing( side ) ); } @Override public void addCollisionBoxesToList( - World w, - BlockPos pos, - IBlockState state, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final IBlockState state, + final AxisAlignedBB bb, + final List out, + final Entity e ) { final ICustomCollision collisionHandler = this.getCustomCollision( w, pos ); if( collisionHandler != null && bb != null ) { - List tmp = new ArrayList(); + final List tmp = new ArrayList(); collisionHandler.addCollidingBlockToList( w, pos, bb, tmp, e ); - for( AxisAlignedBB b : tmp ) + for( final AxisAlignedBB b : tmp ) { - AxisAlignedBB offset = b.offset( pos.getX(), pos.getY(), pos.getZ() ); + final AxisAlignedBB offset = b.offset( pos.getX(), pos.getY(), pos.getZ() ); if( bb.intersectsWith( offset ) ) { out.add( offset ); @@ -292,8 +292,8 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override @SideOnly( Side.CLIENT ) public AxisAlignedBB getSelectedBoundingBox( - World w, - BlockPos pos ) + final World w, + final BlockPos pos ) { final ICustomCollision collisionHandler = this.getCustomCollision( w, pos ); @@ -309,11 +309,11 @@ public abstract class AEBaseBlock extends Block implements IAEFeature double lastDist = 0; - for( AxisAlignedBB bb : bbs ) + for( final AxisAlignedBB bb : bbs ) { this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ ); - MovingObjectPosition r = super.collisionRayTrace( w, pos, ld.a, ld.b ); + final MovingObjectPosition r = super.collisionRayTrace( w, pos, ld.a, ld.b ); this.setBlockBounds( 0, 0, 0, 1, 1, 1 ); @@ -342,7 +342,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature AxisAlignedBB b = null; // new AxisAlignedBB( 16d, 16d, 16d, 0d, 0d, 0d ); - for( AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, null, false ) ) + for( final AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, null, false ) ) { if ( b == null ) { @@ -379,10 +379,10 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override public MovingObjectPosition collisionRayTrace( - World w, - BlockPos pos, - Vec3 a, - Vec3 b ) + final World w, + final BlockPos pos, + final Vec3 a, + final Vec3 b ) { final ICustomCollision collisionHandler = this.getCustomCollision( w, pos ); @@ -393,21 +393,21 @@ public abstract class AEBaseBlock extends Block implements IAEFeature double lastDist = 0; - for( AxisAlignedBB bb : bbs ) + for( final AxisAlignedBB bb : bbs ) { this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ ); - MovingObjectPosition r = super.collisionRayTrace( w, pos, a, b ); + final MovingObjectPosition r = super.collisionRayTrace( w, pos, a, b ); this.setBlockBounds( 0, 0, 0, 1, 1, 1 ); if( r != null ) { - double xLen = ( a.xCoord - r.hitVec.xCoord ); - double yLen = ( a.yCoord - r.hitVec.yCoord ); - double zLen = ( a.zCoord - r.hitVec.zCoord ); + final double xLen = ( a.xCoord - r.hitVec.xCoord ); + final double yLen = ( a.yCoord - r.hitVec.yCoord ); + final double zLen = ( a.zCoord - r.hitVec.zCoord ); - double thisDist = xLen * xLen + yLen * yLen + zLen * zLen; + final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen; if( br == null || lastDist > thisDist ) { lastDist = thisDist; @@ -428,7 +428,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return super.collisionRayTrace( w, pos, a, b ); } - public boolean onActivated( World w, BlockPos pos, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumFacing side, final float hitX, final float hitY, final float hitZ ) { return false; } @@ -436,7 +436,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override @SideOnly( Side.CLIENT ) @SuppressWarnings( "unchecked" ) - public final void getSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { this.getCheckedSubBlocks( item, tabs, itemStacks ); } @@ -449,21 +449,21 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override public int getComparatorInputOverride( - World worldIn, - BlockPos pos ) + final World worldIn, + final BlockPos pos ) { return 0; } @Override public boolean isNormalCube( - IBlockAccess world, - BlockPos pos ) + final IBlockAccess world, + final BlockPos pos ) { return this.isFullSize; } - public IOrientable getOrientable( IBlockAccess w, BlockPos pos ) + public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos ) { if( this instanceof IOrientableBlock ) { @@ -474,9 +474,9 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @Override public boolean rotateBlock( - World w, - BlockPos pos, - EnumFacing axis ) + final World w, + final BlockPos pos, + final EnumFacing axis ) { final IOrientable rotatable = this.getOrientable( w, pos ); @@ -514,40 +514,40 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return false; } - protected void customRotateBlock( IOrientable rotatable, EnumFacing axis ) + protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis ) { } - public boolean isValidOrientation( World w, BlockPos pos, EnumFacing forward, EnumFacing up ) + public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up ) { return true; } @Override - public EnumFacing[] getValidRotations( World w, BlockPos pos ) + public EnumFacing[] getValidRotations( final World w, final BlockPos pos ) { return new EnumFacing[0]; } @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { super.getSubBlocks( item, tabs, itemStacks ); } @SideOnly( Side.CLIENT ) - public void setRenderStateByMeta( int itemDamage ) + public void setRenderStateByMeta( final int itemDamage ) { } - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { return this.getUnlocalizedName(); } - public void addInformation( ItemStack is, EntityPlayer player, List lines, boolean advancedItemTooltips ) + public void addInformation( final ItemStack is, final EntityPlayer player, final List lines, final boolean advancedItemTooltips ) { } @@ -563,8 +563,8 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } public EnumFacing mapRotation( - IOrientable ori, - EnumFacing dir ) + final IOrientable ori, + final EnumFacing dir ) { // case DOWN: return bottomIcon; // case UP: return blockIcon; @@ -581,12 +581,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature return dir; } - int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY(); - int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ(); - int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX(); + final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY(); + final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ(); + final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX(); EnumFacing west = null; - for( EnumFacing dx : EnumFacing.VALUES ) + for( final EnumFacing dx : EnumFacing.VALUES ) { if( dx.getFrontOffsetX() == west_x && dx.getFrontOffsetY() == west_y && dx.getFrontOffsetZ() == west_z ) { @@ -629,8 +629,8 @@ public abstract class AEBaseBlock extends Block implements IAEFeature @SideOnly( Side.CLIENT ) public void registerBlockIcons( - TextureMap clientHelper, - String name ) + final TextureMap clientHelper, + final String name ) { final BlockRenderInfo info = this.getRendererInstance(); final FlippableIcon topIcon; @@ -647,7 +647,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature } @SideOnly( Side.CLIENT ) - private FlippableIcon optionalIcon( TextureMap ir, String name, IAESprite substitute ) + private FlippableIcon optionalIcon( final TextureMap ir, final String name, IAESprite substitute ) { // if the input is an flippable IAESprite find the original. while( substitute instanceof FlippableIcon ) @@ -659,26 +659,26 @@ public abstract class AEBaseBlock extends Block implements IAEFeature { try { - ResourceLocation resLoc = new ResourceLocation( AppEng.MOD_ID, String.format( "%s/%s%s", "textures/blocks", name, ".png" ) ); + final ResourceLocation resLoc = new ResourceLocation( AppEng.MOD_ID, String.format( "%s/%s%s", "textures/blocks", name, ".png" ) ); - IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc ); + final IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc ); if( res != null ) { return new FlippableIcon( new BaseIcon( ir.registerSprite( new ResourceLocation(AppEng.MOD_ID, "blocks/" + name ) ) ) ); } } - catch( Throwable e ) + catch( final Throwable e ) { return new FlippableIcon( substitute ); } } - ResourceLocation resLoc = new ResourceLocation(AppEng.MOD_ID, "blocks/" + name ); + final ResourceLocation resLoc = new ResourceLocation(AppEng.MOD_ID, "blocks/" + name ); return new FlippableIcon(new BaseIcon( ir.registerSprite( resLoc ) ) ); } String textureName; - public void setBlockTextureName( String texture ) + public void setBlockTextureName( final String texture ) { textureName = texture; } diff --git a/src/main/java/appeng/block/AEBaseItemBlock.java b/src/main/java/appeng/block/AEBaseItemBlock.java index d9b086d6..be7ffa11 100644 --- a/src/main/java/appeng/block/AEBaseItemBlock.java +++ b/src/main/java/appeng/block/AEBaseItemBlock.java @@ -46,7 +46,7 @@ public class AEBaseItemBlock extends ItemBlock private final AEBaseBlock blockType; - public AEBaseItemBlock( Block id ) + public AEBaseItemBlock( final Block id ) { super( id ); this.blockType = (AEBaseBlock) id; @@ -54,7 +54,7 @@ public class AEBaseItemBlock extends ItemBlock } @Override - public int getMetadata( int dmg ) + public int getMetadata( final int dmg ) { if( this.hasSubtypes ) { @@ -66,40 +66,40 @@ public class AEBaseItemBlock extends ItemBlock @Override @SideOnly( Side.CLIENT ) @SuppressWarnings( "unchecked" ) - public final void addInformation( ItemStack itemStack, EntityPlayer player, List toolTip, boolean advancedTooltips ) + public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips ) { this.addCheckedInformation( itemStack, player, toolTip, advancedTooltips ); } @SideOnly( Side.CLIENT ) - public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List toolTip, boolean advancedToolTips ) + public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedToolTips ) { this.blockType.addInformation( itemStack, player, toolTip, advancedToolTips ); } @Override - public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 ) + public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack itemstack2 ) { return false; } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { return this.blockType.getUnlocalizedName( is ); } @Override public boolean placeBlockAt( - ItemStack stack, - EntityPlayer player, - World w, - BlockPos pos, - EnumFacing side, - float hitX, - float hitY, - float hitZ, - IBlockState newState ) + final ItemStack stack, + final EntityPlayer player, + final World w, + final BlockPos pos, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ, + final IBlockState newState ) { EnumFacing up = null; EnumFacing forward = null; @@ -134,7 +134,7 @@ public class AEBaseItemBlock extends ItemBlock { up = EnumFacing.UP; - byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 ); + final byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 ); switch( rotation ) { @@ -187,7 +187,7 @@ public class AEBaseItemBlock extends ItemBlock { if( this.blockType instanceof AEBaseTileBlock && !( this.blockType instanceof BlockLightDetector ) ) { - AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, pos ); + final AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, pos ); ori = tile; if( tile == null ) diff --git a/src/main/java/appeng/block/AEBaseItemBlockChargeable.java b/src/main/java/appeng/block/AEBaseItemBlockChargeable.java index 2b7f8a71..d2850e49 100644 --- a/src/main/java/appeng/block/AEBaseItemBlockChargeable.java +++ b/src/main/java/appeng/block/AEBaseItemBlockChargeable.java @@ -40,18 +40,18 @@ import appeng.util.Platform; public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEItemPowerStorage { - public AEBaseItemBlockChargeable( Block id ) + public AEBaseItemBlockChargeable( final Block id ) { super( id ); } @Override @SideOnly( Side.CLIENT ) - public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List toolTip, boolean advancedTooltips ) + public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips ) { final NBTTagCompound tag = itemStack.getTagCompound(); double internalCurrentPower = 0; - double internalMaxPower = this.getMaxEnergyCapacity(); + final double internalMaxPower = this.getMaxEnergyCapacity(); if( tag != null ) { @@ -67,7 +67,7 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte { final Block blockID = Block.getBlockFromItem( this ); final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell(); - for( Block block : energyCell.maybeBlock().asSet() ) + for( final Block block : energyCell.maybeBlock().asSet() ) { if( blockID == block ) { @@ -83,10 +83,10 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte } @Override - public double injectAEPower( ItemStack is, double amt ) + public double injectAEPower( final ItemStack is, double amt ) { double internalCurrentPower = this.getInternal( is ); - double internalMaxPower = this.getMaxEnergyCapacity(); + final double internalMaxPower = this.getMaxEnergyCapacity(); internalCurrentPower += amt; if( internalCurrentPower > internalMaxPower ) { @@ -100,20 +100,20 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte return 0; } - private double getInternal( ItemStack is ) + private double getInternal( final ItemStack is ) { final NBTTagCompound nbt = Platform.openNbtData( is ); return nbt.getDouble( "internalCurrentPower" ); } - private void setInternal( ItemStack is, double amt ) + private void setInternal( final ItemStack is, final double amt ) { final NBTTagCompound nbt = Platform.openNbtData( is ); nbt.setDouble( "internalCurrentPower", amt ); } @Override - public double extractAEPower( ItemStack is, double amt ) + public double extractAEPower( final ItemStack is, double amt ) { double internalCurrentPower = this.getInternal( is ); if( internalCurrentPower > amt ) @@ -129,19 +129,19 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte } @Override - public double getAEMaxPower( ItemStack is ) + public double getAEMaxPower( final ItemStack is ) { return this.getMaxEnergyCapacity(); } @Override - public double getAECurrentPower( ItemStack is ) + public double getAECurrentPower( final ItemStack is ) { return this.getInternal( is ); } @Override - public AccessRestriction getPowerFlow( ItemStack is ) + public AccessRestriction getPowerFlow( final ItemStack is ) { return AccessRestriction.WRITE; } diff --git a/src/main/java/appeng/block/AEBaseStairBlock.java b/src/main/java/appeng/block/AEBaseStairBlock.java index 900e8648..5400a853 100644 --- a/src/main/java/appeng/block/AEBaseStairBlock.java +++ b/src/main/java/appeng/block/AEBaseStairBlock.java @@ -37,7 +37,7 @@ public abstract class AEBaseStairBlock extends BlockStairs implements IAEFeature { private final IFeatureHandler features; - protected AEBaseStairBlock( Block block, EnumSet features, String type ) + protected AEBaseStairBlock( final Block block, final EnumSet features, final String type ) { super( block.getStateFromMeta( 0 ) ); diff --git a/src/main/java/appeng/block/AEBaseTileBlock.java b/src/main/java/appeng/block/AEBaseTileBlock.java index e944432f..85bb67bd 100644 --- a/src/main/java/appeng/block/AEBaseTileBlock.java +++ b/src/main/java/appeng/block/AEBaseTileBlock.java @@ -71,24 +71,24 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, @Nonnull private Class tileEntityType; - public AEBaseTileBlock( Material mat ) + public AEBaseTileBlock( final Material mat ) { super( mat ); } - protected AEBaseTileBlock( Material mat, Optional subName ) + protected AEBaseTileBlock( final Material mat, final Optional subName ) { super( mat, subName ); } @Override - protected void setFeature( EnumSet f ) + protected void setFeature( final EnumSet f ) { final AETileBlockFeatureHandler featureHandler = new AETileBlockFeatureHandler( f, this, this.featureSubName ); this.setHandler( featureHandler ); } - protected void setTileEntity( Class c ) + protected void setTileEntity( final Class c ) { this.tileEntityType = c; this.isInventory = IInventory.class.isAssignableFrom( c ); @@ -97,7 +97,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, // update Block value. - private void setTileProvider( boolean b ) + private void setTileProvider( final boolean b ) { ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" ); } @@ -113,13 +113,13 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Nullable - public T getTileEntity( IBlockAccess w, int x, int y, int z ) + public T getTileEntity( final IBlockAccess w, final int x, final int y, final int z ) { return getTileEntity( w, new BlockPos(x,y,z) ); } @Nullable - public T getTileEntity( IBlockAccess w, BlockPos pos ) + public T getTileEntity( final IBlockAccess w, final BlockPos pos ) { if( !this.hasBlockTileEntity() ) { @@ -136,7 +136,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public final TileEntity createNewTileEntity( World var1, int var2 ) + public final TileEntity createNewTileEntity( final World var1, final int var2 ) { if( this.hasBlockTileEntity() ) { @@ -144,11 +144,11 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, { return this.tileEntityType.newInstance(); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType, e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e ); } @@ -159,9 +159,9 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, @Override public void breakBlock( - World w, - BlockPos pos, - IBlockState state ) + final World w, + final BlockPos pos, + final IBlockState state ) { final AEBaseTile te = this.getTileEntity( w,pos ); if( te != null ) @@ -185,7 +185,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public final EnumFacing[] getValidRotations( World w, BlockPos pos ) + public final EnumFacing[] getValidRotations( final World w, final BlockPos pos ) { final AEBaseTile obj = this.getTileEntity( w, pos ); if( obj != null && obj.canBeRotated() ) @@ -198,10 +198,10 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, @Override public boolean recolorBlock( - World world, - BlockPos pos, - EnumFacing side, - EnumDyeColor color ) + final World world, + final BlockPos pos, + final EnumFacing side, + final EnumDyeColor color ) { final TileEntity te = this.getTileEntity( world, pos ); @@ -224,8 +224,8 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, @Override public int getComparatorInputOverride( - World w, - BlockPos pos ) + final World w, + final BlockPos pos ) { final TileEntity te = this.getTileEntity( w, pos ); if( te instanceof IInventory ) @@ -237,11 +237,11 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, @Override public boolean onBlockEventReceived( - World worldIn, - BlockPos pos, - IBlockState state, - int eventID, - int eventParam ) + final World worldIn, + final BlockPos pos, + final IBlockState state, + final int eventID, + final int eventParam ) { super.onBlockEventReceived( worldIn, pos, state ,eventID, eventParam); final TileEntity tileentity = worldIn.getTileEntity( pos ); @@ -250,11 +250,11 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, @Override public void onBlockPlacedBy( - World w, - BlockPos pos, - IBlockState state, - EntityLivingBase placer, - ItemStack is ) + final World w, + final BlockPos pos, + final IBlockState state, + final EntityLivingBase placer, + final ItemStack is ) { if( is.hasDisplayName() ) { @@ -268,14 +268,14 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, @Override public boolean onBlockActivated( - World w, - BlockPos pos, - IBlockState state, - EntityPlayer player, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final IBlockState state, + final EntityPlayer player, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( player != null ) { @@ -301,7 +301,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } final ItemStack op = new ItemStack( this ); - for( ItemStack ol : drops ) + for( final ItemStack ol : drops ) { if( Platform.isSameItemType( ol, op ) ) { @@ -365,13 +365,13 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, } @Override - public IOrientable getOrientable( IBlockAccess w, BlockPos pos ) + public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos ) { return this.getTileEntity( w, pos ); } @Override - public ICustomCollision getCustomCollision( World w, BlockPos pos ) + public ICustomCollision getCustomCollision( final World w, final BlockPos pos ) { final AEBaseTile te = this.getTileEntity( w, pos ); if( te instanceof ICustomCollision ) diff --git a/src/main/java/appeng/block/AEDecorativeBlock.java b/src/main/java/appeng/block/AEDecorativeBlock.java index d6f5dc52..3a554d71 100644 --- a/src/main/java/appeng/block/AEDecorativeBlock.java +++ b/src/main/java/appeng/block/AEDecorativeBlock.java @@ -24,7 +24,7 @@ import net.minecraft.block.material.Material; public abstract class AEDecorativeBlock extends AEBaseBlock { - public AEDecorativeBlock( Material mat ) + public AEDecorativeBlock( final Material mat ) { super( mat ); } diff --git a/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java b/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java index 16836a4c..b7e8164c 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java @@ -53,12 +53,12 @@ public class BlockCraftingMonitor extends BlockCraftingUnit @Override public IAESprite getIcon( - EnumFacing side, - IBlockState state ) + final EnumFacing side, + final IBlockState state ) { if( side != EnumFacing.SOUTH ) { - for( Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() ) + for( final Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() ) { return ( (BlockCraftingUnit)craftingUnitBlock ).getIcon( side, state ); } @@ -69,7 +69,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { itemStacks.add( new ItemStack( this, 1, 0 ) ); } diff --git a/src/main/java/appeng/block/crafting/BlockCraftingStorage.java b/src/main/java/appeng/block/crafting/BlockCraftingStorage.java index dbab1bc4..8f6caef4 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingStorage.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingStorage.java @@ -33,7 +33,7 @@ import appeng.tile.crafting.TileCraftingStorageTile; public class BlockCraftingStorage extends BlockCraftingUnit { - public BlockCraftingStorage( CraftingUnitType type ) + public BlockCraftingStorage( final CraftingUnitType type ) { super(type ); this.setTileEntity( TileCraftingStorageTile.class ); @@ -46,9 +46,9 @@ public class BlockCraftingStorage extends BlockCraftingUnit } @Override - public appeng.client.texture.IAESprite getIcon(net.minecraft.util.EnumFacing side, net.minecraft.block.state.IBlockState state) + public appeng.client.texture.IAESprite getIcon( final net.minecraft.util.EnumFacing side, final net.minecraft.block.state.IBlockState state) { - boolean formed = (boolean)state.getValue( FORMED ); + final boolean formed = (boolean)state.getValue( FORMED ); switch( this.type ) { default: @@ -74,7 +74,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { itemStacks.add( new ItemStack( this, 1, 0 ) ); itemStacks.add( new ItemStack( this, 1, 1 ) ); @@ -83,7 +83,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { if( is.getItemDamage() == 1 ) { diff --git a/src/main/java/appeng/block/crafting/BlockCraftingUnit.java b/src/main/java/appeng/block/crafting/BlockCraftingUnit.java index aa9cc3bd..0e4752a3 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingUnit.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingUnit.java @@ -61,7 +61,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock final public CraftingUnitType type; - public BlockCraftingUnit( CraftingUnitType type ) + public BlockCraftingUnit( final CraftingUnitType type ) { super( Material.iron, Optional.of( type.name() ) ); @@ -71,23 +71,23 @@ public class BlockCraftingUnit extends AEBaseTileBlock } @Override - public IBlockState getStateFromMeta( int meta ) + public IBlockState getStateFromMeta( final int meta ) { return getDefaultState().withProperty( POWERED, ( meta & 1 ) == 1 ).withProperty( FORMED, ( meta & 2 ) == 2 ); } @Override - public int getMetaFromState( IBlockState state ) + public int getMetaFromState( final IBlockState state ) { - boolean p = (boolean) state.getValue( POWERED ); - boolean f = (boolean) state.getValue( FORMED ); + final boolean p = (boolean) state.getValue( POWERED ); + final boolean f = (boolean) state.getValue( FORMED ); return ( p ? 1 : 0 ) | ( f ? 2 : 0 ); } @Override - public void onNeighborBlockChange( World worldIn, BlockPos pos, IBlockState state, Block neighborBlock ) + public void onNeighborBlockChange( final World worldIn, final BlockPos pos, final IBlockState state, final Block neighborBlock ) { - TileCraftingTile cp = this.getTileEntity( worldIn, pos ); + final TileCraftingTile cp = this.getTileEntity( worldIn, pos ); if( cp != null ) { cp.updateMultiBlock(); @@ -101,9 +101,9 @@ public class BlockCraftingUnit extends AEBaseTileBlock } @Override - public void breakBlock( World w, BlockPos pos, IBlockState state ) + public void breakBlock( final World w, final BlockPos pos, final IBlockState state ) { - TileCraftingTile cp = this.getTileEntity( w, pos ); + final TileCraftingTile cp = this.getTileEntity( w, pos ); if( cp != null ) { cp.breakCluster(); @@ -113,9 +113,9 @@ public class BlockCraftingUnit extends AEBaseTileBlock } @Override - public boolean onBlockActivated( World w, BlockPos pos, IBlockState state, EntityPlayer p, EnumFacing side, float hitX, float hitY, float hitZ ) + public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumFacing side, final float hitX, final float hitY, final float hitZ ) { - TileCraftingTile tg = this.getTileEntity( w, pos ); + final TileCraftingTile tg = this.getTileEntity( w, pos ); if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() ) { if( Platform.isClient() ) @@ -130,7 +130,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock return false; } - protected String getItemUnlocalizedName( ItemStack is ) + protected String getItemUnlocalizedName( final ItemStack is ) { return super.getUnlocalizedName( is ); } @@ -151,7 +151,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock } @Override - public appeng.client.texture.IAESprite getIcon( EnumFacing side, IBlockState state ) + public appeng.client.texture.IAESprite getIcon( final EnumFacing side, final IBlockState state ) { if( type == CraftingUnitType.ACCELERATOR ) { @@ -173,14 +173,14 @@ public class BlockCraftingUnit extends AEBaseTileBlock @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { itemStacks.add( new ItemStack( this, 1, 0 ) ); itemStacks.add( new ItemStack( this, 1, 1 ) ); } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { if( is.getItemDamage() == 1 ) { diff --git a/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java b/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java index e4d39c9e..9611e8dd 100644 --- a/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java +++ b/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java @@ -54,7 +54,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock } @Override - public boolean canRenderInLayer(net.minecraft.util.EnumWorldBlockLayer layer) { + public boolean canRenderInLayer( final net.minecraft.util.EnumWorldBlockLayer layer) { return layer == EnumWorldBlockLayer.CUTOUT_MIPPED; } @@ -67,16 +67,16 @@ public class BlockMolecularAssembler extends AEBaseTileBlock @Override public boolean onBlockActivated( - World w, - BlockPos pos, - IBlockState state, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final IBlockState state, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { - TileMolecularAssembler tg = this.getTileEntity( w, pos ); + final TileMolecularAssembler tg = this.getTileEntity( w, pos ); if( tg != null && !p.isSneaking() ) { Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_MAC ); diff --git a/src/main/java/appeng/block/crafting/ItemCraftingStorage.java b/src/main/java/appeng/block/crafting/ItemCraftingStorage.java index 211e8a79..9584edf8 100644 --- a/src/main/java/appeng/block/crafting/ItemCraftingStorage.java +++ b/src/main/java/appeng/block/crafting/ItemCraftingStorage.java @@ -30,15 +30,15 @@ import appeng.core.features.AEFeature; public class ItemCraftingStorage extends AEBaseItemBlock { - public ItemCraftingStorage( Block id ) + public ItemCraftingStorage( final Block id ) { super( id ); } @Override - public ItemStack getContainerItem( ItemStack itemStack ) + public ItemStack getContainerItem( final ItemStack itemStack ) { - for( ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() ) { return stack; } @@ -47,7 +47,7 @@ public class ItemCraftingStorage extends AEBaseItemBlock } @Override - public boolean hasContainerItem( ItemStack stack ) + public boolean hasContainerItem( final ItemStack stack ) { return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting ); } diff --git a/src/main/java/appeng/block/grindstone/BlockCrank.java b/src/main/java/appeng/block/grindstone/BlockCrank.java index 9277d33a..16fb8db0 100644 --- a/src/main/java/appeng/block/grindstone/BlockCrank.java +++ b/src/main/java/appeng/block/grindstone/BlockCrank.java @@ -64,13 +64,13 @@ public class BlockCrank 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 ) { if( player instanceof FakePlayer || player == null ) { @@ -78,7 +78,7 @@ public class BlockCrank extends AEBaseTileBlock return true; } - AEBaseTile tile = this.getTileEntity( w, pos ); + final AEBaseTile tile = this.getTileEntity( w, pos ); if( tile instanceof TileCrank ) { if( ( (TileCrank) tile ).power() ) @@ -90,7 +90,7 @@ public class BlockCrank extends AEBaseTileBlock return true; } - private void dropCrank( World world, BlockPos pos ) + private void dropCrank( final World world, final BlockPos pos ) { world.destroyBlock( pos, true ); // w.destroyBlock( x, y, z, true ); world.markBlockForUpdate( pos ); @@ -98,16 +98,16 @@ public class BlockCrank extends AEBaseTileBlock @Override public void onBlockPlacedBy( - World world, - BlockPos pos, - IBlockState state, - EntityLivingBase placer, - ItemStack stack ) + final World world, + final BlockPos pos, + final IBlockState state, + final EntityLivingBase placer, + final ItemStack stack ) { - AEBaseTile tile = this.getTileEntity( world, pos ); + final AEBaseTile tile = this.getTileEntity( world, pos ); if( tile != null ) { - EnumFacing mnt = this.findCrankable( world, pos ); + final EnumFacing mnt = this.findCrankable( world, pos ); EnumFacing forward = EnumFacing.UP; if( mnt == EnumFacing.UP || mnt == EnumFacing.DOWN ) { @@ -123,18 +123,18 @@ public class BlockCrank extends AEBaseTileBlock @Override public boolean isValidOrientation( - World w, - BlockPos pos, - EnumFacing forward, - EnumFacing up ) + final World w, + final BlockPos pos, + final EnumFacing forward, + final EnumFacing up ) { - TileEntity te = w.getTileEntity( pos ); + final TileEntity te = w.getTileEntity( pos ); return !( te instanceof TileCrank ) || this.isCrankable( w, pos, up.getOpposite() ); } - private EnumFacing findCrankable( World world, BlockPos pos ) + private EnumFacing findCrankable( final World world, final BlockPos pos ) { - for( EnumFacing dir : EnumFacing.VALUES ) + for( final EnumFacing dir : EnumFacing.VALUES ) { if( this.isCrankable( world, pos, dir ) ) { @@ -144,23 +144,23 @@ public class BlockCrank extends AEBaseTileBlock return null; } - private boolean isCrankable( World world, BlockPos pos, EnumFacing offset ) + private boolean isCrankable( final World world, final BlockPos pos, final EnumFacing offset ) { - BlockPos o = pos.offset( offset); - TileEntity te = world.getTileEntity( o ); + final BlockPos o = pos.offset( offset); + final TileEntity te = world.getTileEntity( o ); return te instanceof ICrankable && ( (ICrankable) te ).canCrankAttach( offset.getOpposite() ); } @Override public void onNeighborBlockChange( - World world, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World world, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - AEBaseTile tile = this.getTileEntity( world, pos ); + final AEBaseTile tile = this.getTileEntity( world, pos ); if( tile != null ) { if( !this.isCrankable( world, pos, tile.getUp().getOpposite() ) ) @@ -175,7 +175,7 @@ public class BlockCrank extends AEBaseTileBlock } @Override - public boolean canPlaceBlockAt( World world, BlockPos pos ) + public boolean canPlaceBlockAt( final World world, final BlockPos pos ) { return this.findCrankable( world, pos ) != null; } diff --git a/src/main/java/appeng/block/grindstone/BlockGrinder.java b/src/main/java/appeng/block/grindstone/BlockGrinder.java index f5528476..804a4c1d 100644 --- a/src/main/java/appeng/block/grindstone/BlockGrinder.java +++ b/src/main/java/appeng/block/grindstone/BlockGrinder.java @@ -49,14 +49,14 @@ public class BlockGrinder extends AEBaseTileBlock @Override public boolean onBlockActivated( - World worldIn, - BlockPos pos, - IBlockState state, - EntityPlayer playerIn, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World worldIn, + final BlockPos pos, + final IBlockState state, + final EntityPlayer playerIn, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { // TODO Auto-generated method stub return super.onBlockActivated( worldIn, pos, state, playerIn, side, hitX, hitY, hitZ ); @@ -64,15 +64,15 @@ public class BlockGrinder extends AEBaseTileBlock @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { - TileGrinder tg = this.getTileEntity( w, pos ); + final TileGrinder tg = this.getTileEntity( w, pos ); if( tg != null && !p.isSneaking() ) { Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_GRINDER ); diff --git a/src/main/java/appeng/block/misc/BlockCellWorkbench.java b/src/main/java/appeng/block/misc/BlockCellWorkbench.java index 7dfcfb8b..af5ef44d 100644 --- a/src/main/java/appeng/block/misc/BlockCellWorkbench.java +++ b/src/main/java/appeng/block/misc/BlockCellWorkbench.java @@ -47,20 +47,20 @@ public class BlockCellWorkbench extends AEBaseTileBlock @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( p.isSneaking() ) { return false; } - TileCellWorkbench tg = this.getTileEntity( w, pos ); + final TileCellWorkbench tg = this.getTileEntity( w, pos ); if( tg != null ) { if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/misc/BlockCharger.java b/src/main/java/appeng/block/misc/BlockCharger.java index 871d43d8..fd40d026 100644 --- a/src/main/java/appeng/block/misc/BlockCharger.java +++ b/src/main/java/appeng/block/misc/BlockCharger.java @@ -71,13 +71,13 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision @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 ) { if( player.isSneaking() ) { @@ -86,7 +86,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision if( Platform.isServer() ) { - TileCharger tc = this.getTileEntity( w, pos ); + final TileCharger tc = this.getTileEntity( w, pos ); if( tc != null ) { tc.activate( player ); @@ -99,10 +99,10 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision @Override @SideOnly( Side.CLIENT ) public void randomDisplayTick( - World w, - BlockPos pos, - IBlockState state, - Random r ) + final World w, + final BlockPos pos, + final IBlockState state, + final Random r ) { if( !AEConfig.instance.enableEffects ) { @@ -114,22 +114,22 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision return; } - AEBaseTile tile = this.getTileEntity( w, pos ); + final AEBaseTile tile = this.getTileEntity( w, pos ); if( tile instanceof TileCharger ) { - TileCharger tc = (TileCharger) tile; + final TileCharger tc = (TileCharger) tile; if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getStackInSlot( 0 ) ) ) { - double xOff = 0.0; - double yOff = 0.0; - double zOff = 0.0; + final double xOff = 0.0; + final double yOff = 0.0; + final double zOff = 0.0; for( int bolts = 0; bolts < 3; bolts++ ) { if( CommonHelper.proxy.shouldAddParticles( r ) ) { - LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D ); + final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } @@ -139,18 +139,18 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool( - World w, - BlockPos pos, - Entity thePlayer, - boolean b ) + final World w, + final BlockPos pos, + final Entity thePlayer, + final boolean b ) { - TileCharger tile = this.getTileEntity( w, pos ); + final TileCharger tile = this.getTileEntity( w, pos ); if( tile != null ) { - double twoPixels = 2.0 / 16.0; - EnumFacing up = tile.getUp(); - EnumFacing forward = tile.getForward(); - AEAxisAlignedBB bb = AEAxisAlignedBB.fromBounds( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels ); + final double twoPixels = 2.0 / 16.0; + final EnumFacing up = tile.getUp(); + final EnumFacing forward = tile.getForward(); + final AEAxisAlignedBB bb = AEAxisAlignedBB.fromBounds( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels ); if( up.getFrontOffsetX() != 0 ) { @@ -199,11 +199,11 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) { out.add( AxisAlignedBB.fromBounds( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) ); } diff --git a/src/main/java/appeng/block/misc/BlockCondenser.java b/src/main/java/appeng/block/misc/BlockCondenser.java index e963956a..6e7629dd 100644 --- a/src/main/java/appeng/block/misc/BlockCondenser.java +++ b/src/main/java/appeng/block/misc/BlockCondenser.java @@ -47,13 +47,13 @@ public class BlockCondenser 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 ) { if( player.isSneaking() ) { @@ -62,7 +62,7 @@ public class BlockCondenser extends AEBaseTileBlock if( Platform.isServer() ) { - TileCondenser tc = this.getTileEntity( w, pos ); + final TileCondenser tc = this.getTileEntity( w, pos ); if( tc != null && !player.isSneaking() ) { Platform.openGUI( player, tc, AEPartLocation.fromFacing( side ), GuiBridge.GUI_CONDENSER ); diff --git a/src/main/java/appeng/block/misc/BlockInscriber.java b/src/main/java/appeng/block/misc/BlockInscriber.java index db9aaef7..5b4c7fb7 100644 --- a/src/main/java/appeng/block/misc/BlockInscriber.java +++ b/src/main/java/appeng/block/misc/BlockInscriber.java @@ -58,20 +58,20 @@ public class BlockInscriber extends AEBaseTileBlock @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( p.isSneaking() ) { return false; } - TileInscriber tg = this.getTileEntity( w, pos ); + final TileInscriber tg = this.getTileEntity( w, pos ); if( tg != null ) { if( Platform.isServer() ) @@ -84,7 +84,7 @@ public class BlockInscriber extends AEBaseTileBlock } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { return super.getUnlocalizedName( is ); } diff --git a/src/main/java/appeng/block/misc/BlockInterface.java b/src/main/java/appeng/block/misc/BlockInterface.java index 01de4eca..82ca1eef 100644 --- a/src/main/java/appeng/block/misc/BlockInterface.java +++ b/src/main/java/appeng/block/misc/BlockInterface.java @@ -56,20 +56,20 @@ public class BlockInterface extends AEBaseTileBlock @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( p.isSneaking() ) { return false; } - TileInterface tg = this.getTileEntity( w, pos ); + final TileInterface tg = this.getTileEntity( w, pos ); if( tg != null ) { if( Platform.isServer() ) @@ -88,7 +88,7 @@ public class BlockInterface extends AEBaseTileBlock } @Override - protected void customRotateBlock( IOrientable rotatable, EnumFacing axis ) + protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis ) { if( rotatable instanceof TileInterface ) { diff --git a/src/main/java/appeng/block/misc/BlockLightDetector.java b/src/main/java/appeng/block/misc/BlockLightDetector.java index 8136e875..d7b74088 100644 --- a/src/main/java/appeng/block/misc/BlockLightDetector.java +++ b/src/main/java/appeng/block/misc/BlockLightDetector.java @@ -62,14 +62,14 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl @Override public int getMetaFromState( - IBlockState state ) + final IBlockState state ) { return 0; } @Override public IBlockState getStateFromMeta( - int meta ) + final int meta ) { return getDefaultState(); } @@ -82,10 +82,10 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl @Override public int isProvidingWeakPower( - IBlockAccess w, - BlockPos pos, - IBlockState state, - EnumFacing side ) + final IBlockAccess w, + final BlockPos pos, + final IBlockState state, + final EnumFacing side ) { if( w instanceof World && ( (TileLightDetector) this.getTileEntity( w, pos ) ).isReady() ) { @@ -97,13 +97,13 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl @Override public void onNeighborChange( - IBlockAccess world, - BlockPos pos, - BlockPos neighbor ) + final IBlockAccess world, + final BlockPos pos, + final BlockPos neighbor ) { super.onNeighborChange( world, pos, neighbor ); - TileLightDetector tld = this.getTileEntity( world, pos ); + final TileLightDetector tld = this.getTileEntity( world, pos ); if( tld != null ) { tld.updateLight(); @@ -112,10 +112,10 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl @Override public void randomDisplayTick( - World worldIn, - BlockPos pos, - IBlockState state, - Random rand ) + final World worldIn, + final BlockPos pos, + final IBlockState state, + final Random rand ) { // cancel out lightning } @@ -128,40 +128,40 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl @Override public boolean isValidOrientation( - World w, - BlockPos pos, - EnumFacing forward, - EnumFacing up ) + final World w, + final BlockPos pos, + final EnumFacing forward, + final EnumFacing up ) { return this.canPlaceAt( w, pos, up.getOpposite() ); } - private boolean canPlaceAt( World w, BlockPos pos, EnumFacing dir ) + private boolean canPlaceAt( final World w, final BlockPos pos, final EnumFacing dir ) { return w.isSideSolid( pos.offset( dir ), dir.getOpposite(), false ); } @Override public Iterable getSelectedBoundingBoxesFromPool( - World w, - BlockPos pos, - Entity thePlayer, - boolean b ) + final World w, + final BlockPos pos, + final Entity thePlayer, + final boolean b ) { - EnumFacing up = this.getOrientable( w, pos ).getUp(); - double xOff = -0.3 * up.getFrontOffsetX(); - double yOff = -0.3 * up.getFrontOffsetY(); - double zOff = -0.3 * up.getFrontOffsetZ(); + final EnumFacing up = this.getOrientable( w, pos ).getUp(); + final double xOff = -0.3 * up.getFrontOffsetX(); + final double yOff = -0.3 * up.getFrontOffsetY(); + final double zOff = -0.3 * up.getFrontOffsetZ(); return Collections.singletonList( AxisAlignedBB.fromBounds( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) ); } @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) {/* * double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 * * getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff @@ -171,19 +171,19 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - EnumFacing up = this.getOrientable( w, pos ).getUp(); + final EnumFacing up = this.getOrientable( w, pos ).getUp(); if( !this.canPlaceAt( w, pos, up.getOpposite() ) ) { this.dropTorch( w, pos ); } } - private void dropTorch( World w, BlockPos pos ) + private void dropTorch( final World w, final BlockPos pos ) { w.destroyBlock( pos, true ); w.markBlockForUpdate( pos ); @@ -191,10 +191,10 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl @Override public boolean canPlaceBlockAt( - World w, - BlockPos pos ) + final World w, + final BlockPos pos ) { - for( EnumFacing dir : EnumFacing.VALUES ) + for( final EnumFacing dir : EnumFacing.VALUES ) { if( this.canPlaceAt( w, pos, dir ) ) { @@ -211,7 +211,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl } @Override - public IOrientable getOrientable( final IBlockAccess w, BlockPos pos ) + public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos ) { return new MetaRotation( w, pos,true ); } diff --git a/src/main/java/appeng/block/misc/BlockPaint.java b/src/main/java/appeng/block/misc/BlockPaint.java index eb70282b..6da37b54 100644 --- a/src/main/java/appeng/block/misc/BlockPaint.java +++ b/src/main/java/appeng/block/misc/BlockPaint.java @@ -73,36 +73,36 @@ public class BlockPaint extends AEBaseTileBlock @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { // do nothing } @Override public AxisAlignedBB getCollisionBoundingBox( - World worldIn, - BlockPos pos, - IBlockState state ) + final World worldIn, + final BlockPos pos, + final IBlockState state ) { return null; } @Override public boolean canCollideCheck( - IBlockState state, - boolean hitIfLiquid ) + final IBlockState state, + final boolean hitIfLiquid ) { return false; } @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - TilePaint tp = this.getTileEntity( w, pos ); + final TilePaint tp = this.getTileEntity( w, pos ); if( tp != null ) { @@ -112,28 +112,28 @@ public class BlockPaint extends AEBaseTileBlock @Override public Item getItemDropped( - IBlockState state, - Random rand, - int fortune ) + final IBlockState state, + final Random rand, + final int fortune ) { return null; } @Override public void dropBlockAsItemWithChance( - World worldIn, - BlockPos pos, - IBlockState state, - float chance, - int fortune ) + final World worldIn, + final BlockPos pos, + final IBlockState state, + final float chance, + final int fortune ) { } @Override public void fillWithRain( - World w, - BlockPos pos ) + final World w, + final BlockPos pos ) { if( Platform.isServer() ) { @@ -143,10 +143,10 @@ public class BlockPaint extends AEBaseTileBlock @Override public int getLightValue( - IBlockAccess w, - BlockPos pos ) + final IBlockAccess w, + final BlockPos pos ) { - TilePaint tp = this.getTileEntity( w, pos ); + final TilePaint tp = this.getTileEntity( w, pos ); if( tp != null ) { @@ -158,16 +158,16 @@ public class BlockPaint extends AEBaseTileBlock @Override public boolean isAir( - IBlockAccess world, - BlockPos pos ) + final IBlockAccess world, + final BlockPos pos ) { return true; } @Override public boolean isReplaceable( - World worldIn, - BlockPos pos ) + final World worldIn, + final BlockPos pos ) { return true; } diff --git a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java index 43aa5e5f..397009f9 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java @@ -58,48 +58,47 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock @Override public void randomDisplayTick( - World w, - BlockPos pos, - IBlockState state, - Random r ) + final World w, + final BlockPos pos, + final IBlockState state, + final Random r ) { if( !AEConfig.instance.enableEffects ) { return; } - TileQuartzGrowthAccelerator cga = this.getTileEntity( w, pos ); + final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, pos ); if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) ) { - double d0 = r.nextFloat() - 0.5F; - double d1 = r.nextFloat() - 0.5F; + final double d0 = r.nextFloat() - 0.5F; + final double d1 = r.nextFloat() - 0.5F; - EnumFacing up = cga.getUp(); - EnumFacing forward = cga.getForward(); - EnumFacing west = Platform.crossProduct( forward, up ); + final EnumFacing up = cga.getUp(); + final EnumFacing forward = cga.getForward(); + final EnumFacing west = Platform.crossProduct( forward, up ); double rx = 0.5 + pos.getX(); double ry = 0.5 + pos.getY(); double rz = 0.5 + pos.getZ(); - double dx = 0; - double dz = 0; - rx += up.getFrontOffsetX() * d0; ry += up.getFrontOffsetY() * d0; rz += up.getFrontOffsetZ() * d0; - int x = pos.getX(); - int y = pos.getY(); - int z = pos.getZ(); - + final int x = pos.getX(); + final int y = pos.getY(); + final int z = pos.getZ(); + + double dz = 0; + double dx = 0; switch( r.nextInt( 4 ) ) { case 0: dx = 0.6; dz = d1; - BlockPos pt = new BlockPos( x + west.getFrontOffsetX(), y + west.getFrontOffsetY(), z + west.getFrontOffsetZ() ); + final BlockPos pt = new BlockPos( x + west.getFrontOffsetX(), y + west.getFrontOffsetY(), z + west.getFrontOffsetZ() ); if( !w.getBlockState(pt).getBlock().isAir( w, pt) ) { return; @@ -142,7 +141,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock ry += dz * forward.getFrontOffsetY(); rz += dz * forward.getFrontOffsetZ(); - LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D ); + final LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } diff --git a/src/main/java/appeng/block/misc/BlockQuartzTorch.java b/src/main/java/appeng/block/misc/BlockQuartzTorch.java index b2488d32..e2e2dd02 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzTorch.java +++ b/src/main/java/appeng/block/misc/BlockQuartzTorch.java @@ -66,14 +66,14 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I @Override public int getMetaFromState( - IBlockState state ) + final IBlockState state ) { return 0; } @Override public IBlockState getStateFromMeta( - int meta ) + final int meta ) { return getDefaultState(); } @@ -91,29 +91,29 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I } @Override - public boolean isValidOrientation( World w, BlockPos pos, EnumFacing forward, EnumFacing up ) + public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up ) { return this.canPlaceAt( w, pos, up.getOpposite() ); } - private boolean canPlaceAt( World w, BlockPos pos, EnumFacing dir ) + private boolean canPlaceAt( final World w, final BlockPos pos, final EnumFacing dir ) { - BlockPos test = pos.offset( dir ); + final BlockPos test = pos.offset( dir ); return w.isSideSolid( test, dir.getOpposite(), false ); } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, BlockPos pos, Entity e, boolean isVisual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity e, final boolean isVisual ) { - EnumFacing up = this.getOrientable( w, pos ).getUp(); - double xOff = -0.3 * up.getFrontOffsetX(); - double yOff = -0.3 * up.getFrontOffsetY(); - double zOff = -0.3 * up.getFrontOffsetZ(); + final EnumFacing up = this.getOrientable( w, pos ).getUp(); + final double xOff = -0.3 * up.getFrontOffsetX(); + final double yOff = -0.3 * up.getFrontOffsetY(); + final double zOff = -0.3 * up.getFrontOffsetZ(); return Collections.singletonList( AxisAlignedBB.fromBounds( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) ); } @Override - public void addCollidingBlockToList( World w, BlockPos pos, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List out, final Entity e ) {/* * double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 * * getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff @@ -124,10 +124,10 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I @Override @SideOnly( Side.CLIENT ) public void randomDisplayTick( - World w, - BlockPos pos, - IBlockState state, - Random r ) + final World w, + final BlockPos pos, + final IBlockState state, + final Random r ) { if( !AEConfig.instance.enableEffects ) { @@ -139,15 +139,15 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I return; } - EnumFacing up = this.getOrientable( w, pos ).getUp(); - double xOff = -0.3 * up.getFrontOffsetX(); - double yOff = -0.3 * up.getFrontOffsetY(); - double zOff = -0.3 * up.getFrontOffsetZ(); + final EnumFacing up = this.getOrientable( w, pos ).getUp(); + final double xOff = -0.3 * up.getFrontOffsetX(); + final double yOff = -0.3 * up.getFrontOffsetY(); + final double zOff = -0.3 * up.getFrontOffsetZ(); for( int bolts = 0; bolts < 3; bolts++ ) { if( CommonHelper.proxy.shouldAddParticles( r ) ) { - LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D ); + final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } @@ -156,28 +156,28 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - EnumFacing up = this.getOrientable( w, pos ).getUp(); + final EnumFacing up = this.getOrientable( w, pos ).getUp(); if( !this.canPlaceAt( w, pos, up.getOpposite() ) ) { this.dropTorch( w, pos ); } } - private void dropTorch( World w, BlockPos pos ) + private void dropTorch( final World w, final BlockPos pos ) { w.destroyBlock( pos, true ); w.markBlockForUpdate( pos ); } @Override - public boolean canPlaceBlockAt( World w, BlockPos pos ) + public boolean canPlaceBlockAt( final World w, final BlockPos pos ) { - for( EnumFacing dir : EnumFacing.VALUES ) + for( final EnumFacing dir : EnumFacing.VALUES ) { if( this.canPlaceAt( w, pos, dir ) ) { @@ -194,7 +194,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I } @Override - public IOrientable getOrientable( final IBlockAccess w, BlockPos pos ) + public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos ) { return new MetaRotation( w, pos,true ); } diff --git a/src/main/java/appeng/block/misc/BlockSecurity.java b/src/main/java/appeng/block/misc/BlockSecurity.java index f2fc0355..3f1e11aa 100644 --- a/src/main/java/appeng/block/misc/BlockSecurity.java +++ b/src/main/java/appeng/block/misc/BlockSecurity.java @@ -62,20 +62,20 @@ public class BlockSecurity extends AEBaseTileBlock @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( p.isSneaking() ) { return false; } - TileSecurity tg = this.getTileEntity( w, pos ); + final TileSecurity tg = this.getTileEntity( w, pos ); if( tg != null ) { if( Platform.isClient() ) diff --git a/src/main/java/appeng/block/misc/BlockSkyCompass.java b/src/main/java/appeng/block/misc/BlockSkyCompass.java index b05ca6b4..6c6a1fe5 100644 --- a/src/main/java/appeng/block/misc/BlockSkyCompass.java +++ b/src/main/java/appeng/block/misc/BlockSkyCompass.java @@ -58,9 +58,9 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision } @Override - public boolean isValidOrientation( World w, BlockPos pos, EnumFacing forward, EnumFacing up ) + public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up ) { - TileSkyCompass sc = this.getTileEntity( w, pos ); + final TileSkyCompass sc = this.getTileEntity( w, pos ); if( sc != null ) { return false; @@ -68,27 +68,27 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision return this.canPlaceAt( w, pos, forward.getOpposite() ); } - private boolean canPlaceAt( World w, BlockPos pos, EnumFacing dir ) + private boolean canPlaceAt( final World w, final BlockPos pos, final EnumFacing dir ) { return w.isSideSolid( pos.offset( dir ), dir.getOpposite(), false ); } @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - TileSkyCompass sc = this.getTileEntity( w, pos ); - EnumFacing up = sc.getForward(); + final TileSkyCompass sc = this.getTileEntity( w, pos ); + final EnumFacing up = sc.getForward(); if( !this.canPlaceAt( w, pos, up.getOpposite() ) ) { this.dropTorch( w, pos ); } } - private void dropTorch( World w, BlockPos pos ) + private void dropTorch( final World w, final BlockPos pos ) { w.destroyBlock( pos, true ); w.markBlockForUpdate( pos ); @@ -96,10 +96,10 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision @Override public boolean canPlaceBlockAt( - World w, - BlockPos pos ) + final World w, + final BlockPos pos ) { - for( EnumFacing dir : EnumFacing.VALUES ) + for( final EnumFacing dir : EnumFacing.VALUES ) { if( this.canPlaceAt( w, pos, dir ) ) { @@ -111,15 +111,15 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool( - World w, - BlockPos pos, - Entity thePlayer, - boolean b ) + final World w, + final BlockPos pos, + final Entity thePlayer, + final boolean b ) { - TileSkyCompass tile = this.getTileEntity( w, pos ); + final TileSkyCompass tile = this.getTileEntity( w, pos ); if( tile != null ) { - EnumFacing forward = tile.getForward(); + final EnumFacing forward = tile.getForward(); double minX = 0; double minY = 0; @@ -177,11 +177,11 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) { } diff --git a/src/main/java/appeng/block/misc/BlockTinyTNT.java b/src/main/java/appeng/block/misc/BlockTinyTNT.java index f5b32f99..e9a139ac 100644 --- a/src/main/java/appeng/block/misc/BlockTinyTNT.java +++ b/src/main/java/appeng/block/misc/BlockTinyTNT.java @@ -80,7 +80,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } @Override - public boolean onActivated( World w, BlockPos pos, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ ) + public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumFacing side, final float hitX, final float hitY, final float hitZ ) { if( player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel ) { @@ -95,18 +95,18 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } } - public void startFuse( World w, BlockPos pos, EntityLivingBase igniter ) + public void startFuse( final World w, final BlockPos pos, final EntityLivingBase igniter ) { if( !w.isRemote ) { - EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter ); + final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter ); w.spawnEntityInWorld( primedTinyTNTEntity ); w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F ); } } @Override - public void onNeighborBlockChange( World w, BlockPos pos, IBlockState state, Block neighborBlock ) + public void onNeighborBlockChange( final World w, final BlockPos pos, final IBlockState state, final Block neighborBlock ) { if( w.isBlockIndirectlyGettingPowered( pos ) > 0 ) { @@ -116,7 +116,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } @Override - public void onBlockAdded( World w, BlockPos pos, IBlockState state ) + public void onBlockAdded( final World w, final BlockPos pos, final IBlockState state ) { super.onBlockAdded( w, pos, state ); @@ -128,11 +128,11 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } @Override - public void onEntityCollidedWithBlock( World w, BlockPos pos, Entity entity ) + public void onEntityCollidedWithBlock( final World w, final BlockPos pos, final Entity entity ) { if( entity instanceof EntityArrow && !w.isRemote ) { - EntityArrow entityarrow = (EntityArrow) entity; + final EntityArrow entityarrow = (EntityArrow) entity; if( entityarrow.isBurning() ) { @@ -143,30 +143,30 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision } @Override - public boolean canDropFromExplosion( Explosion exp ) + public boolean canDropFromExplosion( final Explosion exp ) { return false; } @Override - public void onBlockExploded( World w, BlockPos pos, Explosion exp ) + public void onBlockExploded( final World w, final BlockPos pos, final Explosion exp ) { if( !w.isRemote ) { - EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getExplosivePlacedBy() ); + final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getExplosivePlacedBy() ); primedTinyTNTEntity.fuse = w.rand.nextInt( primedTinyTNTEntity.fuse / 4 ) + primedTinyTNTEntity.fuse / 8; w.spawnEntityInWorld( primedTinyTNTEntity ); } } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, BlockPos pos, Entity thePlayer, boolean b ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b ) { return Collections.singletonList( AxisAlignedBB.fromBounds( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) ); } @Override - public void addCollidingBlockToList( World w, BlockPos pos, AxisAlignedBB bb, List out, Entity e ) + public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List out, final Entity e ) { out.add( AxisAlignedBB.fromBounds( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) ); } diff --git a/src/main/java/appeng/block/misc/BlockVibrationChamber.java b/src/main/java/appeng/block/misc/BlockVibrationChamber.java index 985175ae..f555d7f8 100644 --- a/src/main/java/appeng/block/misc/BlockVibrationChamber.java +++ b/src/main/java/appeng/block/misc/BlockVibrationChamber.java @@ -54,10 +54,10 @@ public final class BlockVibrationChamber extends AEBaseTileBlock } @Override - public appeng.client.texture.IAESprite getIcon(IBlockAccess w, BlockPos pos, EnumFacing side) + public appeng.client.texture.IAESprite getIcon( final IBlockAccess w, final BlockPos pos, final EnumFacing side) { - IAESprite ico = super.getIcon( w, pos, side ); - TileVibrationChamber tvc = this.getTileEntity( w, pos ); + final IAESprite ico = super.getIcon( w, pos, side ); + final TileVibrationChamber tvc = this.getTileEntity( w, pos ); if( tvc != null && tvc.isOn && ico == this.getRendererInstance().getTexture( AEPartLocation.SOUTH ) ) { @@ -69,13 +69,13 @@ public final class BlockVibrationChamber 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 ) { if( player.isSneaking() ) { @@ -84,7 +84,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock if( Platform.isServer() ) { - TileVibrationChamber tc = this.getTileEntity( w, pos ); + final TileVibrationChamber tc = this.getTileEntity( w, pos ); if( tc != null && !player.isSneaking() ) { Platform.openGUI( player, tc, AEPartLocation.fromFacing( side ), GuiBridge.GUI_VIBRATION_CHAMBER ); @@ -97,39 +97,39 @@ public final class BlockVibrationChamber extends AEBaseTileBlock @Override public void randomDisplayTick( - World w, - BlockPos pos, - IBlockState state, - Random r ) + final World w, + final BlockPos pos, + final IBlockState state, + final Random r ) { if( !AEConfig.instance.enableEffects ) { return; } - AEBaseTile tile = this.getTileEntity( w, pos ); + final AEBaseTile tile = this.getTileEntity( w, pos ); if( tile instanceof TileVibrationChamber ) { - TileVibrationChamber tc = (TileVibrationChamber) tile; + final TileVibrationChamber tc = (TileVibrationChamber) tile; if( tc.isOn ) { float f1 = pos.getX() + 0.5F; float f2 = pos.getY() + 0.5F; float f3 = pos.getZ() + 0.5F; - EnumFacing forward = tc.getForward(); - EnumFacing up = tc.getUp(); + final EnumFacing forward = tc.getForward(); + final EnumFacing up = tc.getUp(); - int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY(); - int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ(); - int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX(); + final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY(); + final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ(); + final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX(); f1 += forward.getFrontOffsetX() * 0.6; f2 += forward.getFrontOffsetY() * 0.6; f3 += forward.getFrontOffsetZ() * 0.6; - float ox = r.nextFloat(); - float oy = r.nextFloat() * 0.2f; + final float ox = r.nextFloat(); + final float oy = r.nextFloat() * 0.2f; f1 += up.getFrontOffsetX() * ( -0.3 + oy ); f2 += up.getFrontOffsetY() * ( -0.3 + oy ); diff --git a/src/main/java/appeng/block/networking/BlockCableBus.java b/src/main/java/appeng/block/networking/BlockCableBus.java index d25aedce..61e2c1c8 100644 --- a/src/main/java/appeng/block/networking/BlockCableBus.java +++ b/src/main/java/appeng/block/networking/BlockCableBus.java @@ -94,38 +94,38 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio @Override public void randomDisplayTick( - World worldIn, - BlockPos pos, - IBlockState state, - Random rand ) + final World worldIn, + final BlockPos pos, + final IBlockState state, + final Random rand ) { this.cb( worldIn, pos ).randomDisplayTick( worldIn, pos, rand ); } @Override public void onNeighborChange( - IBlockAccess w, - BlockPos pos, - BlockPos neighbor ) + final IBlockAccess w, + final BlockPos pos, + final BlockPos neighbor ) { this.cb( w, pos ).onNeighborChanged(); } @Override public Item getItemDropped( - IBlockState state, - Random rand, - int fortune ) + final IBlockState state, + final Random rand, + final int fortune ) { return null; } @Override public int isProvidingWeakPower( - IBlockAccess w, - BlockPos pos, - IBlockState state, - EnumFacing side ) + final IBlockAccess w, + final BlockPos pos, + final IBlockState state, + final EnumFacing side ) { return this.cb( w, pos ).isProvidingWeakPower( side.getOpposite() ); // TODO: IS OPPOSITE!? } @@ -138,30 +138,30 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio @Override public void onEntityCollidedWithBlock( - World w, - BlockPos pos, - IBlockState state, - Entity entityIn ) + final World w, + final BlockPos pos, + final IBlockState state, + final Entity entityIn ) { this.cb( w, pos ).onEntityCollision( entityIn ); } @Override public int isProvidingStrongPower( - IBlockAccess w, - BlockPos pos, - IBlockState state, - EnumFacing side ) + final IBlockAccess w, + final BlockPos pos, + final IBlockState state, + final EnumFacing side ) { return this.cb( w, pos ).isProvidingStrongPower( side.getOpposite() ); // TODO: IS OPPOSITE!? } @Override public int getLightValue( - IBlockAccess world, - BlockPos pos ) + final IBlockAccess world, + final BlockPos pos ) { - IBlockState block = world.getBlockState( pos ); + final IBlockState block = world.getBlockState( pos ); if( block != null && block.getBlock() != this ) { return block.getBlock().getLightValue( world, pos ); @@ -174,35 +174,35 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio } @Override - public boolean isLadder( IBlockAccess world, BlockPos pos, EntityLivingBase entity ) + public boolean isLadder( final IBlockAccess world, final BlockPos pos, final EntityLivingBase entity ) { return this.cb( world, pos ).isLadder( entity ); } @Override - public boolean isSideSolid( IBlockAccess w, BlockPos pos, EnumFacing side ) + public boolean isSideSolid( final IBlockAccess w, final BlockPos pos, final EnumFacing side ) { return this.cb( w, pos ).isSolidOnSide( side ); } @Override public boolean isReplaceable( - World w, - BlockPos pos ) + final World w, + final BlockPos pos ) { return this.cb( w, pos ).isEmpty(); } @Override public boolean removedByPlayer( - World world, - BlockPos pos, - EntityPlayer player, - boolean willHarvest ) + final World world, + final BlockPos pos, + final EntityPlayer player, + final boolean willHarvest ) { if( player.capabilities.isCreativeMode ) { - AEBaseTile tile = this.getTileEntity( world, pos ); + final AEBaseTile tile = this.getTileEntity( world, pos ); if( tile != null ) { tile.disableDrops(); @@ -214,8 +214,8 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio @Override public boolean canConnectRedstone( - IBlockAccess w, - BlockPos pos, + final IBlockAccess w, + final BlockPos pos, EnumFacing side ) { if ( side == null ) @@ -226,7 +226,7 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio @Override public boolean canRenderInLayer( - EnumWorldBlockLayer layer ) + final EnumWorldBlockLayer layer ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) ) { @@ -238,12 +238,12 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio @Override public ItemStack getPickBlock( - MovingObjectPosition target, - World world, - BlockPos pos ) + final MovingObjectPosition target, + final World world, + final BlockPos pos ) { - Vec3 v3 = target.hitVec.subtract( pos.getX(), pos.getY(), pos.getZ() ); - SelectedPart sp = this.cb( world, pos ).selectPart( v3 ); + final Vec3 v3 = target.hitVec.subtract( pos.getX(), pos.getY(), pos.getZ() ); + final SelectedPart sp = this.cb( world, pos ).selectPart( v3 ); if( sp.part != null ) { @@ -259,12 +259,12 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio @Override @SideOnly( Side.CLIENT ) - public boolean addHitEffects( World world, MovingObjectPosition target, EffectRenderer effectRenderer ) + public boolean addHitEffects( final World world, final MovingObjectPosition target, final EffectRenderer effectRenderer ) { - Object object = this.cb( world, target.getBlockPos() ); + final Object object = this.cb( world, target.getBlockPos() ); if( object instanceof IPartHost ) { - IPartHost host = (IPartHost) object; + final IPartHost host = (IPartHost) object; // TODO HIT EFFECTS /* @@ -310,14 +310,14 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio @Override public boolean addDestroyEffects( - World world, - BlockPos pos, - EffectRenderer effectRenderer ) + final World world, + final BlockPos pos, + final EffectRenderer effectRenderer ) { - Object object = this.cb( world, pos ); + final Object object = this.cb( world, pos ); if( object instanceof IPartHost ) { - IPartHost host = (IPartHost) object; + final IPartHost host = (IPartHost) object; // TODO DESTROY EFFECTS /* @@ -359,10 +359,10 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { if( Platform.isServer() ) { @@ -370,9 +370,9 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio } } - private ICableBusContainer cb( IBlockAccess w, BlockPos pos ) + private ICableBusContainer cb( final IBlockAccess w, final BlockPos pos ) { - TileEntity te = w.getTileEntity( pos ); + final TileEntity te = w.getTileEntity( pos ); ICableBusContainer out = null; if( te instanceof TileCableBus ) @@ -395,54 +395,54 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio @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 ) { return this.cb( w, pos ).activate( player, new Vec3( hitX, hitY, hitZ ) ); } @Override public boolean recolorBlock( - World world, - BlockPos pos, - EnumFacing side, - EnumDyeColor color ) + final World world, + final BlockPos pos, + final EnumFacing side, + final EnumDyeColor color ) { return this.recolorBlock( world, pos, side, color, null ); } public boolean recolorBlock( - World world, - BlockPos pos, - EnumFacing side, - EnumDyeColor color, - EntityPlayer who ) + final World world, + final BlockPos pos, + final EnumFacing side, + final EnumDyeColor color, + final EntityPlayer who ) { try { return this.cb( world, pos ).recolourBlock( side, AEColor.values()[ color.ordinal() ], who ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) {} return false; } @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { // do nothing } @Override - public T getTileEntity( IBlockAccess w, BlockPos pos ) + public T getTileEntity( final IBlockAccess w, final BlockPos pos ) { - TileEntity te = w.getTileEntity( pos ); + final TileEntity te = w.getTileEntity( pos ); if( noTesrTile.isInstance( te ) ) { @@ -458,7 +458,7 @@ public class BlockCableBus extends AEBaseTileBlock //implements IRedNetConnectio } @Override - protected void setFeature( EnumSet f ) + protected void setFeature( final EnumSet f ) { final AECableBusFeatureHandler featureHandler = new AECableBusFeatureHandler( f, this, this.featureSubName ); this.setHandler( featureHandler ); diff --git a/src/main/java/appeng/block/networking/BlockController.java b/src/main/java/appeng/block/networking/BlockController.java index a69a3d0e..c1a9b3fc 100644 --- a/src/main/java/appeng/block/networking/BlockController.java +++ b/src/main/java/appeng/block/networking/BlockController.java @@ -62,13 +62,13 @@ public class BlockController extends AEBaseTileBlock @Override public int getMetaFromState( - IBlockState state ) + final IBlockState state ) { return ((ControllerBlockState)state.getValue( CONTROLLER_STATE )).ordinal(); } @Override - public IBlockState getStateFromMeta( int meta ) + public IBlockState getStateFromMeta( final int meta ) { return getDefaultState().withProperty( CONTROLLER_STATE, ControllerBlockState.OFFLINE ); } @@ -89,12 +89,12 @@ public class BlockController extends AEBaseTileBlock @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - TileController tc = this.getTileEntity( w, pos ); + final TileController tc = this.getTileEntity( w, pos ); if( tc != null ) { tc.onNeighborChange( false ); diff --git a/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java b/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java index d7f62107..e566bca3 100644 --- a/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java @@ -36,7 +36,7 @@ public class BlockDenseEnergyCell extends BlockEnergyCell } @Override - public appeng.client.texture.IAESprite getIcon(net.minecraft.util.EnumFacing side, net.minecraft.block.state.IBlockState state) + public appeng.client.texture.IAESprite getIcon( final net.minecraft.util.EnumFacing side, final net.minecraft.block.state.IBlockState state) { switch( (int)state.getValue( ENERGY_STORAGE ) ) { diff --git a/src/main/java/appeng/block/networking/BlockEnergyCell.java b/src/main/java/appeng/block/networking/BlockEnergyCell.java index e464cef4..7ccee8d3 100644 --- a/src/main/java/appeng/block/networking/BlockEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockEnergyCell.java @@ -50,13 +50,13 @@ public class BlockEnergyCell extends AEBaseTileBlock @Override public int getMetaFromState( - IBlockState state ) + final IBlockState state ) { return (int)state.getValue( ENERGY_STORAGE ); } @Override - public IBlockState getStateFromMeta( int meta ) + public IBlockState getStateFromMeta( final int meta ) { return getDefaultState().withProperty( ENERGY_STORAGE, Math.min( 7, Math.max( 0, meta ) ) ); } @@ -76,7 +76,7 @@ public class BlockEnergyCell extends AEBaseTileBlock } @Override - public appeng.client.texture.IAESprite getIcon(net.minecraft.util.EnumFacing side, IBlockState state) + public appeng.client.texture.IAESprite getIcon( final net.minecraft.util.EnumFacing side, final IBlockState state) { switch( (int)state.getValue( ENERGY_STORAGE ) ) { @@ -102,12 +102,12 @@ public class BlockEnergyCell extends AEBaseTileBlock @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { super.getCheckedSubBlocks( item, tabs, itemStacks ); - ItemStack charged = new ItemStack( this, 1 ); - NBTTagCompound tag = Platform.openNbtData( charged ); + final ItemStack charged = new ItemStack( this, 1 ); + final NBTTagCompound tag = Platform.openNbtData( charged ); tag.setDouble( "internalCurrentPower", this.getMaxPower() ); tag.setDouble( "internalMaxPower", this.getMaxPower() ); diff --git a/src/main/java/appeng/block/networking/BlockWireless.java b/src/main/java/appeng/block/networking/BlockWireless.java index 57041751..9c88337a 100644 --- a/src/main/java/appeng/block/networking/BlockWireless.java +++ b/src/main/java/appeng/block/networking/BlockWireless.java @@ -70,21 +70,21 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision @Override public boolean onBlockActivated( - World w, - BlockPos pos, - IBlockState state, - EntityPlayer player, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final IBlockState state, + final EntityPlayer player, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( player.isSneaking() ) { return false; } - TileWireless tg = this.getTileEntity( w, pos ); + final TileWireless tg = this.getTileEntity( w, pos ); if( tg != null ) { if( Platform.isServer() ) @@ -98,15 +98,15 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool( - World w, - BlockPos pos, - Entity thePlayer, - boolean b ) + final World w, + final BlockPos pos, + final Entity thePlayer, + final boolean b ) { - TileWireless tile = this.getTileEntity( w, pos ); + final TileWireless tile = this.getTileEntity( w, pos ); if( tile != null ) { - EnumFacing forward = tile.getForward(); + final EnumFacing forward = tile.getForward(); double minX = 0; double minY = 0; @@ -164,16 +164,16 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) { - TileWireless tile = this.getTileEntity( w, pos ); + final TileWireless tile = this.getTileEntity( w, pos ); if( tile != null ) { - EnumFacing forward = tile.getForward(); + final EnumFacing forward = tile.getForward(); double minX = 0; double minY = 0; diff --git a/src/main/java/appeng/block/qnb/BlockQuantumBase.java b/src/main/java/appeng/block/qnb/BlockQuantumBase.java index 12856674..16d9b69f 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumBase.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumBase.java @@ -37,11 +37,11 @@ import appeng.tile.qnb.TileQuantumBridge; public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision { - public BlockQuantumBase( Material mat ) + public BlockQuantumBase( final Material mat ) { super( mat ); this.setTileEntity( TileQuantumBridge.class ); - float shave = 2.0f / 16.0f; + final float shave = 2.0f / 16.0f; this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave ); this.setLightOpacity( 0 ); this.isFullSize = this.isOpaque = false; @@ -56,12 +56,12 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - TileQuantumBridge bridge = this.getTileEntity( w, pos ); + final TileQuantumBridge bridge = this.getTileEntity( w, pos ); if( bridge != null ) { bridge.neighborUpdate(); @@ -70,11 +70,11 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto @Override public void breakBlock( - World w, - BlockPos pos, - IBlockState state ) + final World w, + final BlockPos pos, + final IBlockState state ) { - TileQuantumBridge bridge = this.getTileEntity( w, pos ); + final TileQuantumBridge bridge = this.getTileEntity( w, pos ); if( bridge != null ) { bridge.breakCluster(); diff --git a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java index 2d70eb43..e9150988 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java @@ -50,12 +50,12 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase @Override public void randomDisplayTick( - World w, - BlockPos pos, - IBlockState state, - Random rand ) + final World w, + final BlockPos pos, + final IBlockState state, + final Random rand ) { - TileQuantumBridge bridge = this.getTileEntity( w, pos ); + final TileQuantumBridge bridge = this.getTileEntity( w, pos ); if( bridge != null ) { if( bridge.hasQES() ) @@ -70,20 +70,20 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( p.isSneaking() ) { return false; } - TileQuantumBridge tg = this.getTileEntity( w, pos ); + final TileQuantumBridge tg = this.getTileEntity( w, pos ); if( tg != null ) { if( Platform.isServer() ) @@ -97,24 +97,24 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase @Override public Iterable getSelectedBoundingBoxesFromPool( - World w, - BlockPos pos, - Entity thePlayer, - boolean b ) + final World w, + final BlockPos pos, + final Entity thePlayer, + final boolean b ) { - double onePixel = 2.0 / 16.0; + final double onePixel = 2.0 / 16.0; return Collections.singletonList( AxisAlignedBB.fromBounds( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); } @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) { - double onePixel = 2.0 / 16.0; + final double onePixel = 2.0 / 16.0; out.add( AxisAlignedBB.fromBounds( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); } } diff --git a/src/main/java/appeng/block/qnb/BlockQuantumRing.java b/src/main/java/appeng/block/qnb/BlockQuantumRing.java index 459aab94..5493e2b4 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumRing.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumRing.java @@ -41,13 +41,13 @@ public class BlockQuantumRing extends BlockQuantumBase @Override public Iterable getSelectedBoundingBoxesFromPool( - World w, - BlockPos pos, - Entity thePlayer, - boolean b ) + final World w, + final BlockPos pos, + final Entity thePlayer, + final boolean b ) { double onePixel = 2.0 / 16.0; - TileQuantumBridge bridge = this.getTileEntity( w, pos ); + final TileQuantumBridge bridge = this.getTileEntity( w, pos ); if( bridge != null && bridge.isCorner() ) { onePixel = 4.0 / 16.0; @@ -61,14 +61,14 @@ public class BlockQuantumRing extends BlockQuantumBase @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) { double onePixel = 2.0 / 16.0; - TileQuantumBridge bridge = this.getTileEntity( w, pos ); + final TileQuantumBridge bridge = this.getTileEntity( w, pos ); if( bridge != null && bridge.isCorner() ) { onePixel = 4.0 / 16.0; diff --git a/src/main/java/appeng/block/spatial/BlockMatrixFrame.java b/src/main/java/appeng/block/spatial/BlockMatrixFrame.java index 9922095d..5870bc88 100644 --- a/src/main/java/appeng/block/spatial/BlockMatrixFrame.java +++ b/src/main/java/appeng/block/spatial/BlockMatrixFrame.java @@ -63,17 +63,17 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision @Override @SideOnly( Side.CLIENT ) - public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List itemStacks ) + public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks ) { // do nothing } @Override public Iterable getSelectedBoundingBoxesFromPool( - World w, - BlockPos pos, - Entity thePlayer, - boolean b ) + final World w, + final BlockPos pos, + final Entity thePlayer, + final boolean b ) { return Arrays.asList( new AxisAlignedBB[] {} );// AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) // } ); @@ -81,37 +81,37 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) { out.add( AxisAlignedBB.fromBounds( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) ); } @Override public boolean canPlaceBlockAt( - World worldIn, - BlockPos pos ) + final World worldIn, + final BlockPos pos ) { return false; } @Override public void onBlockExploded( - World world, - BlockPos pos, - Explosion explosion ) + final World world, + final BlockPos pos, + final Explosion explosion ) { // Don't explode. } @Override public boolean canEntityDestroy( - IBlockAccess world, - BlockPos pos, - Entity entity ) + final IBlockAccess world, + final BlockPos pos, + final Entity entity ) { return false; } diff --git a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java index 562a69fa..bcee502d 100644 --- a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java +++ b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java @@ -48,12 +48,12 @@ public class BlockSpatialIOPort extends AEBaseTileBlock @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - TileSpatialIOPort te = this.getTileEntity( w, pos ); + final TileSpatialIOPort te = this.getTileEntity( w, pos ); if( te != null ) { te.updateRedstoneState(); @@ -62,20 +62,20 @@ public class BlockSpatialIOPort extends AEBaseTileBlock @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( p.isSneaking() ) { return false; } - TileSpatialIOPort tg = this.getTileEntity( w, pos ); + final TileSpatialIOPort tg = this.getTileEntity( w, pos ); if( tg != null ) { if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/spatial/BlockSpatialPylon.java b/src/main/java/appeng/block/spatial/BlockSpatialPylon.java index 88fbef6b..e0106fa1 100644 --- a/src/main/java/appeng/block/spatial/BlockSpatialPylon.java +++ b/src/main/java/appeng/block/spatial/BlockSpatialPylon.java @@ -46,12 +46,12 @@ public class BlockSpatialPylon extends AEBaseTileBlock @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - TileSpatialPylon tsp = this.getTileEntity( w, pos ); + final TileSpatialPylon tsp = this.getTileEntity( w, pos ); if( tsp != null ) { tsp.onNeighborBlockChange(); @@ -60,10 +60,10 @@ public class BlockSpatialPylon extends AEBaseTileBlock @Override public int getLightValue( - IBlockAccess w, - BlockPos pos ) + final IBlockAccess w, + final BlockPos pos ) { - TileSpatialPylon tsp = this.getTileEntity( w, pos ); + final TileSpatialPylon tsp = this.getTileEntity( w, pos ); if( tsp != null ) { return tsp.getLightValue(); diff --git a/src/main/java/appeng/block/storage/BlockChest.java b/src/main/java/appeng/block/storage/BlockChest.java index 6adae143..af7742f4 100644 --- a/src/main/java/appeng/block/storage/BlockChest.java +++ b/src/main/java/appeng/block/storage/BlockChest.java @@ -65,15 +65,15 @@ public class BlockChest extends AEBaseTileBlock @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { - TileChest tg = this.getTileEntity( w, pos ); + final TileChest tg = this.getTileEntity( w, pos ); if( tg != null && !p.isSneaking() ) { if( Platform.isClient() ) @@ -87,10 +87,10 @@ public class BlockChest extends AEBaseTileBlock } else { - ItemStack cell = tg.getStackInSlot( 1 ); + final ItemStack cell = tg.getStackInSlot( 1 ); if( cell != null ) { - ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); + final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); tg.openGui( p, ch, cell, side ); } diff --git a/src/main/java/appeng/block/storage/BlockDrive.java b/src/main/java/appeng/block/storage/BlockDrive.java index 08bc451e..77a01d4b 100644 --- a/src/main/java/appeng/block/storage/BlockDrive.java +++ b/src/main/java/appeng/block/storage/BlockDrive.java @@ -61,20 +61,20 @@ public class BlockDrive extends AEBaseTileBlock @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( p.isSneaking() ) { return false; } - TileDrive tg = this.getTileEntity( w, pos ); + final TileDrive tg = this.getTileEntity( w, pos ); if( tg != null ) { if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/storage/BlockIOPort.java b/src/main/java/appeng/block/storage/BlockIOPort.java index 352e932a..c2b24b82 100644 --- a/src/main/java/appeng/block/storage/BlockIOPort.java +++ b/src/main/java/appeng/block/storage/BlockIOPort.java @@ -48,12 +48,12 @@ public class BlockIOPort extends AEBaseTileBlock @Override public void onNeighborBlockChange( - World w, - BlockPos pos, - IBlockState state, - Block neighborBlock ) + final World w, + final BlockPos pos, + final IBlockState state, + final Block neighborBlock ) { - TileIOPort te = this.getTileEntity( w, pos ); + final TileIOPort te = this.getTileEntity( w, pos ); if( te != null ) { te.updateRedstoneState(); @@ -62,20 +62,20 @@ public class BlockIOPort extends AEBaseTileBlock @Override public boolean onActivated( - World w, - BlockPos pos, - EntityPlayer p, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final World w, + final BlockPos pos, + final EntityPlayer p, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( p.isSneaking() ) { return false; } - TileIOPort tg = this.getTileEntity( w, pos ); + final TileIOPort tg = this.getTileEntity( w, pos ); if( tg != null ) { if( Platform.isServer() ) diff --git a/src/main/java/appeng/block/storage/BlockSkyChest.java b/src/main/java/appeng/block/storage/BlockSkyChest.java index 6c5f2b37..8181d9d4 100644 --- a/src/main/java/appeng/block/storage/BlockSkyChest.java +++ b/src/main/java/appeng/block/storage/BlockSkyChest.java @@ -54,7 +54,7 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision public final SkyChestType type; - public BlockSkyChest( SkyChestType type ) + public BlockSkyChest( final SkyChestType type ) { super( Material.rock, Optional.of( type.name() ) ); this.setTileEntity( TileSkyChest.class ); @@ -75,13 +75,13 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision @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 ) { if( Platform.isServer() ) { @@ -93,12 +93,12 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision @Override public Iterable getSelectedBoundingBoxesFromPool( - World w, - BlockPos pos, - Entity thePlayer, - boolean b ) + final World w, + final BlockPos pos, + final Entity thePlayer, + final boolean b ) { - TileSkyChest sk = this.getTileEntity( w, pos ); + final TileSkyChest sk = this.getTileEntity( w, pos ); EnumFacing o = EnumFacing.UP; if( sk != null ) @@ -106,21 +106,21 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision o = sk.getUp(); } - double offsetX = o.getFrontOffsetX() == 0 ? 0.06 : 0.0; - double offsetY = o.getFrontOffsetY() == 0 ? 0.06 : 0.0; - double offsetZ = o.getFrontOffsetZ() == 0 ? 0.06 : 0.0; + final double offsetX = o.getFrontOffsetX() == 0 ? 0.06 : 0.0; + final double offsetY = o.getFrontOffsetY() == 0 ? 0.06 : 0.0; + final double offsetZ = o.getFrontOffsetZ() == 0 ? 0.06 : 0.0; - double sc = 0.06; + final double sc = 0.06; return Collections.singletonList( AxisAlignedBB.fromBounds( Math.max( 0.0, offsetX - o.getFrontOffsetX() * sc ), Math.max( 0.0, offsetY - o.getFrontOffsetY() * sc ), Math.max( 0.0, offsetZ - o.getFrontOffsetZ() * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.getFrontOffsetX() * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.getFrontOffsetY() * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.getFrontOffsetZ() * sc ) ) ); } @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) { out.add( AxisAlignedBB.fromBounds( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) ); } diff --git a/src/main/java/appeng/client/ClientHelper.java b/src/main/java/appeng/client/ClientHelper.java index 1578b1f5..d64d8986 100644 --- a/src/main/java/appeng/client/ClientHelper.java +++ b/src/main/java/appeng/client/ClientHelper.java @@ -109,7 +109,7 @@ public class ClientHelper extends ServerHelper private List extraIcons = new ArrayList<>(); @Override - public void configureIcon( Object item, String name ) + public void configureIcon( final Object item, final String name ) { iconTmp.add( new IconReg( item, 0, name ) ); } @@ -156,9 +156,9 @@ public class ClientHelper extends ServerHelper } @Override - public void bindTileEntitySpecialRenderer( Class tile, AEBaseBlock blk ) + public void bindTileEntitySpecialRenderer( final Class tile, final AEBaseBlock blk ) { - BaseBlockRender bbr = blk.getRendererInstance().rendererInstance; + final BaseBlockRender bbr = blk.getRendererInstance().rendererInstance; if( bbr.hasTESR() && tile != null ) { ClientRegistry.bindTileEntitySpecialRenderer( tile, new TESRWrapper( bbr ) ); @@ -170,7 +170,7 @@ public class ClientHelper extends ServerHelper { if( Platform.isClient() ) { - List o = new ArrayList<>(); + final List o = new ArrayList<>(); o.add( Minecraft.getMinecraft().thePlayer ); return o; } @@ -181,7 +181,7 @@ public class ClientHelper extends ServerHelper } @Override - public void spawnEffect( EffectType effect, World worldObj, double posX, double posY, double posZ, Object o ) + public void spawnEffect( final EffectType effect, final World worldObj, final double posX, final double posY, final double posZ, final Object o ) { if( AEConfig.instance.enableEffects ) { @@ -211,9 +211,9 @@ public class ClientHelper extends ServerHelper } @Override - public boolean shouldAddParticles( Random r ) + public boolean shouldAddParticles( final Random r ) { - int setting = Minecraft.getMinecraft().gameSettings.particleSetting; + final int setting = Minecraft.getMinecraft().gameSettings.particleSetting; if( setting == 2 ) { return false; @@ -232,11 +232,11 @@ public class ClientHelper extends ServerHelper } @Override - public void doRenderItem( ItemStack itemstack, World w ) + public void doRenderItem( final ItemStack itemstack, final World w ) { if( itemstack != null ) { - EntityItem entityitem = new EntityItem( w, 0.0D, 0.0D, 0.0D, itemstack ); + final EntityItem entityitem = new EntityItem( w, 0.0D, 0.0D, 0.0D, itemstack ); entityitem.getEntityItem().stackSize = 1; // set all this stuff and then do shit? meh? @@ -259,23 +259,23 @@ public class ClientHelper extends ServerHelper public void postInit() { //RenderingRegistry.registerBlockHandler( WorldRender.INSTANCE ); - RenderManager inst = Minecraft.getMinecraft().getRenderManager(); + final RenderManager inst = Minecraft.getMinecraft().getRenderManager(); inst.entityRenderMap.put( EntityTinyTNTPrimed.class, new RenderTinyTNTPrimed( inst ) ); inst.entityRenderMap.put( EntityFloatingItem.class, new RenderFloatingItem( inst ) ); final ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); - ItemMeshDefinition imd = new ItemMeshDefinition() + final ItemMeshDefinition imd = new ItemMeshDefinition() { @Override - public ModelResourceLocation getModelLocation( ItemStack stack ) + public ModelResourceLocation getModelLocation( final ItemStack stack ) { return partRenderer; } }; - for( IconReg reg : iconTmp ) + for( final IconReg reg : iconTmp ) { if( reg.item instanceof IPartItem || reg.item instanceof IFacadeItem ) { @@ -312,15 +312,15 @@ public class ClientHelper extends ServerHelper } } - String MODID = AppEng.MOD_ID + ":"; - for( List reg : iconRegistrations.values() ) + final String MODID = AppEng.MOD_ID + ":"; + for( final List reg : iconRegistrations.values() ) { - String[] names = new String[reg.size()]; + final String[] names = new String[reg.size()]; Item it = null; int offset = 0; - for( IconReg r : reg ) + for( final IconReg r : reg ) { it = (Item) r.item; @@ -344,8 +344,8 @@ public class ClientHelper extends ServerHelper return super.getRenderMode(); } - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer player = mc.thePlayer; + final Minecraft mc = Minecraft.getMinecraft(); + final EntityPlayer player = mc.thePlayer; return this.renderModeForPlayer( player ); } @@ -353,19 +353,19 @@ public class ClientHelper extends ServerHelper @Override public void triggerUpdates() { - Minecraft mc = Minecraft.getMinecraft(); + final Minecraft mc = Minecraft.getMinecraft(); if( mc == null || mc.thePlayer == null || mc.theWorld == null ) { return; } - EntityPlayer player = mc.thePlayer; + final EntityPlayer player = mc.thePlayer; - int x = (int) player.posX; - int y = (int) player.posY; - int z = (int) player.posZ; + final int x = (int) player.posX; + final int y = (int) player.posY; + final int z = (int) player.posZ; - int range = 16 * 16; + final int range = 16 * 16; mc.theWorld.markBlockRangeForRenderUpdate( x - range, y - range, z - range, x + range, y + range, z + range ); } @@ -377,14 +377,14 @@ public class ClientHelper extends ServerHelper } @Override - public ResourceLocation addIcon( String string ) + public ResourceLocation addIcon( final String string ) { - ModelResourceLocation n = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, string ), "inventory" ); + final ModelResourceLocation n = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, string ), "inventory" ); extraIcons.add( n ); return n; } - public ModelResourceLocation setIcon( Item item, String name ) + public ModelResourceLocation setIcon( final Item item, final String name ) { List reg = iconRegistrations.get( item ); if( reg == null ) @@ -392,12 +392,12 @@ public class ClientHelper extends ServerHelper iconRegistrations.put( item, reg = new LinkedList<>() ); } - ModelResourceLocation res = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, name ), "inventory" ); + final ModelResourceLocation res = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, name ), "inventory" ); reg.add( new IconReg( item, -1, name, res ) ); return res; } - public ModelResourceLocation setIcon( Item item, int meta, String name ) + public ModelResourceLocation setIcon( final Item item, final int meta, final String name ) { List reg = iconRegistrations.get( item ); if( reg == null ) @@ -405,54 +405,54 @@ public class ClientHelper extends ServerHelper iconRegistrations.put( item, reg = new LinkedList<>() ); } - ModelResourceLocation res = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, name ), "inventory" ); + final ModelResourceLocation res = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, name ), "inventory" ); reg.add( new IconReg( item, meta, name, res ) ); return res; } @SubscribeEvent - public void postPlayerRender( RenderLivingEvent.Pre p ) + public void postPlayerRender( final RenderLivingEvent.Pre p ) { - PlayerColor player = TickHandler.INSTANCE.getPlayerColors().get( p.entity.getEntityId() ); + final PlayerColor player = TickHandler.INSTANCE.getPlayerColors().get( p.entity.getEntityId() ); if( player != null ) { - AEColor col = player.myColor; + final AEColor col = player.myColor; - float r = 0xff & ( col.mediumVariant >> 16 ); - float g = 0xff & ( col.mediumVariant >> 8 ); - float b = 0xff & ( col.mediumVariant ); + final float r = 0xff & ( col.mediumVariant >> 16 ); + final float g = 0xff & ( col.mediumVariant >> 8 ); + final float b = 0xff & ( col.mediumVariant ); GL11.glColor3f( r / 255.0f, g / 255.0f, b / 255.0f ); } } - private void spawnAssembler( World worldObj, double posX, double posY, double posZ, Object o ) + private void spawnAssembler( final World worldObj, final double posX, final double posY, final double posZ, final Object o ) { - PacketAssemblerAnimation paa = (PacketAssemblerAnimation) o; + final PacketAssemblerAnimation paa = (PacketAssemblerAnimation) o; - AssemblerFX fx = new AssemblerFX( Minecraft.getMinecraft().theWorld, posX, posY, posZ, 0.0D, 0.0D, 0.0D, paa.rate, paa.is ); + final AssemblerFX fx = new AssemblerFX( Minecraft.getMinecraft().theWorld, posX, posY, posZ, 0.0D, 0.0D, 0.0D, paa.rate, paa.is ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } - private void spawnVibrant( World w, double x, double y, double z ) + private void spawnVibrant( final World w, final double x, final double y, final double z ) { if( CommonHelper.proxy.shouldAddParticles( Platform.getRandom() ) ) { - double d0 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; - double d1 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; - double d2 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; + final double d0 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; + final double d1 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; + final double d2 = ( Platform.getRandomFloat() - 0.5F ) * 0.26D; - VibrantFX fx = new VibrantFX( w, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D ); + final VibrantFX fx = new VibrantFX( w, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } - private void spawnCrafting( World w, double posX, double posY, double posZ ) + private void spawnCrafting( final World w, final double posX, final double posY, final double posZ ) { - float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - CraftingFx fx = new CraftingFx( w, posX + x, posY + y, posZ + z, Items.diamond ); + final CraftingFx fx = new CraftingFx( w, posX + x, posY + y, posZ + z, Items.diamond ); fx.motionX = -x * 0.2; fx.motionY = -y * 0.2; @@ -461,13 +461,13 @@ public class ClientHelper extends ServerHelper Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } - private void spawnEnergy( World w, double posX, double posY, double posZ ) + private void spawnEnergy( final World w, final double posX, final double posY, final double posZ ) { - float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float x = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float y = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; + final float z = (float) ( ( ( Platform.getRandomInt() % 100 ) * 0.01 ) - 0.5 ) * 0.7f; - EnergyFx fx = new EnergyFx( w, posX + x, posY + y, posZ + z, Items.diamond ); + final EnergyFx fx = new EnergyFx( w, posX + x, posY + y, posZ + z, Items.diamond ); fx.motionX = -x * 0.1; fx.motionY = -y * 0.1; @@ -476,48 +476,48 @@ public class ClientHelper extends ServerHelper Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } - private void spawnLightning( World worldObj, double posX, double posY, double posZ ) + private void spawnLightning( final World worldObj, final double posX, final double posY, final double posZ ) { - LightningFX fx = new LightningFX( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f ); + final LightningFX fx = new LightningFX( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } - private void spawnLightningArc( World worldObj, double posX, double posY, double posZ, Vec3 second ) + private void spawnLightningArc( final World worldObj, final double posX, final double posY, final double posZ, final Vec3 second ) { - LightningFX fx = new LightningArcFX( worldObj, posX, posY, posZ, second.xCoord, second.yCoord, second.zCoord, 0.0f, 0.0f, 0.0f ); + final LightningFX fx = new LightningArcFX( worldObj, posX, posY, posZ, second.xCoord, second.yCoord, second.zCoord, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } @SubscribeEvent - public void onModelBakeEvent( ModelBakeEvent event ) + public void onModelBakeEvent( final ModelBakeEvent event ) { // inventory renderer - SmartModel buses = new SmartModel( new BlockRenderInfo( ( new RendererCableBus() ) ) ); + final SmartModel buses = new SmartModel( new BlockRenderInfo( ( new RendererCableBus() ) ) ); event.modelRegistry.putObject( partRenderer, buses ); - for( IconReg reg : iconTmp ) + for( final IconReg reg : iconTmp ) { if( reg.item instanceof IPartItem || reg.item instanceof IFacadeItem ) { - UniqueIdentifier i = GameRegistry.findUniqueIdentifierFor( (Item) reg.item ); + final UniqueIdentifier i = GameRegistry.findUniqueIdentifierFor( (Item) reg.item ); event.modelRegistry.putObject( new ModelResourceLocation( new ResourceLocation( i.modId, i.name ), "inventory" ), buses ); } if( reg.item instanceof AEBaseBlock ) { - BlockRenderInfo renderer = ( (AEBaseBlock) reg.item ).getRendererInstance(); + final BlockRenderInfo renderer = ( (AEBaseBlock) reg.item ).getRendererInstance(); if( renderer == null ) { continue; } - SmartModel sm = new SmartModel( renderer ); + final SmartModel sm = new SmartModel( renderer ); event.modelRegistry.putObject( renderer.rendererInstance.getResourcePath(), sm ); - Map data = new DefaultStateMapper().putStateModelLocations( (Block) reg.item ); - for( Object Loc : data.values() ) + final Map data = new DefaultStateMapper().putStateModelLocations( (Block) reg.item ); + for( final Object Loc : data.values() ) { - ModelResourceLocation res = (ModelResourceLocation) Loc; + final ModelResourceLocation res = (ModelResourceLocation) Loc; event.modelRegistry.putObject( res, sm ); } } @@ -525,16 +525,16 @@ public class ClientHelper extends ServerHelper } @SubscribeEvent - public void wheelEvent( MouseEvent me ) + public void wheelEvent( final MouseEvent me ) { if( me.isCanceled() || me.dwheel == 0 ) { return; } - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer player = mc.thePlayer; - ItemStack is = player.getHeldItem(); + final Minecraft mc = Minecraft.getMinecraft(); + final EntityPlayer player = mc.thePlayer; + final ItemStack is = player.getHeldItem(); if( is != null && is.getItem() instanceof IMouseWheelItem && player.isSneaking() ) { @@ -543,7 +543,7 @@ public class ClientHelper extends ServerHelper NetworkHandler.instance.sendToServer( new PacketValueConfig( "Item", me.dwheel > 0 ? "WheelUp" : "WheelDown" ) ); me.setCanceled( true ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -551,9 +551,9 @@ public class ClientHelper extends ServerHelper } @SubscribeEvent - public void updateTextureSheet( TextureStitchEvent.Pre ev ) + public void updateTextureSheet( final TextureStitchEvent.Pre ev ) { - for( IconReg reg : iconTmp ) + for( final IconReg reg : iconTmp ) { if( reg.item instanceof AEBaseItem ) { @@ -561,7 +561,7 @@ public class ClientHelper extends ServerHelper } else if( reg.item instanceof AEBaseBlock ) { - BlockRenderInfo renderer = ( (AEBaseBlock) reg.item ).getRendererInstance(); + final BlockRenderInfo renderer = ( (AEBaseBlock) reg.item ).getRendererInstance(); if( renderer == null ) { continue; @@ -575,7 +575,7 @@ public class ClientHelper extends ServerHelper //if( ev.map.getTextureType() == ITEM_RENDERER ) { - for( ExtraItemTextures et : ExtraItemTextures.values() ) + for( final ExtraItemTextures et : ExtraItemTextures.values() ) { et.registerIcon( ev.map ); } @@ -583,12 +583,12 @@ public class ClientHelper extends ServerHelper //if( ev.map. == BLOCK_RENDERER ) { - for( ExtraBlockTextures et : ExtraBlockTextures.values() ) + for( final ExtraBlockTextures et : ExtraBlockTextures.values() ) { et.registerIcon( ev.map ); } - for( CableBusTextures cb : CableBusTextures.values() ) + for( final CableBusTextures cb : CableBusTextures.values() ) { cb.registerIcon( ev.map ); } @@ -602,7 +602,7 @@ public class ClientHelper extends ServerHelper public final int meta; public final ModelResourceLocation loc; - public IconReg( Object item2, int meta2, String name2 ) + public IconReg( final Object item2, final int meta2, final String name2 ) { meta = meta2; name = name2; @@ -610,7 +610,7 @@ public class ClientHelper extends ServerHelper loc = null; } - public IconReg( Item item2, int meta2, String name2, ModelResourceLocation res ) + public IconReg( final Item item2, final int meta2, final String name2, final ModelResourceLocation res ) { meta = meta2; name = name2; diff --git a/src/main/java/appeng/client/SmartModel.java b/src/main/java/appeng/client/SmartModel.java index 5a5c7807..a3ac36bd 100644 --- a/src/main/java/appeng/client/SmartModel.java +++ b/src/main/java/appeng/client/SmartModel.java @@ -37,7 +37,7 @@ public class SmartModel implements IBakedModel, ISmartBlockModel,ISmartItemModel @Override public TRSRTransformation apply( - IModelPart part ) + final IModelPart part ) { return TRSRTransformation.identity(); } @@ -45,14 +45,14 @@ public class SmartModel implements IBakedModel, ISmartBlockModel,ISmartItemModel }; public SmartModel( - BlockRenderInfo rendererInstance ) + final BlockRenderInfo rendererInstance ) { AERenderer = rendererInstance; } @Override public List getFaceQuads( - EnumFacing p_177551_1_ ) + final EnumFacing p_177551_1_ ) { return Collections.emptyList(); } @@ -95,10 +95,10 @@ public class SmartModel implements IBakedModel, ISmartBlockModel,ISmartItemModel @Override public IBakedModel handleItemState( - ItemStack stack ) + final ItemStack stack ) { - ModelGenerator helper = new ModelGenerator(); - Block blk = Block.getBlockFromItem( stack.getItem() ); + final ModelGenerator helper = new ModelGenerator(); + final Block blk = Block.getBlockFromItem( stack.getItem() ); helper.setRenderBoundsFromBlock( blk ); AERenderer.rendererInstance.renderInventory( blk instanceof AEBaseBlock ? (AEBaseBlock) blk : null, stack, helper, ItemRenderType.INVENTORY, null ); helper.finalizeModel( true ); @@ -107,12 +107,12 @@ public class SmartModel implements IBakedModel, ISmartBlockModel,ISmartItemModel @Override public IBakedModel handleBlockState( - IBlockState state ) + final IBlockState state ) { - ModelGenerator helper = new ModelGenerator(); - Block blk = state.getBlock(); - BlockPos pos = ( (IExtendedBlockState)state ).getValue( AEBaseTileBlock.AE_BLOCK_POS ); - IBlockAccess world = ( (IExtendedBlockState)state ).getValue( AEBaseTileBlock.AE_BLOCK_ACCESS); + final ModelGenerator helper = new ModelGenerator(); + final Block blk = state.getBlock(); + final BlockPos pos = ( (IExtendedBlockState)state ).getValue( AEBaseTileBlock.AE_BLOCK_POS ); + final IBlockAccess world = ( (IExtendedBlockState)state ).getValue( AEBaseTileBlock.AE_BLOCK_ACCESS); helper.setTranslation( -pos.getX(), -pos.getY(), -pos.getZ() ); helper.setRenderBoundsFromBlock( blk ); helper.blockAccess = world; diff --git a/src/main/java/appeng/client/gui/AEBaseGui.java b/src/main/java/appeng/client/gui/AEBaseGui.java index 985263e4..85dc6c75 100644 --- a/src/main/java/appeng/client/gui/AEBaseGui.java +++ b/src/main/java/appeng/client/gui/AEBaseGui.java @@ -96,28 +96,28 @@ public abstract class AEBaseGui extends GuiContainer boolean useNEI = false; private boolean subGui; - public AEBaseGui( Container container ) + public AEBaseGui( final Container container ) { super( container ); this.subGui = switchingGuis; switchingGuis = false; } - protected static String join( Collection toolTip, String delimiter ) + protected static String join( final Collection toolTip, final String delimiter ) { final Joiner joiner = Joiner.on( delimiter ); return joiner.join( toolTip ); } - protected int getQty( GuiButton btn ) + protected int getQty( final GuiButton btn ) { try { - DecimalFormat df = new DecimalFormat( "+#;-#" ); + final DecimalFormat df = new DecimalFormat( "+#;-#" ); return df.parse( btn.displayString ).intValue(); } - catch( ParseException e ) + catch( final ParseException e ) { return 0; } @@ -134,7 +134,7 @@ public abstract class AEBaseGui extends GuiContainer super.initGui(); final List slots = this.getInventorySlots(); - Iterator i = slots.iterator(); + final Iterator i = slots.iterator(); while( i.hasNext() ) { if( i.next() instanceof SlotME ) @@ -143,7 +143,7 @@ public abstract class AEBaseGui extends GuiContainer } } - for( InternalSlotME me : this.meSlots ) + for( final InternalSlotME me : this.meSlots ) { slots.add( new SlotME( me ) ); } @@ -156,22 +156,22 @@ public abstract class AEBaseGui extends GuiContainer } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { super.drawScreen( mouseX, mouseY, btn ); - boolean hasClicked = Mouse.isButtonDown( 0 ); + final boolean hasClicked = Mouse.isButtonDown( 0 ); if( hasClicked && this.myScrollBar != null ) { this.myScrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop ); } - for( Object c : this.buttonList ) + for( final Object c : this.buttonList ) { if( c instanceof ITooltip ) { - ITooltip tooltip = (ITooltip) c; - int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition; + final ITooltip tooltip = (ITooltip) c; + final int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition; int y = tooltip.yPos(); // ((GuiImgButton) c).yPosition; if( x < mouseX && x + tooltip.getWidth() > mouseX && tooltip.isVisible() ) @@ -183,7 +183,7 @@ public abstract class AEBaseGui extends GuiContainer y = 15; } - String msg = tooltip.getMessage(); + final String msg = tooltip.getMessage(); if( msg != null ) { this.drawTooltip( x + 11, y + 4, 0, msg ); @@ -194,14 +194,14 @@ public abstract class AEBaseGui extends GuiContainer } } - public void drawTooltip( int par2, int par3, int forceWidth, String message ) + public void drawTooltip( final int par2, final int par3, final int forceWidth, final String message ) { GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); GL11.glDisable( GL12.GL_RESCALE_NORMAL ); RenderHelper.disableStandardItemLighting(); GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_DEPTH_TEST ); - String[] var4 = message.split( "\n" ); + final String[] var4 = message.split( "\n" ); if( var4.length > 0 ) { @@ -240,14 +240,14 @@ public abstract class AEBaseGui extends GuiContainer this.zLevel = 300.0F; itemRender.zLevel = 300.0F; - int var10 = -267386864; + final int var10 = -267386864; this.drawGradientRect( var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10 ); this.drawGradientRect( var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10 ); this.drawGradientRect( var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10 ); this.drawGradientRect( var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10 ); this.drawGradientRect( var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10 ); - int var11 = 1347420415; - int var12 = ( var11 & 16711422 ) >> 1 | var11 & -16777216; + final int var11 = 1347420415; + final int var12 = ( var11 & 16711422 ) >> 1 | var11 & -16777216; this.drawGradientRect( var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12 ); this.drawGradientRect( var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12 ); this.drawGradientRect( var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11 ); @@ -284,10 +284,10 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected final void drawGuiContainerForegroundLayer( int x, int y ) + protected final void drawGuiContainerForegroundLayer( final int x, final int y ) { - int ox = this.guiLeft; // (width - xSize) / 2; - int oy = this.guiTop; // (height - ySize) / 2; + final int ox = this.guiLeft; // (width - xSize) / 2; + final int oy = this.guiTop; // (height - ySize) / 2; GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); if( this.myScrollBar != null ) @@ -301,19 +301,19 @@ public abstract class AEBaseGui extends GuiContainer public abstract void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ); @Override - protected final void drawGuiContainerBackgroundLayer( float f, int x, int y ) + protected final void drawGuiContainerBackgroundLayer( final float f, final int x, final int y ) { - int ox = this.guiLeft; // (width - xSize) / 2; - int oy = this.guiTop; // (height - ySize) / 2; + final int ox = this.guiLeft; // (width - xSize) / 2; + final int oy = this.guiTop; // (height - ySize) / 2; GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); this.drawBG( ox, oy, x, y ); final List slots = this.getInventorySlots(); - for( Slot slot : slots ) + for( final Slot slot : slots ) { if( slot instanceof OptionalSlotFake ) { - OptionalSlotFake fs = (OptionalSlotFake) slot; + final OptionalSlotFake fs = (OptionalSlotFake) slot; if( fs.renderDisabled() ) { if( fs.isEnabled() ) @@ -335,15 +335,15 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected void mouseClicked( int xCoord, int yCoord, int btn ) throws IOException + protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) throws IOException { this.drag_click.clear(); if( btn == 1 ) { - for( Object o : this.buttonList ) + for( final Object o : this.buttonList ) { - GuiButton guibutton = (GuiButton) o; + final GuiButton guibutton = (GuiButton) o; if( guibutton.mousePressed( this.mc, xCoord, yCoord ) ) { super.mouseClicked( xCoord, yCoord, 0 ); @@ -356,19 +356,19 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected void mouseClickMove( int x, int y, int c, long d ) + protected void mouseClickMove( final int x, final int y, final int c, final long d ) { - Slot slot = this.getSlot( x, y ); - ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack(); + final Slot slot = this.getSlot( x, y ); + final ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack(); if( slot instanceof SlotFake && itemstack != null ) { this.drag_click.add( slot ); if( this.drag_click.size() > 1 ) { - for( Slot dr : this.drag_click ) + for( final Slot dr : this.drag_click ) { - PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 ); NetworkHandler.instance.sendToServer( p ); } } @@ -380,9 +380,9 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected void handleMouseClick( Slot slot, int slotIdx, int ctrlDown, int key ) + protected void handleMouseClick( final Slot slot, final int slotIdx, final int ctrlDown, final int key ) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + final EntityPlayer player = Minecraft.getMinecraft().thePlayer; if( slot instanceof SlotFake ) { @@ -393,7 +393,7 @@ public abstract class AEBaseGui extends GuiContainer return; } - PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); NetworkHandler.instance.sendToServer( p ); return; @@ -410,7 +410,7 @@ public abstract class AEBaseGui extends GuiContainer { NetworkHandler.instance.sendToServer( ( (SlotPatternTerm) slot ).getRequest( key == 1 ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -432,7 +432,7 @@ public abstract class AEBaseGui extends GuiContainer action = ctrlDown == 1 ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM; } - PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); NetworkHandler.instance.sendToServer( p ); return; @@ -456,7 +456,7 @@ public abstract class AEBaseGui extends GuiContainer } ( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack ); - PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 ); NetworkHandler.instance.sendToServer( p ); return; } @@ -491,7 +491,7 @@ public abstract class AEBaseGui extends GuiContainer if( action != null ) { - PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).mySlot.id ); + final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).mySlot.id ); NetworkHandler.instance.sendToServer( p ); } @@ -529,7 +529,7 @@ public abstract class AEBaseGui extends GuiContainer } else if( player.capabilities.isCreativeMode ) { - IAEItemStack slotItem = ( (SlotME) slot ).getAEStack(); + final IAEItemStack slotItem = ( (SlotME) slot ).getAEStack(); if( slotItem != null ) { action = InventoryAction.CREATIVE_DUPLICATE; @@ -545,7 +545,7 @@ public abstract class AEBaseGui extends GuiContainer if( action != null ) { ( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack ); - PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 ); + final PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 ); NetworkHandler.instance.sendToServer( p ); } @@ -575,7 +575,7 @@ public abstract class AEBaseGui extends GuiContainer // a replica of the weird broken vanilla feature. final List slots = this.getInventorySlots(); - for( Slot inventorySlot : slots ) + for( final Slot inventorySlot : slots ) { if( inventorySlot != null && inventorySlot.canTakeStack( this.mc.thePlayer ) && inventorySlot.getHasStack() && inventorySlot.inventory == slot.inventory && Container.canAddItemToSlot( inventorySlot, this.dbl_whichItem, true ) ) { @@ -591,15 +591,15 @@ public abstract class AEBaseGui extends GuiContainer } @Override - protected boolean checkHotbarKeys( int keyCode ) + protected boolean checkHotbarKeys( final int keyCode ) { - Slot theSlot; + final Slot theSlot; try { theSlot = ObfuscationReflectionHelper.getPrivateValue( GuiContainer.class, this, "theSlot", "field_147006_u", "f" ); } - catch( Throwable t ) + catch( final Throwable t ) { return false; } @@ -611,7 +611,7 @@ public abstract class AEBaseGui extends GuiContainer if( keyCode == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() ) { final List slots = this.getInventorySlots(); - for( Slot s : slots ) + for( final Slot s : slots ) { if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() ) { @@ -629,7 +629,7 @@ public abstract class AEBaseGui extends GuiContainer } else { - for( Slot s : slots ) + for( final Slot s : slots ) { if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() ) { @@ -652,10 +652,10 @@ public abstract class AEBaseGui extends GuiContainer this.subGui = true; // in case the gui is reopened later ( i'm looking at you NEI ) } - protected Slot getSlot( int mouseX, int mouseY ) + protected Slot getSlot( final int mouseX, final int mouseY ) { final List slots = this.getInventorySlots(); - for( Slot slot : slots ) + for( final Slot slot : slots ) { // isPointInRegion if( this.isPointInRegion( slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY ) ) @@ -674,11 +674,11 @@ public abstract class AEBaseGui extends GuiContainer { super.handleMouseInput(); - int i = Mouse.getEventDWheel(); + final int i = Mouse.getEventDWheel(); if( i != 0 && isShiftKeyDown() ) { - int x = Mouse.getEventX() * this.width / this.mc.displayWidth; - int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; + final int x = Mouse.getEventX() * this.width / this.mc.displayWidth; + final int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; this.mouseWheelEvent( x, y, i / Math.abs( i ) ); } else if( i != 0 && this.myScrollBar != null ) @@ -687,21 +687,21 @@ public abstract class AEBaseGui extends GuiContainer } } - protected void mouseWheelEvent( int x, int y, int wheel ) + protected void mouseWheelEvent( final int x, final int y, final int wheel ) { - Slot slot = this.getSlot( x, y ); + final Slot slot = this.getSlot( x, y ); if( slot instanceof SlotME ) { - IAEItemStack item = ( (SlotME) slot ).getAEStack(); + final IAEItemStack item = ( (SlotME) slot ).getAEStack(); if( item != null ) { ( (AEBaseContainer) this.inventorySlots ).setTargetStack( item ); - InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP; - int times = Math.abs( wheel ); + final InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP; + final int times = Math.abs( wheel ); final int inventorySize = this.getInventorySlots().size(); for( int h = 0; h < times; h++ ) { - PacketInventoryAction p = new PacketInventoryAction( direction, inventorySize, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( direction, inventorySize, 0 ); NetworkHandler.instance.sendToServer( p ); } } @@ -713,13 +713,13 @@ public abstract class AEBaseGui extends GuiContainer return true; } - public void bindTexture( String base, String file ) + public void bindTexture( final String base, final String file ) { - ResourceLocation loc = new ResourceLocation( base, "textures/" + file ); + final ResourceLocation loc = new ResourceLocation( base, "textures/" + file ); this.mc.getTextureManager().bindTexture( loc ); } - protected void drawItem( int x, int y, ItemStack is ) + protected void drawItem( final int x, final int y, final ItemStack is ) { this.zLevel = 100.0F; itemRender.zLevel = 100.0F; @@ -736,7 +736,7 @@ public abstract class AEBaseGui extends GuiContainer this.zLevel = 0.0F; } - protected String getGuiDisplayName( String in ) + protected String getGuiDisplayName( final String in ) { return this.hasCustomInventoryName() ? this.getInventoryName() : in; } @@ -755,16 +755,16 @@ public abstract class AEBaseGui extends GuiContainer return ( (AEBaseContainer) this.inventorySlots ).customName; } - public void a( Slot s ) + public void a( final Slot s ) { this.drawSlot( s ); } - public void drawSlot( Slot s ) + public void drawSlot( final Slot s ) { if( s instanceof SlotME ) { - RenderItem pIR = this.setItemRender( this.aeRenderItem ); + final RenderItem pIR = this.setItemRender( this.aeRenderItem ); try { this.zLevel = 100.0F; @@ -784,7 +784,7 @@ public abstract class AEBaseGui extends GuiContainer this.safeDrawSlot( s ); } - catch( Exception err ) + catch( final Exception err ) { AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() ); } @@ -795,10 +795,10 @@ public abstract class AEBaseGui extends GuiContainer { try { - ItemStack is = s.getStack(); + final ItemStack is = s.getStack(); if( s instanceof AppEngSlot && ( ( (AppEngSlot) s ).renderIconWithItem() || is == null ) && ( ( (AppEngSlot) s ).shouldDisplay() ) ) { - AppEngSlot aes = (AppEngSlot) s; + final AppEngSlot aes = (AppEngSlot) s; if( aes.getIcon() >= 0 ) { this.bindTexture( "guis/states.png" ); @@ -806,36 +806,36 @@ public abstract class AEBaseGui extends GuiContainer GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); try { - int uv_y = (int) Math.floor( aes.getIcon() / 16 ); - int uv_x = aes.getIcon() - uv_y * 16; + final int uv_y = (int) Math.floor( aes.getIcon() / 16 ); + final int uv_x = aes.getIcon() - uv_y * 16; GL11.glEnable( GL11.GL_BLEND ); GL11.glDisable( GL11.GL_LIGHTING ); GL11.glEnable( GL11.GL_TEXTURE_2D ); GL11.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA ); GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); - float par1 = aes.xDisplayPosition; - float par2 = aes.yDisplayPosition; - float par3 = uv_x * 16; - float par4 = uv_y * 16; + final float par1 = aes.xDisplayPosition; + final float par2 = aes.yDisplayPosition; + final float par3 = uv_x * 16; + final float par4 = uv_y * 16; - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + final Tessellator tessellator = Tessellator.getInstance(); + final WorldRenderer worldrenderer = tessellator.getWorldRenderer(); worldrenderer.startDrawingQuads(); worldrenderer.setColorRGBA_F( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ); - float f1 = 0.00390625F; - float f = 0.00390625F; - float par6 = 16; + final float f1 = 0.00390625F; + final float f = 0.00390625F; + final float par6 = 16; worldrenderer.addVertexWithUV( par1 + 0, par2 + par6, this.zLevel, ( par3 + 0 ) * f, ( par4 + par6 ) * f1 ); - float par5 = 16; + final float par5 = 16; worldrenderer.addVertexWithUV( par1 + par5, par2 + par6, this.zLevel, ( par3 + par5 ) * f, ( par4 + par6 ) * f1 ); worldrenderer.addVertexWithUV( par1 + par5, par2 + 0, this.zLevel, ( par3 + par5 ) * f, ( par4 + 0 ) * f1 ); worldrenderer.addVertexWithUV( par1 + 0, par2 + 0, this.zLevel, ( par3 + 0 ) * f, ( par4 + 0 ) * f1 ); worldrenderer.setColorRGBA_F( 1.0f, 1.0f, 1.0f, 1.0f ); tessellator.draw(); } - catch( Exception err ) + catch( final Exception err ) { } GL11.glPopAttrib(); @@ -853,7 +853,7 @@ public abstract class AEBaseGui extends GuiContainer { isValid = ( (SlotRestrictedInput) s ).isValid( is, this.mc.theWorld ); } - catch( Exception err ) + catch( final Exception err ) { AELog.error( err ); } @@ -887,7 +887,7 @@ public abstract class AEBaseGui extends GuiContainer return; } - catch( Exception err ) + catch( final Exception err ) { AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() ); } @@ -896,7 +896,7 @@ public abstract class AEBaseGui extends GuiContainer this.safeDrawSlot( s ); } - private RenderItem setItemRender( RenderItem item ) + private RenderItem setItemRender( final RenderItem item ) { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ) ) { @@ -904,7 +904,7 @@ public abstract class AEBaseGui extends GuiContainer } else { - RenderItem ri = itemRender; + final RenderItem ri = itemRender; itemRender = item; return ri; } @@ -915,24 +915,24 @@ public abstract class AEBaseGui extends GuiContainer return true; } - private void safeDrawSlot( Slot s ) + private void safeDrawSlot( final Slot s ) { try { GuiContainer.class.getDeclaredMethod( "func_146977_a_original", Slot.class ).invoke( this, s ); } - catch( Exception err ) + catch( final Exception err ) { } } - public void bindTexture( String file ) + public void bindTexture( final String file ) { - ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/" + file ); + final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/" + file ); this.mc.getTextureManager().bindTexture( loc ); } - public void func_146977_a( Slot s ) + public void func_146977_a( final Slot s ) { this.drawSlot( s ); } diff --git a/src/main/java/appeng/client/gui/AEBaseMEGui.java b/src/main/java/appeng/client/gui/AEBaseMEGui.java index 4d9950ba..a7c09648 100644 --- a/src/main/java/appeng/client/gui/AEBaseMEGui.java +++ b/src/main/java/appeng/client/gui/AEBaseMEGui.java @@ -35,28 +35,28 @@ import appeng.core.localization.ButtonToolTips; public abstract class AEBaseMEGui extends AEBaseGui { - public AEBaseMEGui( Container container ) + public AEBaseMEGui( final Container container ) { super( container ); } - public List handleItemTooltip( ItemStack stack, int mouseX, int mouseY, List currentToolTip ) + public List handleItemTooltip( final ItemStack stack, final int mouseX, final int mouseY, final List currentToolTip ) { if( stack != null ) { - Slot s = this.getSlot( mouseX, mouseY ); + final Slot s = this.getSlot( mouseX, mouseY ); if( s instanceof SlotME ) { - int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; + final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; IAEItemStack myStack = null; try { - SlotME theSlotField = (SlotME) s; + final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } @@ -96,28 +96,28 @@ public abstract class AEBaseMEGui extends AEBaseGui // Vanilla version... // protected void drawItemStackTooltip(ItemStack stack, int x, int y) @Override - protected void renderToolTip( ItemStack stack, int x, int y ) + protected void renderToolTip( final ItemStack stack, final int x, final int y ) { - Slot s = this.getSlot( x, y ); + final Slot s = this.getSlot( x, y ); if( s instanceof SlotME && stack != null ) { - int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; + final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999; IAEItemStack myStack = null; try { - SlotME theSlotField = (SlotME) s; + final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } if( myStack != null ) { @SuppressWarnings( "unchecked" ) - List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); + final List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); if( myStack.getStackSize() > BigNumber || ( myStack.getStackSize() > 1 && stack.isItemDamaged() ) ) { @@ -133,7 +133,7 @@ public abstract class AEBaseMEGui extends AEBaseGui } else if( stack.stackSize > BigNumber ) { - List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); + final List var4 = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); var4.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.stackSize ) ); this.drawTooltip( x, y, 0, join( var4, "\n" ) ); return; diff --git a/src/main/java/appeng/client/gui/GuiNull.java b/src/main/java/appeng/client/gui/GuiNull.java index 743b3c33..e8ac394d 100644 --- a/src/main/java/appeng/client/gui/GuiNull.java +++ b/src/main/java/appeng/client/gui/GuiNull.java @@ -25,18 +25,18 @@ import net.minecraft.inventory.Container; public class GuiNull extends AEBaseGui { - public GuiNull( Container container ) + public GuiNull( final Container container ) { super( container ); } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { } diff --git a/src/main/java/appeng/client/gui/config/AEConfigGui.java b/src/main/java/appeng/client/gui/config/AEConfigGui.java index 281e9e05..2af1206f 100644 --- a/src/main/java/appeng/client/gui/config/AEConfigGui.java +++ b/src/main/java/appeng/client/gui/config/AEConfigGui.java @@ -34,16 +34,16 @@ import appeng.core.AppEng; public class AEConfigGui extends GuiConfig { - public AEConfigGui( GuiScreen parent ) + public AEConfigGui( final GuiScreen parent ) { super( parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath( AEConfig.instance.getFilePath() ) ); } private static List getConfigElements() { - List list = new ArrayList(); + final List list = new ArrayList(); - for( String cat : AEConfig.instance.getCategoryNames() ) + for( final String cat : AEConfig.instance.getCategoryNames() ) { if( cat.equals( "versionchecker" ) ) { @@ -55,14 +55,14 @@ public class AEConfigGui extends GuiConfig continue; } - ConfigCategory cc = AEConfig.instance.getCategory( cat ); + final ConfigCategory cc = AEConfig.instance.getCategory( cat ); if( cc.isChild() ) { continue; } - ConfigElement ce = new ConfigElement( cc ); + final ConfigElement ce = new ConfigElement( cc ); list.add( ce ); } diff --git a/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java b/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java index 12e825ff..8a35e548 100644 --- a/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java +++ b/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java @@ -30,7 +30,7 @@ public class AEConfigGuiFactory implements IModGuiFactory { @Override - public void initialize( Minecraft minecraftInstance ) + public void initialize( final Minecraft minecraftInstance ) { } @@ -48,7 +48,7 @@ public class AEConfigGuiFactory implements IModGuiFactory } @Override - public RuntimeOptionGuiHandler getHandlerFor( RuntimeOptionCategoryElement element ) + public RuntimeOptionGuiHandler getHandlerFor( final RuntimeOptionCategoryElement element ) { return null; } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java index c8119d17..b5ece080 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java @@ -54,7 +54,7 @@ public class GuiCellWorkbench extends GuiUpgradeable GuiImgButton partition; GuiToggleButton copyMode; - public GuiCellWorkbench( InventoryPlayer inventoryPlayer, TileCellWorkbench te ) + public GuiCellWorkbench( final InventoryPlayer inventoryPlayer, final TileCellWorkbench te ) { super( new ContainerCellWorkbench( inventoryPlayer, te ) ); this.workbench = (ContainerCellWorkbench) this.inventorySlots; @@ -77,7 +77,7 @@ public class GuiCellWorkbench extends GuiUpgradeable } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.handleButtonVisibility(); @@ -95,7 +95,7 @@ public class GuiCellWorkbench extends GuiUpgradeable this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18 ); this.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7 ); - int dx = this.workbench.availableUpgrades() - 8; + final int dx = this.workbench.availableUpgrades() - 8; this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 ); if( dx == 8 ) { @@ -114,7 +114,7 @@ public class GuiCellWorkbench extends GuiUpgradeable this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + 8 * 18 ); this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( 8 ) * 18 ), 186, 151, 35 - 8, 7 ); - int dx = this.workbench.availableUpgrades() - 16; + final int dx = this.workbench.availableUpgrades() - 16; this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 ); if( dx == 8 ) { @@ -138,10 +138,10 @@ public class GuiCellWorkbench extends GuiUpgradeable this.copyMode.setState( this.workbench.copyMode == CopyMode.CLEAR_ON_REMOVE ); boolean hasFuzzy = false; - IInventory inv = this.workbench.getCellUpgradeInventory(); + final IInventory inv = this.workbench.getCellUpgradeInventory(); for( int x = 0; x < inv.getSizeInventory(); x++ ) { - ItemStack is = inv.getStackInSlot( x ); + final ItemStack is = inv.getStackInSlot( x ); if( is != null && is.getItem() instanceof IUpgradeModule ) { if( ( (IUpgradeModule) is.getItem() ).getType( is ) == Upgrades.FUZZY ) @@ -172,7 +172,7 @@ public class GuiCellWorkbench extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { try { @@ -190,7 +190,7 @@ public class GuiCellWorkbench extends GuiUpgradeable } else if( btn == this.fuzzyMode ) { - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); FuzzyMode fz = (FuzzyMode) this.fuzzyMode.getCurrentValue(); fz = Platform.rotateEnum( fz, backwards, Settings.FUZZY_MODE.getPossibleValues() ); @@ -202,7 +202,7 @@ public class GuiCellWorkbench extends GuiUpgradeable super.actionPerformed( btn ); } } - catch( IOException ignored ) + catch( final IOException ignored ) { } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiChest.java b/src/main/java/appeng/client/gui/implementations/GuiChest.java index e48a946a..6b932858 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiChest.java +++ b/src/main/java/appeng/client/gui/implementations/GuiChest.java @@ -38,14 +38,14 @@ public class GuiChest extends AEBaseGui GuiTabButton priority; - public GuiChest( InventoryPlayer inventoryPlayer, TileChest te ) + public GuiChest( final InventoryPlayer inventoryPlayer, final TileChest te ) { super( new ContainerChest( inventoryPlayer, te ) ); this.ySize = 166; } @Override - protected void actionPerformed( GuiButton par1GuiButton ) throws IOException + protected void actionPerformed( final GuiButton par1GuiButton ) throws IOException { super.actionPerformed( par1GuiButton ); @@ -64,14 +64,14 @@ public class GuiChest extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Chest.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/chest.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java index d1c3ed93..23f64ab7 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java @@ -45,7 +45,7 @@ public class GuiCondenser extends AEBaseGui GuiProgressBar pb; GuiImgButton mode; - public GuiCondenser( InventoryPlayer inventoryPlayer, TileCondenser te ) + public GuiCondenser( final InventoryPlayer inventoryPlayer, final TileCondenser te ) { super( new ContainerCondenser( inventoryPlayer, te ) ); this.cvc = (ContainerCondenser) this.inventorySlots; @@ -53,11 +53,11 @@ public class GuiCondenser extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( this.mode == btn ) { @@ -79,7 +79,7 @@ public class GuiCondenser extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -89,7 +89,7 @@ public class GuiCondenser extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/condenser.png" ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java index 12375e8d..27e84269 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java @@ -65,7 +65,7 @@ public class GuiCraftAmount extends AEBaseGui private GuiBridge originalGui; @Reflected - public GuiCraftAmount( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiCraftAmount( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( new ContainerCraftAmount( inventoryPlayer, te ) ); } @@ -75,10 +75,10 @@ public class GuiCraftAmount extends AEBaseGui { super.initGui(); - int a = AEConfig.instance.craftItemsByStackAmounts( 0 ); - int b = AEConfig.instance.craftItemsByStackAmounts( 1 ); - int c = AEConfig.instance.craftItemsByStackAmounts( 2 ); - int d = AEConfig.instance.craftItemsByStackAmounts( 3 ); + final int a = AEConfig.instance.craftItemsByStackAmounts( 0 ); + final int b = AEConfig.instance.craftItemsByStackAmounts( 1 ); + final int c = AEConfig.instance.craftItemsByStackAmounts( 2 ); + final int d = AEConfig.instance.craftItemsByStackAmounts( 3 ); this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a ) ); this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 26, 28, 20, "+" + b ) ); @@ -93,13 +93,13 @@ public class GuiCraftAmount extends AEBaseGui this.buttonList.add( this.next = new GuiButton( 0, this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.getLocal() ) ); ItemStack myIcon = null; - Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget(); + final Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget(); final IDefinitions definitions = AEApi.instance().definitions(); final IParts parts = definitions.parts(); if( target instanceof WirelessTerminalGuiObject ) { - for( ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() ) { myIcon = wirelessTerminalStack; } @@ -109,7 +109,7 @@ public class GuiCraftAmount extends AEBaseGui if( target instanceof PartTerminal ) { - for( ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() ) { myIcon = stack; } @@ -118,7 +118,7 @@ public class GuiCraftAmount extends AEBaseGui if( target instanceof PartCraftingTerminal ) { - for( ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() ) { myIcon = stack; } @@ -127,7 +127,7 @@ public class GuiCraftAmount extends AEBaseGui if( target instanceof PartPatternTerminal ) { - for( ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() ) { myIcon = stack; } @@ -149,13 +149,13 @@ public class GuiCraftAmount extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( GuiText.SelectAmount.getLocal(), 8, 6, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.next.displayString = isShiftKeyDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal(); @@ -167,7 +167,7 @@ public class GuiCraftAmount extends AEBaseGui Long.parseLong( this.amountToCraft.getText() ); this.next.enabled = this.amountToCraft.getText().length() > 0; } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { this.next.enabled = false; } @@ -176,7 +176,7 @@ public class GuiCraftAmount extends AEBaseGui } @Override - protected void keyTyped( char character, int key ) throws IOException + protected void keyTyped( final char character, final int key ) throws IOException { if( !this.checkHotbarKeys( key ) ) { @@ -207,13 +207,13 @@ public class GuiCraftAmount extends AEBaseGui out = "0"; } - long result = Long.parseLong( out ); + final long result = Long.parseLong( out ); if( result < 0 ) { this.amountToCraft.setText( "1" ); } } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // :P } @@ -226,7 +226,7 @@ public class GuiCraftAmount extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); @@ -243,14 +243,14 @@ public class GuiCraftAmount extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) ); } } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // nope.. this.amountToCraft.setText( "1" ); } - boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; if( isPlus || isMinus ) { @@ -258,7 +258,7 @@ public class GuiCraftAmount extends AEBaseGui } } - private void addQty( int i ) + private void addQty( final int i ) { try { @@ -298,7 +298,7 @@ public class GuiCraftAmount extends AEBaseGui Integer.parseInt( out ); this.amountToCraft.setText( out ); } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // :P } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java index 7c8ebc12..853d93f2 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java @@ -74,7 +74,7 @@ public class GuiCraftConfirm extends AEBaseGui GuiButton selectCPU; int tooltip = -1; - public GuiCraftConfirm( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiCraftConfirm( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( new ContainerCraftConfirm( inventoryPlayer, te ) ); this.xSize = 238; @@ -131,25 +131,25 @@ public class GuiCraftConfirm extends AEBaseGui } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { this.updateCPUButtonText(); this.start.enabled = !( this.ccc.noCPU || this.isSimulation() ); this.selectCPU.enabled = !this.isSimulation(); - int gx = ( this.width - this.xSize ) / 2; - int gy = ( this.height - this.ySize ) / 2; + final int gx = ( this.width - this.xSize ) / 2; + final int gy = ( this.height - this.ySize ) / 2; this.tooltip = -1; - int offY = 23; + final int offY = 23; int y = 0; int x = 0; for( int z = 0; z <= 4 * 5; z++ ) { - int minX = gx + 9 + x * 67; - int minY = gy + 22 + y * offY; + final int minX = gx + 9 + x * 67; + final int minY = gy + 22 + y * offY; if( minX < mouseX && minX + 67 > mouseX ) { @@ -179,7 +179,7 @@ public class GuiCraftConfirm extends AEBaseGui { if( this.ccc.myName.length() > 0 ) { - String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) ); + final String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) ); btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name; } else @@ -202,11 +202,11 @@ public class GuiCraftConfirm extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { - long BytesUsed = this.ccc.bytesUsed; - String byteUsed = NumberFormat.getInstance().format( BytesUsed ); - String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal(); + final long BytesUsed = this.ccc.bytesUsed; + final String byteUsed = NumberFormat.getInstance().format( BytesUsed ); + final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal(); this.fontRendererObj.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 ); String dsp = null; @@ -220,36 +220,36 @@ public class GuiCraftConfirm extends AEBaseGui dsp = this.ccc.cpuBytesAvail > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.cpuBytesAvail + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.cpuCoProcessors ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A"; } - int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2; + final int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2; this.fontRendererObj.drawString( dsp, offset, 165, 4210752 ); - int sectionLength = 67; + final int sectionLength = 67; int x = 0; int y = 0; - int xo = 9; - int yo = 22; - int viewStart = this.myScrollBar.getCurrentScroll() * 3; - int viewEnd = viewStart + 3 * this.rows; + final int xo = 9; + final int yo = 22; + final int viewStart = this.myScrollBar.getCurrentScroll() * 3; + final int viewEnd = viewStart + 3 * this.rows; String dspToolTip = ""; - List lineList = new LinkedList(); + final List lineList = new LinkedList(); int toolPosX = 0; int toolPosY = 0; - int offY = 23; + final int offY = 23; for( int z = viewStart; z < Math.min( viewEnd, this.visual.size() ); z++ ) { - IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); + final IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); if( refStack != null ) { GL11.glPushMatrix(); GL11.glScaled( 0.5, 0.5, 0.5 ); - IAEItemStack stored = this.storage.findPrecise( refStack ); - IAEItemStack pendingStack = this.pending.findPrecise( refStack ); - IAEItemStack missingStack = this.missing.findPrecise( refStack ); + final IAEItemStack stored = this.storage.findPrecise( refStack ); + final IAEItemStack pendingStack = this.pending.findPrecise( refStack ); + final IAEItemStack missingStack = this.missing.findPrecise( refStack ); int lines = 0; @@ -266,7 +266,7 @@ public class GuiCraftConfirm extends AEBaseGui lines++; } - int negY = ( ( lines - 1 ) * 5 ) / 2; + final int negY = ( ( lines - 1 ) * 5 ) / 2; int downY = 0; if( stored != null && stored.getStackSize() > 0 ) @@ -282,7 +282,7 @@ public class GuiCraftConfirm extends AEBaseGui } str = GuiText.FromStorage.getLocal() + ": " + str; - int w = 4 + this.fontRendererObj.getStringWidth( str ); + final int w = 4 + this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 ); if( this.tooltip == z - viewStart ) @@ -307,7 +307,7 @@ public class GuiCraftConfirm extends AEBaseGui } str = GuiText.Missing.getLocal() + ": " + str; - int w = 4 + this.fontRendererObj.getStringWidth( str ); + final int w = 4 + this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 ); if( this.tooltip == z - viewStart ) @@ -332,7 +332,7 @@ public class GuiCraftConfirm extends AEBaseGui } str = GuiText.ToCraft.getLocal() + ": " + str; - int w = 4 + this.fontRendererObj.getStringWidth( str ); + final int w = 4 + this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 ); if( this.tooltip == z - viewStart ) @@ -342,10 +342,10 @@ public class GuiCraftConfirm extends AEBaseGui } GL11.glPopMatrix(); - int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19; - int posY = y * offY + yo; + final int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19; + final int posY = y * offY + yo; - ItemStack is = refStack.copy().getItemStack(); + final ItemStack is = refStack.copy().getItemStack(); if( this.tooltip == z - viewStart ) { @@ -364,8 +364,8 @@ public class GuiCraftConfirm extends AEBaseGui if( red ) { - int startX = x * ( 1 + sectionLength ) + xo; - int startY = posY - 4; + final int startX = x * ( 1 + sectionLength ) + xo; + final int startY = posY - 4; drawRect( startX, startY, startX + sectionLength, startY + offY, 0x1AFF0000 ); } @@ -388,7 +388,7 @@ public class GuiCraftConfirm extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.setScrollBar(); this.bindTexture( "guis/craftingreport.png" ); @@ -397,41 +397,41 @@ public class GuiCraftConfirm extends AEBaseGui private void setScrollBar() { - int size = this.visual.size(); + final int size = this.visual.size(); this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 114 ); this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - this.rows, 1 ); } - public void postUpdate( List list, byte ref ) + public void postUpdate( final List list, final byte ref ) { switch( ref ) { case 0: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.storage, l ); } break; case 1: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.pending, l ); } break; case 2: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.missing, l ); } break; } - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { - long amt = this.getTotal( l ); + final long amt = this.getTotal( l ); if( amt <= 0 ) { @@ -439,7 +439,7 @@ public class GuiCraftConfirm extends AEBaseGui } else { - IAEItemStack is = this.findVisualStack( l ); + final IAEItemStack is = this.findVisualStack( l ); is.setStackSize( amt ); } } @@ -447,7 +447,7 @@ public class GuiCraftConfirm extends AEBaseGui this.setScrollBar(); } - private void handleInput( IItemList s, IAEItemStack l ) + private void handleInput( final IItemList s, final IAEItemStack l ) { IAEItemStack a = s.findPrecise( l ); @@ -473,11 +473,11 @@ public class GuiCraftConfirm extends AEBaseGui } } - private long getTotal( IAEItemStack is ) + private long getTotal( final IAEItemStack is ) { - IAEItemStack a = this.storage.findPrecise( is ); - IAEItemStack c = this.pending.findPrecise( is ); - IAEItemStack m = this.missing.findPrecise( is ); + final IAEItemStack a = this.storage.findPrecise( is ); + final IAEItemStack c = this.pending.findPrecise( is ); + final IAEItemStack m = this.missing.findPrecise( is ); long total = 0; @@ -499,12 +499,12 @@ public class GuiCraftConfirm extends AEBaseGui return total; } - private void deleteVisualStack( IAEItemStack l ) + private void deleteVisualStack( final IAEItemStack l ) { - Iterator i = this.visual.iterator(); + final Iterator i = this.visual.iterator(); while( i.hasNext() ) { - IAEItemStack o = i.next(); + final IAEItemStack o = i.next(); if( o.equals( l ) ) { i.remove(); @@ -513,9 +513,9 @@ public class GuiCraftConfirm extends AEBaseGui } } - private IAEItemStack findVisualStack( IAEItemStack l ) + private IAEItemStack findVisualStack( final IAEItemStack l ) { - for( IAEItemStack o : this.visual ) + for( final IAEItemStack o : this.visual ) { if( o.equals( l ) ) { @@ -523,13 +523,13 @@ public class GuiCraftConfirm extends AEBaseGui } } - IAEItemStack stack = l.copy(); + final IAEItemStack stack = l.copy(); this.visual.add( stack ); return stack; } @Override - protected void keyTyped( char character, int key ) throws IOException + protected void keyTyped( final char character, final int key ) throws IOException { if( !this.checkHotbarKeys( key ) ) { @@ -542,11 +542,11 @@ public class GuiCraftConfirm extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.selectCPU ) { @@ -554,7 +554,7 @@ public class GuiCraftConfirm extends AEBaseGui { NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -571,7 +571,7 @@ public class GuiCraftConfirm extends AEBaseGui { NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Start", "Start" ) ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java index c1f960da..39badc71 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java @@ -92,12 +92,12 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource private GuiButton cancel; private int tooltip = -1; - public GuiCraftingCPU( InventoryPlayer inventoryPlayer, Object te ) + public GuiCraftingCPU( final InventoryPlayer inventoryPlayer, final Object te ) { this( new ContainerCraftingCPU( inventoryPlayer, te ) ); } - protected GuiCraftingCPU( ContainerCraftingCPU container ) + protected GuiCraftingCPU( final ContainerCraftingCPU container ) { super( container ); this.craftingCpu = container; @@ -115,7 +115,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); @@ -125,7 +125,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource { NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileCrafting.Cancel", "Cancel" ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -143,14 +143,14 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource private void setScrollBar() { - int size = this.visual.size(); + final int size = this.visual.size(); this.myScrollBar.setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT ); this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 ); } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { this.cancel.enabled = !this.visual.isEmpty(); @@ -164,8 +164,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource int x = 0; for( int z = 0; z <= 4 * 5; z++ ) { - int minX = gx + 9 + x * 67; - int minY = gy + 22 + y * offY; + final int minX = gx + 9 + x * 67; + final int minY = gy + 22 + y * offY; if( minX < mouseX && minX + 67 > mouseX ) { @@ -189,7 +189,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() ); @@ -208,16 +208,16 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource final int viewEnd = viewStart + 3 * 6; String dspToolTip = ""; - List lineList = new LinkedList(); + final List lineList = new LinkedList(); int toolPosX = 0; int toolPosY = 0; - int offY = 23; + final int offY = 23; final ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE; for( int z = viewStart; z < Math.min( viewEnd, this.visual.size() ); z++ ) { - IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); + final IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z ); if( refStack != null ) { GL11.glPushMatrix(); @@ -248,19 +248,19 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource if( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) ) { - int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | BACKGROUND_ALPHA; - int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2; - int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2; + final int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | BACKGROUND_ALPHA; + final int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2; + final int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2; drawRect( startX, startY, startX + ( SECTION_LENGTH * 2 ), startY + ( offY * 2 ) - 2, bgColor ); } - int negY = ( ( lines - 1 ) * 5 ) / 2; + final int negY = ( ( lines - 1 ) * 5 ) / 2; int downY = 0; if( stored != null && stored.getStackSize() > 0 ) { final String str = GuiText.Stored.getLocal() + ": " + converter.toWideReadableForm( stored.getStackSize() ); - int w = 4 + this.fontRendererObj.getStringWidth( str ); + final int w = 4 + this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR ); if( this.tooltip == z - viewStart ) @@ -300,10 +300,10 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } GL11.glPopMatrix(); - int posX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19; - int posY = y * offY + ITEMSTACK_TOP_OFFSET; + final int posX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19; + final int posY = y * offY + ITEMSTACK_TOP_OFFSET; - ItemStack is = refStack.copy().getItemStack(); + final ItemStack is = refStack.copy().getItemStack(); if( this.tooltip == z - viewStart ) { @@ -339,41 +339,41 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/craftingcpu.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } - public void postUpdate( List list, byte ref ) + public void postUpdate( final List list, final byte ref ) { switch( ref ) { case 0: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.storage, l ); } break; case 1: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.active, l ); } break; case 2: - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { this.handleInput( this.pending, l ); } break; } - for( IAEItemStack l : list ) + for( final IAEItemStack l : list ) { - long amt = this.getTotal( l ); + final long amt = this.getTotal( l ); if( amt <= 0 ) { @@ -381,7 +381,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } else { - IAEItemStack is = this.findVisualStack( l ); + final IAEItemStack is = this.findVisualStack( l ); is.setStackSize( amt ); } } @@ -389,7 +389,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource this.setScrollBar(); } - private void handleInput( IItemList s, IAEItemStack l ) + private void handleInput( final IItemList s, final IAEItemStack l ) { IAEItemStack a = s.findPrecise( l ); @@ -415,7 +415,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } } - private long getTotal( IAEItemStack is ) + private long getTotal( final IAEItemStack is ) { final IAEItemStack a = this.storage.findPrecise( is ); final IAEItemStack b = this.active.findPrecise( is ); @@ -441,13 +441,13 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource return total; } - private void deleteVisualStack( IAEItemStack l ) + private void deleteVisualStack( final IAEItemStack l ) { final Iterator i = this.visual.iterator(); while( i.hasNext() ) { - IAEItemStack o = i.next(); + final IAEItemStack o = i.next(); if( o.equals( l ) ) { i.remove(); @@ -456,9 +456,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource } } - private IAEItemStack findVisualStack( IAEItemStack l ) + private IAEItemStack findVisualStack( final IAEItemStack l ) { - for( IAEItemStack o : this.visual ) + for( final IAEItemStack o : this.visual ) { if( o.equals( l ) ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java index 09e99aec..b257ae2a 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java @@ -59,18 +59,18 @@ public class GuiCraftingStatus extends GuiCraftingCPU GuiBridge originalGui; ItemStack myIcon = null; - public GuiCraftingStatus( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiCraftingStatus( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( new ContainerCraftingStatus( inventoryPlayer, te ) ); this.status = (ContainerCraftingStatus) this.inventorySlots; - Object target = this.status.getTarget(); + final Object target = this.status.getTarget(); final IDefinitions definitions = AEApi.instance().definitions(); final IParts parts = definitions.parts(); if( target instanceof WirelessTerminalGuiObject ) { - for( ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() ) { this.myIcon = wirelessTerminalStack; } @@ -80,7 +80,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU if( target instanceof PartTerminal ) { - for( ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() ) { this.myIcon = stack; } @@ -89,7 +89,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU if( target instanceof PartCraftingTerminal ) { - for( ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() ) { this.myIcon = stack; } @@ -98,7 +98,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU if( target instanceof PartPatternTerminal ) { - for( ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() ) { this.myIcon = stack; } @@ -107,11 +107,11 @@ public class GuiCraftingStatus extends GuiCraftingCPU } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.selectCPU ) { @@ -119,7 +119,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU { NetworkHandler.instance.sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -148,7 +148,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { this.updateCPUButtonText(); super.drawScreen( mouseX, mouseY, btn ); @@ -162,7 +162,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU { if( this.status.myName.length() > 0 ) { - String name = this.status.myName.substring( 0, Math.min( 20, this.status.myName.length() ) ); + final String name = this.status.myName.substring( 0, Math.min( 20, this.status.myName.length() ) ); btnTextText = GuiText.CPUs.getLocal() + ": " + name; } else @@ -180,7 +180,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU } @Override - protected String getGuiDisplayName( String in ) + protected String getGuiDisplayName( final String in ) { return in; // the cup name is on the button } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java index 3de6c59b..c4dfb656 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java @@ -40,22 +40,22 @@ public class GuiCraftingTerm extends GuiMEMonitorable GuiImgButton clearBtn; - public GuiCraftingTerm( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiCraftingTerm( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( inventoryPlayer, te, new ContainerCraftingTerm( inventoryPlayer, te ) ); this.reservedSpace = 73; } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); if( this.clearBtn == btn ) { Slot s = null; - Container c = this.inventorySlots; - for( Object j : c.inventorySlots ) + final Container c = this.inventorySlots; + for( final Object j : c.inventorySlots ) { if( j instanceof SlotCraftingMatrix ) { @@ -65,7 +65,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable if( s != null ) { - PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 ); + final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, s.slotNumber, 0 ); NetworkHandler.instance.sendToServer( p ); } } @@ -80,7 +80,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { super.drawFG( offsetX, offsetY, mouseX, mouseY ); this.fontRendererObj.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiDrive.java b/src/main/java/appeng/client/gui/implementations/GuiDrive.java index 66b56b28..40fa4d94 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiDrive.java +++ b/src/main/java/appeng/client/gui/implementations/GuiDrive.java @@ -38,14 +38,14 @@ public class GuiDrive extends AEBaseGui GuiTabButton priority; - public GuiDrive( InventoryPlayer inventoryPlayer, TileDrive te ) + public GuiDrive( final InventoryPlayer inventoryPlayer, final TileDrive te ) { super( new ContainerDrive( inventoryPlayer, te ) ); this.ySize = 199; } @Override - protected void actionPerformed( GuiButton par1GuiButton ) throws IOException + protected void actionPerformed( final GuiButton par1GuiButton ) throws IOException { super.actionPerformed( par1GuiButton ); @@ -64,14 +64,14 @@ public class GuiDrive extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Drive.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/drive.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java index c0cec718..abe2dade 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java +++ b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java @@ -46,7 +46,7 @@ public class GuiFormationPlane extends GuiUpgradeable GuiTabButton priority; GuiImgButton placeMode; - public GuiFormationPlane( InventoryPlayer inventoryPlayer, PartFormationPlane te ) + public GuiFormationPlane( final InventoryPlayer inventoryPlayer, final PartFormationPlane te ) { super( new ContainerFormationPlane( inventoryPlayer, te ) ); this.ySize = 251; @@ -65,7 +65,7 @@ public class GuiFormationPlane extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -88,11 +88,11 @@ public class GuiFormationPlane extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.priority ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiGrinder.java b/src/main/java/appeng/client/gui/implementations/GuiGrinder.java index 71180e89..4f914fc1 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiGrinder.java +++ b/src/main/java/appeng/client/gui/implementations/GuiGrinder.java @@ -29,21 +29,21 @@ import appeng.tile.grindstone.TileGrinder; public class GuiGrinder extends AEBaseGui { - public GuiGrinder( InventoryPlayer inventoryPlayer, TileGrinder te ) + public GuiGrinder( final InventoryPlayer inventoryPlayer, final TileGrinder te ) { super( new ContainerGrinder( inventoryPlayer, te ) ); this.ySize = 176; } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.GrindStone.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/grinder.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java index b554495d..623ed5ed 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java @@ -47,7 +47,7 @@ public class GuiIOPort extends GuiUpgradeable GuiImgButton fullMode; GuiImgButton operationMode; - public GuiIOPort( InventoryPlayer inventoryPlayer, TileIOPort te ) + public GuiIOPort( final InventoryPlayer inventoryPlayer, final TileIOPort te ) { super( new ContainerIOPort( inventoryPlayer, te ) ); this.ySize = 166; @@ -66,7 +66,7 @@ public class GuiIOPort extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.IOPort.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -88,18 +88,18 @@ public class GuiIOPort extends GuiUpgradeable } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { super.drawBG( offsetX, offsetY, mouseX, mouseY ); final IDefinitions definitions = AEApi.instance().definitions(); - for( ItemStack cell1kStack : definitions.items().cell1k().maybeStack( 1 ).asSet() ) + for( final ItemStack cell1kStack : definitions.items().cell1k().maybeStack( 1 ).asSet() ) { this.drawItem( offsetX + 66 - 8, offsetY + 17, cell1kStack ); } - for( ItemStack driveStack : definitions.blocks().drive().maybeStack( 1 ).asSet() ) + for( final ItemStack driveStack : definitions.blocks().drive().maybeStack( 1 ).asSet() ) { this.drawItem( offsetX + 94 + 8, offsetY + 17, driveStack ); } @@ -112,11 +112,11 @@ public class GuiIOPort extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.fullMode ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java index 67e278bd..5b4da817 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java @@ -35,7 +35,7 @@ public class GuiInscriber extends AEBaseGui final ContainerInscriber cvc; GuiProgressBar pb; - public GuiInscriber( InventoryPlayer inventoryPlayer, TileInscriber te ) + public GuiInscriber( final InventoryPlayer inventoryPlayer, final TileInscriber te ) { super( new ContainerInscriber( inventoryPlayer, te ) ); this.cvc = (ContainerInscriber) this.inventorySlots; @@ -58,7 +58,7 @@ public class GuiInscriber extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.pb.setFullMsg( this.cvc.getCurrentProgress() * 100 / this.cvc.getMaxProgress() + "%" ); @@ -67,7 +67,7 @@ public class GuiInscriber extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/inscriber.png" ); this.pb.xPosition = 135 + this.guiLeft; diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterface.java b/src/main/java/appeng/client/gui/implementations/GuiInterface.java index 0dbdea3f..97127689 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterface.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterface.java @@ -47,7 +47,7 @@ public class GuiInterface extends GuiUpgradeable GuiImgButton BlockMode; GuiToggleButton interfaceMode; - public GuiInterface( InventoryPlayer inventoryPlayer, IInterfaceHost te ) + public GuiInterface( final InventoryPlayer inventoryPlayer, final IInterfaceHost te ) { super( new ContainerInterface( inventoryPlayer, te ) ); this.ySize = 211; @@ -67,7 +67,7 @@ public class GuiInterface extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { if( this.BlockMode != null ) { @@ -95,11 +95,11 @@ public class GuiInterface extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.priority ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java index 1722714c..1e7cef96 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java @@ -68,7 +68,7 @@ public class GuiInterfaceTerminal extends AEBaseGui private boolean refreshList = false; private MEGuiTextField searchField; - public GuiInterfaceTerminal( InventoryPlayer inventoryPlayer, PartInterfaceTerminal te ) + public GuiInterfaceTerminal( final InventoryPlayer inventoryPlayer, final PartInterfaceTerminal te ) { super( new ContainerInterfaceTerminal( inventoryPlayer, te ) ); this.myScrollBar = new GuiScrollbar(); @@ -94,14 +94,14 @@ public class GuiInterfaceTerminal extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); - int ex = this.myScrollBar.getCurrentScroll(); + final int ex = this.myScrollBar.getCurrentScroll(); - Iterator o = this.inventorySlots.inventorySlots.iterator(); + final Iterator o = this.inventorySlots.inventorySlots.iterator(); while( o.hasNext() ) { if( o.next() instanceof SlotDisconnected ) @@ -113,10 +113,10 @@ public class GuiInterfaceTerminal extends AEBaseGui int offset = 17; for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ ) { - Object lineObj = this.lines.get( ex + x ); + final Object lineObj = this.lines.get( ex + x ); if( lineObj instanceof ClientDCInternalInv ) { - ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; + final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; for( int z = 0; z < inv.inv.getSizeInventory(); z++ ) { this.inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) ); @@ -125,7 +125,7 @@ public class GuiInterfaceTerminal extends AEBaseGui else if( lineObj instanceof String ) { String name = (String) lineObj; - int rows = this.byName.get( name ).size(); + final int rows = this.byName.get( name ).size(); if( rows > 1 ) { name = name + " (" + rows + ')'; @@ -143,7 +143,7 @@ public class GuiInterfaceTerminal extends AEBaseGui } @Override - protected void mouseClicked( int xCoord, int yCoord, int btn ) throws IOException + protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) throws IOException { this.searchField.mouseClicked( xCoord, yCoord, btn ); @@ -157,23 +157,23 @@ public class GuiInterfaceTerminal extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/interfaceterminal.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); int offset = 17; - int ex = this.myScrollBar.getCurrentScroll(); + final int ex = this.myScrollBar.getCurrentScroll(); for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ ) { - Object lineObj = this.lines.get( ex + x ); + final Object lineObj = this.lines.get( ex + x ); if( lineObj instanceof ClientDCInternalInv ) { - ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; + final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; GL11.glColor4f( 1, 1, 1, 1 ); - int width = inv.inv.getSizeInventory() * 18; + final int width = inv.inv.getSizeInventory() * 18; this.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18 ); } offset += 18; @@ -186,7 +186,7 @@ public class GuiInterfaceTerminal extends AEBaseGui } @Override - protected void keyTyped( char character, int key ) throws IOException + protected void keyTyped( final char character, final int key ) throws IOException { if( !this.checkHotbarKeys( key ) ) { @@ -206,7 +206,7 @@ public class GuiInterfaceTerminal extends AEBaseGui } } - public void postUpdate( NBTTagCompound in ) + public void postUpdate( final NBTTagCompound in ) { if( in.getBoolean( "clear" ) ) { @@ -214,27 +214,27 @@ public class GuiInterfaceTerminal extends AEBaseGui this.refreshList = true; } - for( Object oKey : in.getKeySet() ) + for( final Object oKey : in.getKeySet() ) { - String key = (String) oKey; + final String key = (String) oKey; if( key.startsWith( "=" ) ) { try { - long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX ); - NBTTagCompound invData = in.getCompoundTag( key ); - ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) ); + final long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX ); + final NBTTagCompound invData = in.getCompoundTag( key ); + final ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) ); for( int x = 0; x < current.inv.getSizeInventory(); x++ ) { - String which = Integer.toString( x ); + final String which = Integer.toString( x ); if( invData.hasKey( which ) ) { current.inv.setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( invData.getCompoundTag( which ) ) ); } } } - catch( NumberFormatException ignored ) + catch( final NumberFormatException ignored ) { } } @@ -263,7 +263,7 @@ public class GuiInterfaceTerminal extends AEBaseGui final Set cachedSearch = this.getCacheForSearchTerm( searchFilterLowerCase ); final boolean rebuild = cachedSearch.isEmpty(); - for( ClientDCInternalInv entry : this.byId.values() ) + for( final ClientDCInternalInv entry : this.byId.values() ) { // ignore inventory if not doing a full rebuild or cache already marks it as miss. if( !rebuild && !cachedSearch.contains( entry ) ) @@ -277,7 +277,7 @@ public class GuiInterfaceTerminal extends AEBaseGui // Search if the current inventory holds a pattern containing the search term. if( !found && !searchFilterLowerCase.isEmpty() ) { - for( ItemStack itemStack : entry.inv ) + for( final ItemStack itemStack : entry.inv ) { found = this.itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase ); if( found ) @@ -307,11 +307,11 @@ public class GuiInterfaceTerminal extends AEBaseGui this.lines.clear(); this.lines.ensureCapacity( this.getMaxRows() ); - for( String n : this.names ) + for( final String n : this.names ) { this.lines.add( n ); - ArrayList clientInventories = new ArrayList(); + final ArrayList clientInventories = new ArrayList(); clientInventories.addAll( this.byName.get( n ) ); Collections.sort( clientInventories ); @@ -321,14 +321,14 @@ public class GuiInterfaceTerminal extends AEBaseGui this.myScrollBar.setRange( 0, this.lines.size() - LINES_ON_PAGE, 2 ); } - private boolean itemStackMatchesSearchTerm( ItemStack itemStack, String searchTerm ) + private boolean itemStackMatchesSearchTerm( final ItemStack itemStack, final String searchTerm ) { if( itemStack == null ) { return false; } - NBTTagCompound encodedValue = itemStack.getTagCompound(); + final NBTTagCompound encodedValue = itemStack.getTagCompound(); if( encodedValue == null ) { @@ -337,15 +337,15 @@ public class GuiInterfaceTerminal extends AEBaseGui // Potential later use to filter by input // NBTTagList inTag = encodedValue.getTagList( "in", 10 ); - NBTTagList outTag = encodedValue.getTagList( "out", 10 ); + final NBTTagList outTag = encodedValue.getTagList( "out", 10 ); for( int i = 0; i < outTag.tagCount(); i++ ) { - ItemStack parsedItemStack = ItemStack.loadItemStackFromNBT( outTag.getCompoundTagAt( i ) ); + final ItemStack parsedItemStack = ItemStack.loadItemStackFromNBT( outTag.getCompoundTagAt( i ) ); if( parsedItemStack != null ) { - String displayName = Platform.getItemDisplayName( AEApi.instance().storage().createItemStack( parsedItemStack ) ).toLowerCase(); + final String displayName = Platform.getItemDisplayName( AEApi.instance().storage().createItemStack( parsedItemStack ) ).toLowerCase(); if( displayName.contains( searchTerm ) ) { return true; @@ -365,14 +365,14 @@ public class GuiInterfaceTerminal extends AEBaseGui * * @return a Set matching a superset of the search term */ - private Set getCacheForSearchTerm( String searchTerm ) + private Set getCacheForSearchTerm( final String searchTerm ) { if( !this.cachedSearches.containsKey( searchTerm ) ) { this.cachedSearches.put( searchTerm, new HashSet() ); } - Set cache = this.cachedSearches.get( searchTerm ); + final Set cache = this.cachedSearches.get( searchTerm ); if( cache.isEmpty() && searchTerm.length() > 1 ) { @@ -393,7 +393,7 @@ public class GuiInterfaceTerminal extends AEBaseGui return this.names.size() + this.byId.size(); } - private ClientDCInternalInv getById( long id, long sortBy, String string ) + private ClientDCInternalInv getById( final long id, final long sortBy, final String string ) { ClientDCInternalInv o = this.byId.get( id ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java index c8380a0f..6aee5948 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java +++ b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java @@ -61,7 +61,7 @@ public class GuiLevelEmitter extends GuiUpgradeable GuiImgButton levelMode; GuiImgButton craftingMode; - public GuiLevelEmitter( InventoryPlayer inventoryPlayer, PartLevelEmitter te ) + public GuiLevelEmitter( final InventoryPlayer inventoryPlayer, final PartLevelEmitter te ) { super( new ContainerLevelEmitter( inventoryPlayer, te ) ); } @@ -88,10 +88,10 @@ public class GuiLevelEmitter extends GuiUpgradeable this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); this.craftingMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_VIA_REDSTONE, YesNo.NO ); - int a = AEConfig.instance.levelByStackAmounts( 0 ); - int b = AEConfig.instance.levelByStackAmounts( 1 ); - int c = AEConfig.instance.levelByStackAmounts( 2 ); - int d = AEConfig.instance.levelByStackAmounts( 3 ); + final int a = AEConfig.instance.levelByStackAmounts( 0 ); + final int b = AEConfig.instance.levelByStackAmounts( 1 ); + final int c = AEConfig.instance.levelByStackAmounts( 2 ); + final int d = AEConfig.instance.levelByStackAmounts( 3 ); this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) ); this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b ) ); @@ -110,9 +110,9 @@ public class GuiLevelEmitter extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { - boolean notCraftingMode = this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) == 0; + final boolean notCraftingMode = this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) == 0; // configure enabled status... this.level.setEnabled( notCraftingMode ); @@ -141,7 +141,7 @@ public class GuiLevelEmitter extends GuiUpgradeable } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { super.drawBG( offsetX, offsetY, mouseX, mouseY ); this.level.drawTextBox(); @@ -167,11 +167,11 @@ public class GuiLevelEmitter extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.craftingMode ) { @@ -183,8 +183,8 @@ public class GuiLevelEmitter extends GuiUpgradeable NetworkHandler.instance.sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) ); } - boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; if( isPlus || isMinus ) { @@ -192,7 +192,7 @@ public class GuiLevelEmitter extends GuiUpgradeable } } - private void addQty( long i ) + private void addQty( final long i ) { try { @@ -226,19 +226,19 @@ public class GuiLevelEmitter extends GuiUpgradeable NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) ); } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // nope.. this.level.setText( "0" ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } @Override - protected void keyTyped( char character, int key ) throws IOException + protected void keyTyped( final char character, final int key ) throws IOException { if( !this.checkHotbarKeys( key ) ) { @@ -267,7 +267,7 @@ public class GuiLevelEmitter extends GuiUpgradeable NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiMAC.java b/src/main/java/appeng/client/gui/implementations/GuiMAC.java index 8b6f786e..f1471111 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMAC.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMAC.java @@ -36,7 +36,7 @@ public class GuiMAC extends GuiUpgradeable final ContainerMAC container; GuiProgressBar pb; - public GuiMAC( InventoryPlayer inventoryPlayer, TileMolecularAssembler te ) + public GuiMAC( final InventoryPlayer inventoryPlayer, final TileMolecularAssembler te ) { super( new ContainerMAC( inventoryPlayer, te ) ); this.ySize = 197; @@ -60,14 +60,14 @@ public class GuiMAC extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.pb.setFullMsg( this.container.getCurrentProgress() + "%" ); super.drawFG( offsetX, offsetY, mouseX, mouseY ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.pb.xPosition = 148 + this.guiLeft; this.pb.yPosition = 48 + this.guiTop; diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java index 261cfc70..e1d98721 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java @@ -96,12 +96,12 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi GuiImgButton searchBoxSettings; GuiImgButton terminalStyleBox; - public GuiMEMonitorable( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiMEMonitorable( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { this( inventoryPlayer, te, new ContainerMEMonitorable( inventoryPlayer, te ) ); } - public GuiMEMonitorable( InventoryPlayer inventoryPlayer, ITerminalHost te, ContainerMEMonitorable c ) + public GuiMEMonitorable( final InventoryPlayer inventoryPlayer, final ITerminalHost te, final ContainerMEMonitorable c ) { super( c ); @@ -145,9 +145,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } } - public void postUpdate( List list ) + public void postUpdate( final List list ) { - for( IAEItemStack is : list ) + for( final IAEItemStack is : list ) { this.repo.postUpdate( is ); } @@ -163,7 +163,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { if( btn == this.craftingStatusBtn ) { @@ -172,13 +172,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi if( btn instanceof GuiImgButton ) { - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); - GuiImgButton iBtn = (GuiImgButton) btn; + final GuiImgButton iBtn = (GuiImgButton) btn; if( iBtn.getSetting() != Settings.ACTIONS ) { - Enum cv = iBtn.getCurrentValue(); - Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); + final Enum cv = iBtn.getCurrentValue(); + final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); if( btn == this.terminalStyleBox ) { @@ -194,7 +194,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi { NetworkHandler.instance.sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -224,13 +224,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi this.maxRows = this.getMaxRows(); this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 ); - boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ); + final boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ); - int NEI = hasNEI ? 0 : 0; + final int NEI = hasNEI ? 0 : 0; int top = hasNEI ? 22 : 0; - int magicNumber = 114 + 1; - int extraSpace = this.height - magicNumber - NEI - top - this.reservedSpace; + final int magicNumber = 114 + 1; + final int extraSpace = this.height - magicNumber - NEI - top - this.reservedSpace; this.rows = (int) Math.floor( extraSpace / 18 ); if( this.rows > this.maxRows ) @@ -274,7 +274,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi this.ySize = magicNumber + this.rows * 18 + this.reservedSpace; // this.guiTop = top; - int unusedSpace = this.height - this.ySize; + final int unusedSpace = this.height - this.ySize; this.guiTop = (int) Math.floor( unusedSpace / ( unusedSpace < 0 ? 3.8f : 2.0f ) ); int offset = this.guiTop + 8; @@ -315,7 +315,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } // Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH ); - Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); + final Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); this.searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting ); if( this.isSubGui() ) @@ -329,7 +329,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi CraftingGridOffsetX = Integer.MAX_VALUE; CraftingGridOffsetY = Integer.MAX_VALUE; - for( Object s : this.inventorySlots.inventorySlots ) + for( final Object s : this.inventorySlots.inventorySlots ) { if( s instanceof AppEngSlot ) { @@ -341,7 +341,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi if( s instanceof SlotCraftingMatrix || s instanceof SlotFakeCraftingMatrix ) { - Slot g = (Slot) s; + final Slot g = (Slot) s; if( g.xDisplayPosition > 0 && g.yDisplayPosition > 0 ) { CraftingGridOffsetX = Math.min( CraftingGridOffsetX, g.xDisplayPosition ); @@ -355,16 +355,16 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( this.myName.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - protected void mouseClicked( int xCoord, int yCoord, int btn ) throws IOException + protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) throws IOException { - Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); + final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); if( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.NEI_AUTOSEARCH ) { @@ -391,11 +391,11 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( this.getBackground() ); - int x_width = 197; + final int x_width = 197; this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 ); if( this.viewCell || ( this instanceof GuiSecurity ) ) @@ -451,13 +451,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi return AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE; } - protected void repositionSlot( AppEngSlot s ) + protected void repositionSlot( final AppEngSlot s ) { s.yDisplayPosition = s.defY + this.ySize - 78 - 5; } @Override - protected void keyTyped( char character, int key ) throws IOException + protected void keyTyped( final char character, final int key ) throws IOException { if( !this.checkHotbarKeys( key ) ) { @@ -505,7 +505,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { if( this.SortByBox != null ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java b/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java index 9637696e..9f2b9a4f 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java @@ -27,7 +27,7 @@ import appeng.container.implementations.ContainerMEPortableCell; public class GuiMEPortableCell extends GuiMEMonitorable { - public GuiMEPortableCell( InventoryPlayer inventoryPlayer, IPortableCell te ) + public GuiMEPortableCell( final InventoryPlayer inventoryPlayer, final IPortableCell te ) { super( inventoryPlayer, te, new ContainerMEPortableCell( inventoryPlayer, te ) ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java index c4d09a5a..a9a96124 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java @@ -56,7 +56,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource GuiImgButton units; int tooltip = -1; - public GuiNetworkStatus( InventoryPlayer inventoryPlayer, INetworkTool te ) + public GuiNetworkStatus( final InventoryPlayer inventoryPlayer, final INetworkTool te ) { super( new ContainerNetworkStatus( inventoryPlayer, te ) ); this.ySize = 153; @@ -67,11 +67,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.units ) { @@ -90,11 +90,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } @Override - public void drawScreen( int mouseX, int mouseY, float btn ) + public void drawScreen( final int mouseX, final int mouseY, final float btn ) { - int gx = ( this.width - this.xSize ) / 2; - int gy = ( this.height - this.ySize ) / 2; + final int gx = ( this.width - this.xSize ) / 2; + final int gy = ( this.height - this.ySize ) / 2; this.tooltip = -1; @@ -102,8 +102,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource int x = 0; for( int z = 0; z <= 4 * 5; z++ ) { - int minX = gx + 14 + x * 31; - int minY = gy + 41 + y * 18; + final int minX = gx + 14 + x * 31; + final int minY = gy + 41 + y * 18; if( minX < mouseX && minX + 28 > mouseX ) { @@ -127,9 +127,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { - ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots; + final ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots; this.fontRendererObj.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 ); @@ -139,14 +139,14 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource this.fontRendererObj.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.avgAddition, true ), 13, 143 - 10, 4210752 ); this.fontRendererObj.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.powerUsage, true ), 13, 143 - 20, 4210752 ); - int sectionLength = 30; + final int sectionLength = 30; int x = 0; int y = 0; - int xo = 12; - int yo = 42; - int viewStart = 0;// myScrollBar.getCurrentScroll() * 5; - int viewEnd = viewStart + 5 * 4; + final int xo = 12; + final int yo = 42; + final int viewStart = 0;// myScrollBar.getCurrentScroll() * 5; + final int viewEnd = viewStart + 5 * 4; String toolTip = ""; int toolPosX = 0; @@ -154,7 +154,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource for( int z = viewStart; z < Math.min( viewEnd, this.repo.size() ); z++ ) { - IAEItemStack refStack = this.repo.getReferenceItem( z ); + final IAEItemStack refStack = this.repo.getReferenceItem( z ); if( refStack != null ) { GL11.glPushMatrix(); @@ -166,12 +166,12 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource str = Long.toString( refStack.getStackSize() / 1000 ) + 'k'; } - int w = this.fontRendererObj.getStringWidth( str ); + final int w = this.fontRendererObj.getStringWidth( str ); this.fontRendererObj.drawString( str, (int) ( ( x * sectionLength + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * 18 + yo + 6 ) * 2, 4210752 ); GL11.glPopMatrix(); - int posX = x * sectionLength + xo + sectionLength - 18; - int posY = y * 18 + yo; + final int posX = x * sectionLength + xo + sectionLength - 18; + final int posY = y * 18 + yo; if( this.tooltip == z - viewStart ) { @@ -208,17 +208,17 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/networkstatus.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); } - public void postUpdate( List list ) + public void postUpdate( final List list ) { this.repo.clear(); - for( IAEItemStack is : list ) + for( final IAEItemStack is : list ) { this.repo.postUpdate( is ); } @@ -229,27 +229,27 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource private void setScrollBar() { - int size = this.repo.size(); + final int size = this.repo.size(); this.myScrollBar.setTop( 39 ).setLeft( 175 ).setHeight( 78 ); this.myScrollBar.setRange( 0, ( size + 4 ) / 5 - this.rows, 1 ); } // @Override - NEI - public List handleItemTooltip( ItemStack stack, int mouseX, int mouseY, List currentToolTip ) + public List handleItemTooltip( final ItemStack stack, final int mouseX, final int mouseY, final List currentToolTip ) { if( stack != null ) { - Slot s = this.getSlot( mouseX, mouseY ); + final Slot s = this.getSlot( mouseX, mouseY ); if( s instanceof SlotME ) { IAEItemStack myStack = null; try { - SlotME theSlotField = (SlotME) s; + final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } @@ -266,25 +266,25 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource } // Vanilla version... - protected void drawItemStackTooltip( ItemStack stack, int x, int y ) + protected void drawItemStackTooltip( final ItemStack stack, final int x, final int y ) { - Slot s = this.getSlot( x, y ); + final Slot s = this.getSlot( x, y ); if( s instanceof SlotME && stack != null ) { IAEItemStack myStack = null; try { - SlotME theSlotField = (SlotME) s; + final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } if( myStack != null ) { - List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); + final List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips ); while( currentToolTip.size() > 1 ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java index ddd679e4..94b74c28 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java @@ -38,14 +38,14 @@ public class GuiNetworkTool extends AEBaseGui GuiToggleButton tFacades; - public GuiNetworkTool( InventoryPlayer inventoryPlayer, INetworkTool te ) + public GuiNetworkTool( final InventoryPlayer inventoryPlayer, final INetworkTool te ) { super( new ContainerNetworkTool( inventoryPlayer, te ) ); this.ySize = 166; } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); @@ -56,7 +56,7 @@ public class GuiNetworkTool extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) ); } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -73,7 +73,7 @@ public class GuiNetworkTool extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { if( this.tFacades != null ) { @@ -85,7 +85,7 @@ public class GuiNetworkTool extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/toolbox.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java index dae544b2..cc015e1e 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java @@ -48,7 +48,7 @@ public class GuiPatternTerm extends GuiMEMonitorable GuiImgButton encodeBtn; GuiImgButton clearBtn; - public GuiPatternTerm( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiPatternTerm( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) ); this.container = (ContainerPatternTerm) this.inventorySlots; @@ -56,7 +56,7 @@ public class GuiPatternTerm extends GuiMEMonitorable } @Override - protected void actionPerformed( GuiButton btn ) + protected void actionPerformed( final GuiButton btn ) { super.actionPerformed( btn ); @@ -78,7 +78,7 @@ public class GuiPatternTerm extends GuiMEMonitorable NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) ); } } - catch( IOException e ) + catch( final IOException e ) { // TODO Auto-generated catch block e.printStackTrace(); @@ -108,7 +108,7 @@ public class GuiPatternTerm extends GuiMEMonitorable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { if( !this.container.craftingMode ) { @@ -136,7 +136,7 @@ public class GuiPatternTerm extends GuiMEMonitorable } @Override - protected void repositionSlot( AppEngSlot s ) + protected void repositionSlot( final AppEngSlot s ) { if( s.isPlayerSide() ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiPriority.java b/src/main/java/appeng/client/gui/implementations/GuiPriority.java index c25a9092..9a67bf07 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPriority.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPriority.java @@ -66,7 +66,7 @@ public class GuiPriority extends AEBaseGui GuiBridge OriginalGui; - public GuiPriority( InventoryPlayer inventoryPlayer, IPriorityHost te ) + public GuiPriority( final InventoryPlayer inventoryPlayer, final IPriorityHost te ) { super( new ContainerPriority( inventoryPlayer, te ) ); } @@ -76,10 +76,10 @@ public class GuiPriority extends AEBaseGui { super.initGui(); - int a = AEConfig.instance.priorityByStacksAmounts( 0 ); - int b = AEConfig.instance.priorityByStacksAmounts( 1 ); - int c = AEConfig.instance.priorityByStacksAmounts( 2 ); - int d = AEConfig.instance.priorityByStacksAmounts( 3 ); + final int a = AEConfig.instance.priorityByStacksAmounts( 0 ); + final int b = AEConfig.instance.priorityByStacksAmounts( 1 ); + final int c = AEConfig.instance.priorityByStacksAmounts( 2 ); + final int d = AEConfig.instance.priorityByStacksAmounts( 3 ); this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) ); this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 32, 28, 20, "+" + b ) ); @@ -92,14 +92,14 @@ public class GuiPriority extends AEBaseGui this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) ); ItemStack myIcon = null; - Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget(); + final Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget(); final IDefinitions definitions = AEApi.instance().definitions(); final IParts parts = definitions.parts(); final IBlocks blocks = definitions.blocks(); if( target instanceof PartStorageBus ) { - for( ItemStack storageBusStack : parts.storageBus().maybeStack( 1 ).asSet() ) + for( final ItemStack storageBusStack : parts.storageBus().maybeStack( 1 ).asSet() ) { myIcon = storageBusStack; } @@ -108,7 +108,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof PartFormationPlane ) { - for( ItemStack formationPlaneStack : parts.formationPlane().maybeStack( 1 ).asSet() ) + for( final ItemStack formationPlaneStack : parts.formationPlane().maybeStack( 1 ).asSet() ) { myIcon = formationPlaneStack; } @@ -117,7 +117,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof TileDrive ) { - for( ItemStack driveStack : blocks.drive().maybeStack( 1 ).asSet() ) + for( final ItemStack driveStack : blocks.drive().maybeStack( 1 ).asSet() ) { myIcon = driveStack; } @@ -127,7 +127,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof TileChest ) { - for( ItemStack chestStack : blocks.chest().maybeStack( 1 ).asSet() ) + for( final ItemStack chestStack : blocks.chest().maybeStack( 1 ).asSet() ) { myIcon = chestStack; } @@ -137,7 +137,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof TileInterface ) { - for( ItemStack interfaceStack : blocks.iface().maybeStack( 1 ).asSet() ) + for( final ItemStack interfaceStack : blocks.iface().maybeStack( 1 ).asSet() ) { myIcon = interfaceStack; } @@ -147,7 +147,7 @@ public class GuiPriority extends AEBaseGui if( target instanceof PartInterface ) { - for( ItemStack interfaceStack : parts.iface().maybeStack( 1 ).asSet() ) + for( final ItemStack interfaceStack : parts.iface().maybeStack( 1 ).asSet() ) { myIcon = interfaceStack; } @@ -169,13 +169,13 @@ public class GuiPriority extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( GuiText.Priority.getLocal(), 8, 6, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/priority.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); @@ -184,7 +184,7 @@ public class GuiPriority extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); @@ -193,8 +193,8 @@ public class GuiPriority extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketSwitchGuis( this.OriginalGui ) ); } - boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; if( isPlus || isMinus ) { @@ -202,7 +202,7 @@ public class GuiPriority extends AEBaseGui } } - private void addQty( int i ) + private void addQty( final int i ) { try { @@ -232,19 +232,19 @@ public class GuiPriority extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) ); } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { // nope.. this.priority.setText( "0" ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } @Override - protected void keyTyped( char character, int key ) throws IOException + protected void keyTyped( final char character, final int key ) throws IOException { if( !this.checkHotbarKeys( key ) ) { @@ -273,7 +273,7 @@ public class GuiPriority extends AEBaseGui NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiQNB.java b/src/main/java/appeng/client/gui/implementations/GuiQNB.java index 36dd17fc..ab6b1949 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiQNB.java +++ b/src/main/java/appeng/client/gui/implementations/GuiQNB.java @@ -29,21 +29,21 @@ import appeng.tile.qnb.TileQuantumBridge; public class GuiQNB extends AEBaseGui { - public GuiQNB( InventoryPlayer inventoryPlayer, TileQuantumBridge te ) + public GuiQNB( final InventoryPlayer inventoryPlayer, final TileQuantumBridge te ) { super( new ContainerQNB( inventoryPlayer, te ) ); this.ySize = 166; } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuantumLinkChamber.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/chest.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java b/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java index b61c0c45..36bfbaaa 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java +++ b/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java @@ -37,7 +37,7 @@ public class GuiQuartzKnife extends AEBaseGui GuiTextField name; - public GuiQuartzKnife( InventoryPlayer inventoryPlayer, QuartzKnifeObj te ) + public GuiQuartzKnife( final InventoryPlayer inventoryPlayer, final QuartzKnifeObj te ) { super( new ContainerQuartzKnife( inventoryPlayer, te ) ); this.ySize = 184; @@ -57,14 +57,14 @@ public class GuiQuartzKnife extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.QuartzCuttingKnife.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/quartzknife.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); @@ -72,17 +72,17 @@ public class GuiQuartzKnife extends AEBaseGui } @Override - protected void keyTyped( char character, int key ) throws IOException + protected void keyTyped( final char character, final int key ) throws IOException { if( this.name.textboxKeyTyped( character, key ) ) { try { - String Out = this.name.getText(); + final String Out = this.name.getText(); ( (ContainerQuartzKnife) this.inventorySlots ).setName( Out ); NetworkHandler.instance.sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java index 601d8884..8821cfc0 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java @@ -42,7 +42,7 @@ public class GuiSecurity extends GuiMEMonitorable GuiToggleButton build; GuiToggleButton security; - public GuiSecurity( InventoryPlayer inventoryPlayer, ITerminalHost te ) + public GuiSecurity( final InventoryPlayer inventoryPlayer, final ITerminalHost te ) { super( inventoryPlayer, te, new ContainerSecurity( inventoryPlayer, te ) ); this.customSortOrder = false; @@ -54,7 +54,7 @@ public class GuiSecurity extends GuiMEMonitorable } @Override - protected void actionPerformed( net.minecraft.client.gui.GuiButton btn ) + protected void actionPerformed( final net.minecraft.client.gui.GuiButton btn ) { super.actionPerformed( btn ); @@ -87,7 +87,7 @@ public class GuiSecurity extends GuiMEMonitorable { NetworkHandler.instance.sendToServer( new PacketValueConfig( "TileSecurity.ToggleOption", toggleSetting.name() ) ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -99,7 +99,7 @@ public class GuiSecurity extends GuiMEMonitorable { super.initGui(); - int top = this.guiTop + this.ySize - 116; + final int top = this.guiTop + this.ySize - 116; this.buttonList.add( this.inject = new GuiToggleButton( this.guiLeft + 56, top, 11 * 16, 12 * 16, SecurityPermissions.INJECT.getUnlocalizedName(), SecurityPermissions.INJECT.getUnlocalizedTip() ) ); this.buttonList.add( this.extract = new GuiToggleButton( this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1, SecurityPermissions.EXTRACT.getUnlocalizedName(), SecurityPermissions.EXTRACT.getUnlocalizedTip() ) ); @@ -112,7 +112,7 @@ public class GuiSecurity extends GuiMEMonitorable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { super.drawFG( offsetX, offsetY, mouseX, mouseY ); this.fontRendererObj.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 ); @@ -121,7 +121,7 @@ public class GuiSecurity extends GuiMEMonitorable @Override protected String getBackground() { - ContainerSecurity cs = (ContainerSecurity) this.inventorySlots; + final ContainerSecurity cs = (ContainerSecurity) this.inventorySlots; this.inject.setState( ( cs.security & ( 1 << SecurityPermissions.INJECT.ordinal() ) ) > 0 ); this.extract.setState( ( cs.security & ( 1 << SecurityPermissions.EXTRACT.ordinal() ) ) > 0 ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java b/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java index 149e45ce..b6bfe7a7 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java @@ -31,21 +31,21 @@ import appeng.tile.storage.TileSkyChest; public class GuiSkyChest extends AEBaseGui { - public GuiSkyChest( InventoryPlayer inventoryPlayer, TileSkyChest te ) + public GuiSkyChest( final InventoryPlayer inventoryPlayer, final TileSkyChest te ) { super( new ContainerSkyChest( inventoryPlayer, te ) ); this.ySize = 195; } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SkyChest.getLocal() ), 8, 8, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752 ); } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/skychest.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java index a0e188ae..47482a7b 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java @@ -42,7 +42,7 @@ public class GuiSpatialIOPort extends AEBaseGui final ContainerSpatialIOPort container; GuiImgButton units; - public GuiSpatialIOPort( InventoryPlayer inventoryPlayer, TileSpatialIOPort te ) + public GuiSpatialIOPort( final InventoryPlayer inventoryPlayer, final TileSpatialIOPort te ) { super( new ContainerSpatialIOPort( inventoryPlayer, te ) ); this.ySize = 199; @@ -50,11 +50,11 @@ public class GuiSpatialIOPort extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.units ) { @@ -73,7 +73,7 @@ public class GuiSpatialIOPort extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.currentPower, false ), 13, 21, 4210752 ); this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.maxPower, false ), 13, 31, 4210752 ); @@ -85,7 +85,7 @@ public class GuiSpatialIOPort extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/spatialio.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java index 71602647..a610a701 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java @@ -53,7 +53,7 @@ public class GuiStorageBus extends GuiUpgradeable GuiImgButton partition; GuiImgButton clear; - public GuiStorageBus( InventoryPlayer inventoryPlayer, PartStorageBus te ) + public GuiStorageBus( final InventoryPlayer inventoryPlayer, final PartStorageBus te ) { super( new ContainerStorageBus( inventoryPlayer, te ) ); this.ySize = 251; @@ -78,7 +78,7 @@ public class GuiStorageBus extends GuiUpgradeable } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.StorageBus.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -106,11 +106,11 @@ public class GuiStorageBus extends GuiUpgradeable } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); try { @@ -135,7 +135,7 @@ public class GuiStorageBus extends GuiUpgradeable NetworkHandler.instance.sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) ); } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java index 06687ef0..64ba5fe6 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java @@ -54,12 +54,12 @@ public class GuiUpgradeable extends AEBaseGui GuiImgButton craftMode; GuiImgButton schedulingMode; - public GuiUpgradeable( InventoryPlayer inventoryPlayer, IUpgradeableHost te ) + public GuiUpgradeable( final InventoryPlayer inventoryPlayer, final IUpgradeableHost te ) { this( new ContainerUpgradeable( inventoryPlayer, te ) ); } - public GuiUpgradeable( ContainerUpgradeable te ) + public GuiUpgradeable( final ContainerUpgradeable te ) { super( te ); this.cvb = te; @@ -95,7 +95,7 @@ public class GuiUpgradeable extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( this.getName().getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -122,7 +122,7 @@ public class GuiUpgradeable extends AEBaseGui } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.handleButtonVisibility(); @@ -174,11 +174,11 @@ public class GuiUpgradeable extends AEBaseGui } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.redstoneMode ) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java index 17a55ca4..c6cb2ba5 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java @@ -37,7 +37,7 @@ public class GuiVibrationChamber extends AEBaseGui final ContainerVibrationChamber cvc; GuiProgressBar pb; - public GuiVibrationChamber( InventoryPlayer inventoryPlayer, TileVibrationChamber te ) + public GuiVibrationChamber( final InventoryPlayer inventoryPlayer, final TileVibrationChamber te ) { super( new ContainerVibrationChamber( inventoryPlayer, te ) ); this.cvc = (ContainerVibrationChamber) this.inventorySlots; @@ -54,7 +54,7 @@ public class GuiVibrationChamber extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); @@ -63,17 +63,17 @@ public class GuiVibrationChamber extends AEBaseGui if( this.cvc.getCurrentProgress() > 0 ) { - int i1 = this.cvc.getCurrentProgress(); + final int i1 = this.cvc.getCurrentProgress(); this.bindTexture( "guis/vibchamber.png" ); GL11.glColor3f( 1, 1, 1 ); - int l = -15; - int k = 25; + final int l = -15; + final int k = 25; this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 ); } } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/vibchamber.png" ); this.pb.xPosition = 99 + this.guiLeft; diff --git a/src/main/java/appeng/client/gui/implementations/GuiWireless.java b/src/main/java/appeng/client/gui/implementations/GuiWireless.java index 74af8ef4..efa9a6f9 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiWireless.java +++ b/src/main/java/appeng/client/gui/implementations/GuiWireless.java @@ -41,18 +41,18 @@ public class GuiWireless extends AEBaseGui GuiImgButton units; - public GuiWireless( InventoryPlayer inventoryPlayer, TileWireless te ) + public GuiWireless( final InventoryPlayer inventoryPlayer, final TileWireless te ) { super( new ContainerWireless( inventoryPlayer, te ) ); this.ySize = 166; } @Override - protected void actionPerformed( GuiButton btn ) throws IOException + protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); - boolean backwards = Mouse.isButtonDown( 1 ); + final boolean backwards = Mouse.isButtonDown( 1 ); if( btn == this.units ) { @@ -71,27 +71,27 @@ public class GuiWireless extends AEBaseGui } @Override - public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); - ContainerWireless cw = (ContainerWireless) this.inventorySlots; + final ContainerWireless cw = (ContainerWireless) this.inventorySlots; if( cw.range > 0 ) { - String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.range / 10.0 ) + " m"; - String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true ); + final String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.range / 10.0 ) + " m"; + final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true ); - int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) ); - int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 ); + final int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) ); + final int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 ); this.fontRendererObj.drawString( firstMessage, cOffset, 20, 4210752 ); this.fontRendererObj.drawString( secondMessage, cOffset, 20 + 12, 4210752 ); } } @Override - public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY ) + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { this.bindTexture( "guis/wireless.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); diff --git a/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java b/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java index 2fb46475..0b9c8dd7 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java @@ -26,7 +26,7 @@ import appeng.api.implementations.guiobjects.IPortableCell; public class GuiWirelessTerm extends GuiMEPortableCell { - public GuiWirelessTerm( InventoryPlayer inventoryPlayer, IPortableCell te ) + public GuiWirelessTerm( final InventoryPlayer inventoryPlayer, final IPortableCell te ) { super( inventoryPlayer, te ); this.maxRows = Integer.MAX_VALUE; diff --git a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java index c197d1bc..442e3795 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java @@ -62,7 +62,7 @@ public class GuiImgButton extends GuiButton implements ITooltip public String fillVar; private Enum currentValue; - public GuiImgButton( int x, int y, Enum idx, Enum val ) + public GuiImgButton( final int x, final int y, final Enum idx, final Enum val ) { super( 0, 0, 16, "" ); @@ -166,27 +166,27 @@ public class GuiImgButton extends GuiButton implements ITooltip } } - private void registerApp( int iconIndex, Settings setting, Enum val, ButtonToolTips title, Object hint ) + private void registerApp( final int iconIndex, final Settings setting, final Enum val, final ButtonToolTips title, final Object hint ) { - ButtonAppearance a = new ButtonAppearance(); + final ButtonAppearance a = new ButtonAppearance(); a.displayName = title.getUnlocalized(); a.displayValue = (String) ( hint instanceof String ? hint : ( (ButtonToolTips) hint ).getUnlocalized() ); a.index = iconIndex; appearances.put( new EnumPair( setting, val ), a ); } - public void setVisibility( boolean vis ) + public void setVisibility( final boolean vis ) { this.visible = vis; this.enabled = vis; } @Override - public void drawButton( Minecraft par1Minecraft, int par2, int par3 ) + public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 ) { if( this.visible ) { - int iconIndex = this.getIconIndex(); + final int iconIndex = this.getIconIndex(); if( this.halfSize ) { @@ -209,8 +209,8 @@ public class GuiImgButton extends GuiButton implements ITooltip par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) ); this.hovered = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int uv_y = (int) Math.floor( iconIndex / 16 ); - int uv_x = iconIndex - uv_y * 16; + final int uv_y = (int) Math.floor( iconIndex / 16 ); + final int uv_x = iconIndex - uv_y * 16; this.drawTexturedModalRect( 0, 0, 256 - 16, 256 - 16, 16, 16 ); this.drawTexturedModalRect( 0, 0, uv_x * 16, uv_y * 16, 16, 16 ); @@ -232,8 +232,8 @@ public class GuiImgButton extends GuiButton implements ITooltip par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) ); this.hovered = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int uv_y = (int) Math.floor( iconIndex / 16 ); - int uv_x = iconIndex - uv_y * 16; + final int uv_y = (int) Math.floor( iconIndex / 16 ); + final int uv_x = iconIndex - uv_y * 16; this.drawTexturedModalRect( this.xPosition, this.yPosition, 256 - 16, 256 - 16, 16, 16 ); this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, uv_y * 16, 16, 16 ); @@ -247,7 +247,7 @@ public class GuiImgButton extends GuiButton implements ITooltip { if( this.buttonSetting != null && this.currentValue != null ) { - ButtonAppearance app = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) ); + final ButtonAppearance app = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) ); if( app == null ) { return 256 - 1; @@ -275,7 +275,7 @@ public class GuiImgButton extends GuiButton implements ITooltip if( this.buttonSetting != null && this.currentValue != null ) { - ButtonAppearance buttonAppearance = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) ); + final ButtonAppearance buttonAppearance = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) ); if( buttonAppearance == null ) { return "No Such Message"; @@ -305,7 +305,7 @@ public class GuiImgButton extends GuiButton implements ITooltip } value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" ); - StringBuilder sb = new StringBuilder( value ); + final StringBuilder sb = new StringBuilder( value ); int i = sb.lastIndexOf( "\n" ); if( i <= 0 ) @@ -352,7 +352,7 @@ public class GuiImgButton extends GuiButton implements ITooltip return this.visible; } - public void set( Enum e ) + public void set( final Enum e ) { if( this.currentValue != e ) { @@ -366,7 +366,7 @@ public class GuiImgButton extends GuiButton implements ITooltip final Enum setting; final Enum value; - EnumPair( Enum a, Enum b ) + EnumPair( final Enum a, final Enum b ) { this.setting = a; this.value = b; @@ -379,7 +379,7 @@ public class GuiImgButton extends GuiButton implements ITooltip } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -389,7 +389,7 @@ public class GuiImgButton extends GuiButton implements ITooltip { return false; } - EnumPair other = (EnumPair) obj; + final EnumPair other = (EnumPair) obj; return other.setting == this.setting && other.value == this.value; } } diff --git a/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java b/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java index 8c59e2be..0ebd4445 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java +++ b/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java @@ -28,16 +28,16 @@ public class GuiNumberBox extends GuiTextField final Class type; - public GuiNumberBox( FontRenderer fontRenderer, int x, int y, int width, int height, Class type ) + public GuiNumberBox( final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type ) { super( 0, fontRenderer, x, y, width, height ); this.type = type; } @Override - public void writeText( String selectedText ) + public void writeText( final String selectedText ) { - String original = this.getText(); + final String original = this.getText(); super.writeText( selectedText ); try @@ -55,7 +55,7 @@ public class GuiNumberBox extends GuiTextField Double.parseDouble( this.getText() ); } } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { this.setText( original ); } diff --git a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java index a126bdf5..f8ce4c10 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java +++ b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java @@ -37,12 +37,12 @@ public class GuiProgressBar extends GuiButton implements ITooltip private final String titleName; private String fullMsg; - public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir ) + public GuiProgressBar( final IProgressProvider source, final String texture, final int posX, final int posY, final int u, final int y, final int width, final int height, final Direction dir ) { this( source, texture, posX, posY, u, y, width, height, dir, null ); } - public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir, String title ) + public GuiProgressBar( final IProgressProvider source, final String texture, final int posX, final int posY, final int u, final int y, final int width, final int height, final Direction dir, final String title ) { super( posX, posY, width, "" ); this.source = source; @@ -58,22 +58,22 @@ public class GuiProgressBar extends GuiButton implements ITooltip } @Override - public void drawButton( Minecraft par1Minecraft, int par2, int par3 ) + public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 ) { if( this.visible ) { par1Minecraft.getTextureManager().bindTexture( this.texture ); - int max = this.source.getMaxProgress(); - int current = this.source.getCurrentProgress(); + final int max = this.source.getMaxProgress(); + final int current = this.source.getCurrentProgress(); if( this.layout == Direction.VERTICAL ) { - int diff = this.height - ( max > 0 ? ( this.height * current ) / max : 0 ); + final int diff = this.height - ( max > 0 ? ( this.height * current ) / max : 0 ); this.drawTexturedModalRect( this.xPosition, this.yPosition + diff, this.fill_u, this.fill_v + diff, this.width, this.height - diff ); } else { - int diff = this.width - ( max > 0 ? ( this.width * current ) / max : 0 ); + final int diff = this.width - ( max > 0 ? ( this.width * current ) / max : 0 ); this.drawTexturedModalRect( this.xPosition, this.yPosition, this.fill_u + diff, this.fill_v, this.width - diff, this.height ); } @@ -81,7 +81,7 @@ public class GuiProgressBar extends GuiButton implements ITooltip } } - public void setFullMsg( String msg ) + public void setFullMsg( final String msg ) { this.fullMsg = msg; } diff --git a/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java b/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java index 301b2a08..6de88922 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java +++ b/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java @@ -37,7 +37,7 @@ public class GuiScrollbar implements IScrollSource private int minScroll = 0; private int currentScroll = 0; - public void draw( AEBaseGui g ) + public void draw( final AEBaseGui g ) { g.bindTexture( "minecraft", "gui/container/creative_inventory/tabs.png" ); GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); @@ -48,7 +48,7 @@ public class GuiScrollbar implements IScrollSource } else { - int offset = ( this.currentScroll - this.minScroll ) * ( this.height - 15 ) / this.getRange(); + final int offset = ( this.currentScroll - this.minScroll ) * ( this.height - 15 ) / this.getRange(); g.drawTexturedModalRect( this.displayX, offset + this.displayY, 232, 0, this.width, 15 ); } } @@ -63,7 +63,7 @@ public class GuiScrollbar implements IScrollSource return this.displayX; } - public GuiScrollbar setLeft( int v ) + public GuiScrollbar setLeft( final int v ) { this.displayX = v; return this; @@ -74,7 +74,7 @@ public class GuiScrollbar implements IScrollSource return this.displayY; } - public GuiScrollbar setTop( int v ) + public GuiScrollbar setTop( final int v ) { this.displayY = v; return this; @@ -85,7 +85,7 @@ public class GuiScrollbar implements IScrollSource return this.width; } - public GuiScrollbar setWidth( int v ) + public GuiScrollbar setWidth( final int v ) { this.width = v; return this; @@ -96,13 +96,13 @@ public class GuiScrollbar implements IScrollSource return this.height; } - public GuiScrollbar setHeight( int v ) + public GuiScrollbar setHeight( final int v ) { this.height = v; return this; } - public void setRange( int min, int max, int pageSize ) + public void setRange( final int min, final int max, final int pageSize ) { this.minScroll = min; this.maxScroll = max; @@ -127,7 +127,7 @@ public class GuiScrollbar implements IScrollSource return this.currentScroll; } - public void click( AEBaseGui aeBaseGui, int x, int y ) + public void click( final AEBaseGui aeBaseGui, final int x, final int y ) { if( this.getRange() == 0 ) { diff --git a/src/main/java/appeng/client/gui/widgets/GuiTabButton.java b/src/main/java/appeng/client/gui/widgets/GuiTabButton.java index fd352962..b304731d 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiTabButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiTabButton.java @@ -39,7 +39,7 @@ public class GuiTabButton extends GuiButton implements ITooltip private int myIcon = -1; private ItemStack myItem; - public GuiTabButton( int x, int y, int ico, String message, RenderItem ir ) + public GuiTabButton( final int x, final int y, final int ico, final String message, final RenderItem ir ) { super( 0, 0, 16, "" ); @@ -61,7 +61,7 @@ public class GuiTabButton extends GuiButton implements ITooltip * @param message mouse over message * @param ir renderer */ - public GuiTabButton( int x, int y, ItemStack ico, String message, RenderItem ir ) + public GuiTabButton( final int x, final int y, final ItemStack ico, final String message, final RenderItem ir ) { super( 0, 0, 16, "" ); this.xPosition = x; @@ -74,7 +74,7 @@ public class GuiTabButton extends GuiButton implements ITooltip } @Override - public void drawButton( Minecraft minecraft, int x, int y ) + public void drawButton( final Minecraft minecraft, final int x, final int y ) { if( this.visible ) { @@ -84,13 +84,13 @@ public class GuiTabButton extends GuiButton implements ITooltip int uv_x = ( this.hideEdge > 0 ? 11 : 13 ); - int offsetX = this.hideEdge > 0 ? 1 : 0; + final int offsetX = this.hideEdge > 0 ? 1 : 0; this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, 0, 25, 22 ); if( this.myIcon >= 0 ) { - int uv_y = (int) Math.floor( this.myIcon / 16 ); + final int uv_y = (int) Math.floor( this.myIcon / 16 ); uv_x = this.myIcon - uv_y * 16; this.drawTexturedModalRect( offsetX + this.xPosition + 3, this.yPosition + 3, uv_x * 16, uv_y * 16, 16, 16 ); diff --git a/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java b/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java index 9c7e8bc3..8b382206 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java @@ -41,7 +41,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip private boolean isActive; - public GuiToggleButton( int x, int y, int on, int off, String displayName, String displayHint ) + public GuiToggleButton( final int x, final int y, final int on, final int off, final String displayName, final String displayHint ) { super( 0, 0, 16, "" ); this.iconIdxOn = on; @@ -54,24 +54,24 @@ public class GuiToggleButton extends GuiButton implements ITooltip this.height = 16; } - public void setState( boolean isOn ) + public void setState( final boolean isOn ) { this.isActive = isOn; } @Override - public void drawButton( Minecraft par1Minecraft, int par2, int par3 ) + public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 ) { if( this.visible ) { - int iconIndex = this.getIconIndex(); + final int iconIndex = this.getIconIndex(); GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) ); this.hovered = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int uv_y = (int) Math.floor( iconIndex / 16 ); - int uv_x = iconIndex - uv_y * 16; + final int uv_y = (int) Math.floor( iconIndex / 16 ); + final int uv_x = iconIndex - uv_y * 16; this.drawTexturedModalRect( this.xPosition, this.yPosition, 256 - 16, 256 - 16, 16, 16 ); this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, uv_y * 16, 16, 16 ); @@ -102,7 +102,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip } value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" ); - StringBuilder sb = new StringBuilder( value ); + final StringBuilder sb = new StringBuilder( value ); int i = sb.lastIndexOf( "\n" ); if( i <= 0 ) diff --git a/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java b/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java index 57ed0186..f10cbca7 100644 --- a/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java +++ b/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java @@ -50,7 +50,7 @@ public class MEGuiTextField extends GuiTextField * @param width absolute width * @param height absolute height */ - public MEGuiTextField( FontRenderer fontRenderer, int xPos, int yPos, int width, int height ) + public MEGuiTextField( final FontRenderer fontRenderer, final int xPos, final int yPos, final int width, final int height ) { super( 0, fontRenderer, xPos + PADDING, yPos + PADDING, width - 2 * PADDING - fontRenderer.getCharWidth( '_' ), height - 2 * PADDING ); @@ -61,7 +61,7 @@ public class MEGuiTextField extends GuiTextField } @Override - public void mouseClicked( int xPos, int yPos, int button ) + public void mouseClicked( final int xPos, final int yPos, final int button ) { super.mouseClicked( xPos, yPos, button ); @@ -78,7 +78,7 @@ public class MEGuiTextField extends GuiTextField * * @return true if mouse position is within the text field area */ - public boolean isMouseIn( int xCoord, int yCoord ) + public boolean isMouseIn( final int xCoord, final int yCoord ) { final boolean withinXRange = this._xPos <= xCoord && xCoord < this._xPos + this._width; final boolean withinYRange = this._yPos <= yCoord && yCoord < this._yPos + this._height; diff --git a/src/main/java/appeng/client/me/ClientDCInternalInv.java b/src/main/java/appeng/client/me/ClientDCInternalInv.java index c830350f..c539f794 100644 --- a/src/main/java/appeng/client/me/ClientDCInternalInv.java +++ b/src/main/java/appeng/client/me/ClientDCInternalInv.java @@ -34,7 +34,7 @@ public class ClientDCInternalInv implements Comparable public final long id; public final long sortBy; - public ClientDCInternalInv( int size, long id, long sortBy, String unlocalizedName ) + public ClientDCInternalInv( final int size, final long id, final long sortBy, final String unlocalizedName ) { this.inv = new AppEngInternalInventory( null, size ); this.unlocalizedName = unlocalizedName; @@ -44,7 +44,7 @@ public class ClientDCInternalInv implements Comparable public String getName() { - String s = StatCollector.translateToLocal( this.unlocalizedName + ".name" ); + final String s = StatCollector.translateToLocal( this.unlocalizedName + ".name" ); if( s.equals( this.unlocalizedName + ".name" ) ) { return StatCollector.translateToLocal( this.unlocalizedName ); @@ -53,7 +53,7 @@ public class ClientDCInternalInv implements Comparable } @Override - public int compareTo( @Nonnull ClientDCInternalInv o ) + public int compareTo( @Nonnull final ClientDCInternalInv o ) { return ItemSorters.compareLong( this.sortBy, o.sortBy ); } diff --git a/src/main/java/appeng/client/me/InternalSlotME.java b/src/main/java/appeng/client/me/InternalSlotME.java index 57bdb542..2d25ad36 100644 --- a/src/main/java/appeng/client/me/InternalSlotME.java +++ b/src/main/java/appeng/client/me/InternalSlotME.java @@ -31,7 +31,7 @@ public class InternalSlotME public final int yPos; private final ItemRepo repo; - public InternalSlotME( ItemRepo def, int offset, int displayX, int displayY ) + public InternalSlotME( final ItemRepo def, final int offset, final int displayX, final int displayY ) { this.repo = def; this.offset = offset; diff --git a/src/main/java/appeng/client/me/ItemRepo.java b/src/main/java/appeng/client/me/ItemRepo.java index b09c6d47..1cba5d36 100644 --- a/src/main/java/appeng/client/me/ItemRepo.java +++ b/src/main/java/appeng/client/me/ItemRepo.java @@ -61,7 +61,7 @@ public class ItemRepo private String NEIWord = null; private boolean hasPower; - public ItemRepo( IScrollSource src, ISortSource sortSrc ) + public ItemRepo( final IScrollSource src, final ISortSource sortSrc ) { this.src = src; this.sortSrc = sortSrc; @@ -89,14 +89,14 @@ public class ItemRepo return this.dsp.get( idx ); } - void setSearch( String search ) + void setSearch( final String search ) { this.searchString = search == null ? "" : search; } - public void postUpdate( IAEItemStack is ) + public void postUpdate( final IAEItemStack is ) { - IAEItemStack st = this.list.findPrecise( is ); + final IAEItemStack st = this.list.findPrecise( is ); if( st != null ) { @@ -109,7 +109,7 @@ public class ItemRepo } } - public void setViewCell( ItemStack[] list ) + public void setViewCell( final ItemStack[] list ) { this.myPartitionList = ItemViewCell.createFilter( list ); this.updateView(); @@ -123,15 +123,15 @@ public class ItemRepo this.view.ensureCapacity( this.list.size() ); this.dsp.ensureCapacity( this.list.size() ); - Enum viewMode = this.sortSrc.getSortDisplay(); - Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); + final Enum viewMode = this.sortSrc.getSortDisplay(); + final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); if( searchMode == SearchBoxMode.NEI_AUTOSEARCH || searchMode == SearchBoxMode.NEI_MANUAL_SEARCH ) { this.updateNEI( this.searchString ); } this.innerSearch = this.searchString; - boolean terminalSearchToolTips = AEConfig.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO; + final boolean terminalSearchToolTips = AEConfig.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO; // boolean terminalSearchMods = Configuration.INSTANCE.settings.getSetting( Settings.SEARCH_MODS ) != YesNo.NO; boolean searchMod = false; @@ -146,13 +146,13 @@ public class ItemRepo { m = Pattern.compile( this.innerSearch.toLowerCase(), Pattern.CASE_INSENSITIVE ); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { try { m = Pattern.compile( Pattern.quote( this.innerSearch.toLowerCase() ), Pattern.CASE_INSENSITIVE ); } - catch( Throwable __ ) + catch( final Throwable __ ) { return; } @@ -185,7 +185,7 @@ public class ItemRepo continue; } - String dspName = searchMod ? Platform.getModId( is ) : Platform.getItemDisplayName( is ); + final String dspName = searchMod ? Platform.getModId( is ) : Platform.getItemDisplayName( is ); notDone = true; if( m.matcher( dspName.toLowerCase() ).find() ) @@ -196,7 +196,7 @@ public class ItemRepo if( terminalSearchToolTips && notDone ) { - for( Object lp : Platform.getTooltip( is ) ) + for( final Object lp : Platform.getTooltip( is ) ) { if( lp instanceof String && m.matcher( (CharSequence) lp ).find() ) { @@ -213,8 +213,8 @@ public class ItemRepo */ } - Enum SortBy = this.sortSrc.getSortBy(); - Enum SortDir = this.sortSrc.getSortDir(); + final Enum SortBy = this.sortSrc.getSortBy(); + final Enum SortDir = this.sortSrc.getSortDir(); ItemSorters.Direction = (appeng.api.config.SortDir) SortDir; ItemSorters.init(); @@ -236,31 +236,31 @@ public class ItemRepo Collections.sort( this.view, ItemSorters.CONFIG_BASED_SORT_BY_NAME ); } - for( IAEItemStack is : this.view ) + for( final IAEItemStack is : this.view ) { this.dsp.add( is.getItemStack() ); } } - private void updateNEI( String filter ) + private void updateNEI( final String filter ) { try { if( this.NEIWord == null || !this.NEIWord.equals( filter ) ) { - Class c = ReflectionHelper.getClass( this.getClass().getClassLoader(), "codechicken.nei.LayoutManager" ); - Field fldSearchField = c.getField( "searchField" ); - Object searchField = fldSearchField.get( c ); + final Class c = ReflectionHelper.getClass( this.getClass().getClassLoader(), "codechicken.nei.LayoutManager" ); + final Field fldSearchField = c.getField( "searchField" ); + final Object searchField = fldSearchField.get( c ); - Method a = searchField.getClass().getMethod( "setText", String.class ); - Method b = searchField.getClass().getMethod( "onTextChange", String.class ); + final Method a = searchField.getClass().getMethod( "setText", String.class ); + final Method b = searchField.getClass().getMethod( "onTextChange", String.class ); this.NEIWord = filter; a.invoke( searchField, filter ); b.invoke( searchField, "" ); } } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } @@ -281,7 +281,7 @@ public class ItemRepo return this.hasPower; } - public void setPower( boolean hasPower ) + public void setPower( final boolean hasPower ) { this.hasPower = hasPower; } diff --git a/src/main/java/appeng/client/me/SlotDisconnected.java b/src/main/java/appeng/client/me/SlotDisconnected.java index b09c4ceb..00fa56c2 100644 --- a/src/main/java/appeng/client/me/SlotDisconnected.java +++ b/src/main/java/appeng/client/me/SlotDisconnected.java @@ -32,26 +32,26 @@ public class SlotDisconnected extends AppEngSlot public final ClientDCInternalInv mySlot; - public SlotDisconnected( ClientDCInternalInv me, int which, int x, int y ) + public SlotDisconnected( final ClientDCInternalInv me, final int which, final int x, final int y ) { super( me.inv, which, x, y ); this.mySlot = me; } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } @@ -61,11 +61,11 @@ public class SlotDisconnected extends AppEngSlot { if( Platform.isClient() ) { - ItemStack is = super.getStack(); + final ItemStack is = super.getStack(); if( is != null && is.getItem() instanceof ItemEncodedPattern ) { - ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); - ItemStack out = iep.getOutput( is ); + final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); + final ItemStack out = iep.getOutput( is ); if( out != null ) { return out; @@ -76,7 +76,7 @@ public class SlotDisconnected extends AppEngSlot } @Override - public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack ) + public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack ) { } @@ -93,13 +93,13 @@ public class SlotDisconnected extends AppEngSlot } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { return null; } @Override - public boolean isHere( IInventory inv, int slotIn ) + public boolean isHere( final IInventory inv, final int slotIn ) { return false; } diff --git a/src/main/java/appeng/client/me/SlotME.java b/src/main/java/appeng/client/me/SlotME.java index 054be505..3024bdbc 100644 --- a/src/main/java/appeng/client/me/SlotME.java +++ b/src/main/java/appeng/client/me/SlotME.java @@ -32,7 +32,7 @@ public class SlotME extends Slot public final InternalSlotME mySlot; - public SlotME( InternalSlotME me ) + public SlotME( final InternalSlotME me ) { super( null, 0, me.xPos, me.yPos ); this.mySlot = me; @@ -48,12 +48,12 @@ public class SlotME extends Slot } @Override - public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack ) + public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack ) { } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @@ -79,7 +79,7 @@ public class SlotME extends Slot } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { } @@ -91,19 +91,19 @@ public class SlotME extends Slot } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { return null; } @Override - public boolean isHere( IInventory inv, int slotIn ) + public boolean isHere( final IInventory inv, final int slotIn ) { return false; } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } diff --git a/src/main/java/appeng/client/render/AppEngRenderItem.java b/src/main/java/appeng/client/render/AppEngRenderItem.java index a02cc268..9655591c 100644 --- a/src/main/java/appeng/client/render/AppEngRenderItem.java +++ b/src/main/java/appeng/client/render/AppEngRenderItem.java @@ -46,8 +46,8 @@ import appeng.util.ReadableNumberConverter; public class AppEngRenderItem extends RenderItem { public AppEngRenderItem( - TextureManager textureManager, - ModelManager modelManager ) + final TextureManager textureManager, + final ModelManager modelManager ) { super( textureManager, modelManager ); } @@ -59,35 +59,35 @@ public class AppEngRenderItem extends RenderItem @Override public void renderItemOverlayIntoGUI( - FontRenderer fontRenderer, - ItemStack is, - int xPos, - int yPos, - String text ) + final FontRenderer fontRenderer, + final ItemStack is, + final int xPos, + final int yPos, + final String text ) { if( is != null ) { - float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f; - float inverseScaleFactor = 1.0f / scaleFactor; - int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1; + final float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f; + final float inverseScaleFactor = 1.0f / scaleFactor; + final int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1; - boolean unicodeFlag = fontRenderer.getUnicodeFlag(); + final boolean unicodeFlag = fontRenderer.getUnicodeFlag(); fontRenderer.setUnicodeFlag( false ); if( is.getItem().showDurabilityBar( is ) ) { - double health = is.getItem().getDurabilityForDisplay( is ); - int j1 = (int) Math.round( 13.0D - health * 13.0D ); - int k = (int) Math.round( 255.0D - health * 255.0D ); + final double health = is.getItem().getDurabilityForDisplay( is ); + final int j1 = (int) Math.round( 13.0D - health * 13.0D ); + final int k = (int) Math.round( 255.0D - health * 255.0D ); GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_DEPTH_TEST ); GL11.glDisable( GL11.GL_TEXTURE_2D ); GL11.glDisable( GL11.GL_ALPHA_TEST ); GL11.glDisable( GL11.GL_BLEND ); - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer wr = tessellator.getWorldRenderer(); - int l = 255 - k << 16 | k << 8; - int i1 = ( 255 - k ) / 4 << 16 | 16128; + final Tessellator tessellator = Tessellator.getInstance(); + final WorldRenderer wr = tessellator.getWorldRenderer(); + final int l = 255 - k << 16 | k << 8; + final int i1 = ( 255 - k ) / 4 << 16 | 16128; this.renderQuad( tessellator, xPos + 2, yPos + 13, 13, 2, 0 ); this.renderQuad( tessellator, xPos + 2, yPos + 13, 12, 1, i1 ); this.renderQuad( tessellator, xPos + 2, yPos + 13, j1, 1, l ); @@ -100,20 +100,20 @@ public class AppEngRenderItem extends RenderItem if( is.stackSize == 0 ) { - String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal(); + final String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal(); GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_DEPTH_TEST ); GL11.glPushMatrix(); GL11.glScaled( scaleFactor, scaleFactor, scaleFactor ); - int X = (int) ( ( (float) xPos + offset + 16.0f - fontRenderer.getStringWidth( craftLabelText ) * scaleFactor ) * inverseScaleFactor ); - int Y = (int) ( ( (float) yPos + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor ); + final int X = (int) ( ( (float) xPos + offset + 16.0f - fontRenderer.getStringWidth( craftLabelText ) * scaleFactor ) * inverseScaleFactor ); + final int Y = (int) ( ( (float) yPos + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor ); fontRenderer.drawStringWithShadow( craftLabelText, X, Y, 16777215 ); GL11.glPopMatrix(); GL11.glEnable( GL11.GL_LIGHTING ); GL11.glEnable( GL11.GL_DEPTH_TEST ); } - long amount = this.aeStack != null ? this.aeStack.getStackSize() : is.stackSize; + final long amount = this.aeStack != null ? this.aeStack.getStackSize() : is.stackSize; if( amount != 0 ) { final String stackSize = this.getToBeRenderedStackSize( amount ); @@ -122,8 +122,8 @@ public class AppEngRenderItem extends RenderItem GL11.glDisable( GL11.GL_DEPTH_TEST ); GL11.glPushMatrix(); GL11.glScaled( scaleFactor, scaleFactor, scaleFactor ); - int X = (int) ( ( (float) xPos + offset + 16.0f - fontRenderer.getStringWidth( stackSize ) * scaleFactor ) * inverseScaleFactor ); - int Y = (int) ( ( (float) yPos + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor ); + final int X = (int) ( ( (float) xPos + offset + 16.0f - fontRenderer.getStringWidth( stackSize ) * scaleFactor ) * inverseScaleFactor ); + final int Y = (int) ( ( (float) yPos + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor ); fontRenderer.drawStringWithShadow( stackSize, X, Y, 16777215 ); GL11.glPopMatrix(); GL11.glEnable( GL11.GL_LIGHTING ); @@ -134,9 +134,9 @@ public class AppEngRenderItem extends RenderItem } } - private void renderQuad( Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6 ) + private void renderQuad( final Tessellator par1Tessellator, final int par2, final int par3, final int par4, final int par5, final int par6 ) { - WorldRenderer wr = par1Tessellator.getWorldRenderer(); + final WorldRenderer wr = par1Tessellator.getWorldRenderer(); wr.startDrawingQuads(); wr.setColorOpaque_I( par6 ); @@ -147,7 +147,7 @@ public class AppEngRenderItem extends RenderItem par1Tessellator.draw(); } - private String getToBeRenderedStackSize( long originalSize ) + private String getToBeRenderedStackSize( final long originalSize ) { if( AEConfig.instance.useTerminalUseLargeFont() ) { diff --git a/src/main/java/appeng/client/render/BaseBlockRender.java b/src/main/java/appeng/client/render/BaseBlockRender.java index 0b7ef7c9..0ba71bb5 100644 --- a/src/main/java/appeng/client/render/BaseBlockRender.java +++ b/src/main/java/appeng/client/render/BaseBlockRender.java @@ -73,7 +73,7 @@ public class BaseBlockRender this( false, 20 ); } - public BaseBlockRender( boolean enableTESR, double renderDistance ) + public BaseBlockRender( final boolean enableTESR, final double renderDistance ) { this.hasTESR = enableTESR; this.renderDistance = renderDistance; @@ -262,7 +262,7 @@ public class BaseBlockRender return this.hasTESR; } - protected int adjustBrightness( int v, double d ) + protected int adjustBrightness( final int v, final double d ) { int r = 0xff & ( v >> 16 ); int g = 0xff & ( v >> 8 ); @@ -284,9 +284,9 @@ public class BaseBlockRender return this.renderDistance; } - public void renderInventory( B block, ItemStack item, ModelGenerator renderer, ItemRenderType type, Object[] data ) + public void renderInventory( final B block, final ItemStack item, final ModelGenerator renderer, final ItemRenderType type, final Object[] data ) { - BlockRenderInfo info = block.getRendererInstance(); + final BlockRenderInfo info = block.getRendererInstance(); if( info.isValid() ) { if( block.hasSubtypes() ) @@ -314,7 +314,7 @@ public class BaseBlockRender renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } - public static int getOrientation( EnumFacing in, EnumFacing forward, EnumFacing up ) + public static int getOrientation( final EnumFacing in, final EnumFacing forward, final EnumFacing up ) { if( in == null // 1 || forward == null // 2 @@ -323,22 +323,22 @@ public class BaseBlockRender return 0; } - int a = in.ordinal(); - int b = forward.ordinal(); - int c = up.ordinal(); + final int a = in.ordinal(); + final int b = forward.ordinal(); + final int c = up.ordinal(); return ORIENTATION_MAP[a][b][c]; } - public void renderInvBlock( EnumSet sides, B block, ItemStack item, int color, ModelGenerator tess ) + public void renderInvBlock( final EnumSet sides, final B block, final ItemStack item, final int color, final ModelGenerator tess ) { if( block != null && block.hasSubtypes() && item != null ) { - int meta = item.getItemDamage(); + final int meta = item.getItemDamage(); } - IAESprite[] icons = tess.getIcon( item == null ? block.getDefaultState() : block.getStateFromMeta( item.getMetadata() ) ); - BlockPos zero = new BlockPos(0,0,0); + final IAESprite[] icons = tess.getIcon( item == null ? block.getDefaultState() : block.getStateFromMeta( item.getMetadata() ) ); + final BlockPos zero = new BlockPos(0,0,0); if( sides.contains( AEPartLocation.DOWN ) ) { @@ -383,9 +383,9 @@ public class BaseBlockRender } } - public IAESprite firstNotNull( IAESprite... s ) + public IAESprite firstNotNull( final IAESprite... s ) { - for( IAESprite o : s ) + for( final IAESprite o : s ) { if( o != null ) { @@ -395,25 +395,25 @@ public class BaseBlockRender return ExtraBlockTextures.getMissing(); } - public boolean renderInWorld( B block, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public boolean renderInWorld( final B block, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { this.preRenderInWorld( block, world, pos, renderer ); - boolean o = renderer.renderStandardBlock( block, pos ); + final boolean o = renderer.renderStandardBlock( block, pos ); this.postRenderInWorld( renderer ); return o; } - public void preRenderInWorld( B block, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public void preRenderInWorld( final B block, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { - BlockRenderInfo info = block.getRendererInstance(); - IOrientable te = this.getOrientable( block, world, pos ); + final BlockRenderInfo info = block.getRendererInstance(); + final IOrientable te = this.getOrientable( block, world, pos ); if( te != null ) { - EnumFacing forward = te.getForward(); - EnumFacing up = te.getUp(); + final EnumFacing forward = te.getForward(); + final EnumFacing up = te.getUp(); renderer.uvRotateBottom = info.getTexture( AEPartLocation.DOWN ).setFlip( getOrientation( EnumFacing.DOWN, forward, up ) ); renderer.uvRotateTop = info.getTexture( AEPartLocation.UP ).setFlip( getOrientation( EnumFacing.UP, forward, up ) ); @@ -426,29 +426,29 @@ public class BaseBlockRender } } - public void postRenderInWorld( ModelGenerator renderer ) + public void postRenderInWorld( final ModelGenerator renderer ) { renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } @Nullable - public IOrientable getOrientable( B block, IBlockAccess w, BlockPos pos ) + public IOrientable getOrientable( final B block, final IBlockAccess w, final BlockPos pos ) { return block.getOrientable( w, pos ); } - protected void setInvRenderBounds( ModelGenerator renderer, int i, int j, int k, int l, int m, int n ) + protected void setInvRenderBounds( final ModelGenerator renderer, final int i, final int j, final int k, final int l, final int m, final int n ) { renderer.setRenderBounds( i / 16.0, j / 16.0, k / 16.0, l / 16.0, m / 16.0, n / 16.0 ); } - protected void renderBlockBounds( ModelGenerator renderer, + protected void renderBlockBounds( final ModelGenerator renderer, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, - EnumFacing x, EnumFacing y, EnumFacing z ) + final EnumFacing x, final EnumFacing y, final EnumFacing z ) { minX /= 16.0; minY /= 16.0; @@ -492,7 +492,7 @@ public class BaseBlockRender } @SideOnly( Side.CLIENT ) - protected void renderCutoutFace( B block, IAESprite ico, BlockPos pos, ModelGenerator tess, EnumFacing orientation, float edgeThickness ) + protected void renderCutoutFace( final B block, final IAESprite ico, final BlockPos pos, final ModelGenerator tess, final EnumFacing orientation, final float edgeThickness ) { double offsetX = 0.0; double offsetY = 0.0; @@ -555,8 +555,8 @@ public class BaseBlockRender offsetY += pos.getY(); offsetZ += pos.getZ(); - double layerBX = 0.0; - double layerAY = 0.0; + final double layerBX = 0.0; + final double layerAY = 0.0; this.renderFace(orientation, tess, offsetX, offsetY, offsetZ, layerAX, layerAY, layerAZ, layerBX, layerBY, layerBZ, // u -> u 0, 1.0, @@ -583,7 +583,7 @@ public class BaseBlockRender } @SideOnly( Side.CLIENT ) - private void renderFace( EnumFacing face, ModelGenerator tess, double offsetX, double offsetY, double offsetZ, double ax, double ay, double az, double bx, double by, double bz, double ua, double ub, double va, double vb, IAESprite ico, boolean flip ) + private void renderFace( final EnumFacing face, final ModelGenerator tess, final double offsetX, final double offsetY, final double offsetZ, final double ax, final double ay, final double az, final double bx, final double by, final double bz, final double ua, final double ub, final double va, final double vb, final IAESprite ico, final boolean flip ) { if( flip ) { @@ -602,7 +602,7 @@ public class BaseBlockRender } @SideOnly( Side.CLIENT ) - protected void renderFace( BlockPos pos, B block, IAESprite ico, ModelGenerator renderer, EnumFacing orientation ) + protected void renderFace( final BlockPos pos, final B block, final IAESprite ico, final ModelGenerator renderer, final EnumFacing orientation ) { switch( orientation ) { @@ -629,18 +629,18 @@ public class BaseBlockRender } } - public void selectFace( ModelGenerator renderer, EnumFacing west, EnumFacing up, EnumFacing forward, int u1, int u2, int v1, int v2 ) + public void selectFace( final ModelGenerator renderer, final EnumFacing west, final EnumFacing up, final EnumFacing forward, final int u1, final int u2, int v1, int v2 ) { v1 = 16 - v1; v2 = 16 - v2; - double minX = ( forward.getFrontOffsetX() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetX(), u1 ) + this.mapFaceUV( up.getFrontOffsetX(), v1 ); - double minY = ( forward.getFrontOffsetY() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetY(), u1 ) + this.mapFaceUV( up.getFrontOffsetY(), v1 ); - double minZ = ( forward.getFrontOffsetZ() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetZ(), u1 ) + this.mapFaceUV( up.getFrontOffsetZ(), v1 ); + final double minX = ( forward.getFrontOffsetX() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetX(), u1 ) + this.mapFaceUV( up.getFrontOffsetX(), v1 ); + final double minY = ( forward.getFrontOffsetY() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetY(), u1 ) + this.mapFaceUV( up.getFrontOffsetY(), v1 ); + final double minZ = ( forward.getFrontOffsetZ() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetZ(), u1 ) + this.mapFaceUV( up.getFrontOffsetZ(), v1 ); - double maxX = ( forward.getFrontOffsetX() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetX(), u2 ) + this.mapFaceUV( up.getFrontOffsetX(), v2 ); - double maxY = ( forward.getFrontOffsetY() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetY(), u2 ) + this.mapFaceUV( up.getFrontOffsetY(), v2 ); - double maxZ = ( forward.getFrontOffsetZ() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetZ(), u2 ) + this.mapFaceUV( up.getFrontOffsetZ(), v2 ); + final double maxX = ( forward.getFrontOffsetX() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetX(), u2 ) + this.mapFaceUV( up.getFrontOffsetX(), v2 ); + final double maxY = ( forward.getFrontOffsetY() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetY(), u2 ) + this.mapFaceUV( up.getFrontOffsetY(), v2 ); + final double maxZ = ( forward.getFrontOffsetZ() > 0 ? 1 : 0 ) + this.mapFaceUV( west.getFrontOffsetZ(), u2 ) + this.mapFaceUV( up.getFrontOffsetZ(), v2 ); renderer.renderMinX = Math.max( 0.0, Math.min( minX, maxX ) - ( forward.getFrontOffsetX() != 0 ? 0 : 0.001 ) ); renderer.renderMaxX = Math.min( 1.0, Math.max( minX, maxX ) + ( forward.getFrontOffsetX() != 0 ? 0 : 0.001 ) ); @@ -652,7 +652,7 @@ public class BaseBlockRender renderer.renderMaxZ = Math.min( 1.0, Math.max( minZ, maxZ ) + ( forward.getFrontOffsetZ() != 0 ? 0 : 0.001 ) ); } - private double mapFaceUV( int offset, int uv ) + private double mapFaceUV( final int offset, final int uv ) { if( offset == 0 ) { @@ -667,13 +667,13 @@ public class BaseBlockRender return ( 16.0 - uv ) / 16.0; } - public void renderTile( B block, T tile, WorldRenderer tess, double x, double y, double z, float f, ModelGenerator renderer ) + public void renderTile( final B block, final T tile, final WorldRenderer tess, final double x, final double y, final double z, final float f, final ModelGenerator renderer ) { renderer.uvRotateBottom = renderer.uvRotateTop = renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0; - AEPartLocation up = AEPartLocation.UP; - AEPartLocation forward = AEPartLocation.SOUTH; + final AEPartLocation up = AEPartLocation.UP; + final AEPartLocation forward = AEPartLocation.SOUTH; this.applyTESRRotation( x, y, z, forward.getFacing(), up.getFacing() ); Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture ); @@ -690,7 +690,7 @@ public class BaseBlockRender GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); - BlockPos pos = tile.getPos(); + final BlockPos pos = tile.getPos(); renderer.setTranslation( -pos.getX(), -pos.getY(), -pos.getZ() ); // note that this is a terrible approach... @@ -703,11 +703,11 @@ public class BaseBlockRender renderer.uvRotateBottom = renderer.uvRotateTop = renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0; } - protected void applyTESRRotation( double x, double y, double z, EnumFacing forward, EnumFacing up ) + protected void applyTESRRotation( final double x, final double y, final double z, final EnumFacing forward, final EnumFacing up ) { if( forward != null && up != null ) { - EnumFacing west = Platform.crossProduct( forward, up ); + final EnumFacing west = Platform.crossProduct( forward, up ); this.rotMat.put( 0, west.getFrontOffsetX() ); this.rotMat.put( 1, west.getFrontOffsetY() ); @@ -738,11 +738,11 @@ public class BaseBlockRender } } - public void doRenderItem( ItemStack itemstack, TileEntity par1EntityItemFrame ) + public void doRenderItem( final ItemStack itemstack, final TileEntity par1EntityItemFrame ) { if( itemstack != null ) { - EntityItem entityitem = new EntityItem( par1EntityItemFrame.getWorld(), 0.0D, 0.0D, 0.0D, itemstack ); + final EntityItem entityitem = new EntityItem( par1EntityItemFrame.getWorld(), 0.0D, 0.0D, 0.0D, itemstack ); entityitem.getEntityItem().stackSize = 1; // set all this stuff and then do shit? meh? diff --git a/src/main/java/appeng/client/render/BlockRenderInfo.java b/src/main/java/appeng/client/render/BlockRenderInfo.java index 8d71b1bf..1ffb49bb 100644 --- a/src/main/java/appeng/client/render/BlockRenderInfo.java +++ b/src/main/java/appeng/client/render/BlockRenderInfo.java @@ -43,12 +43,12 @@ public class BlockRenderInfo private FlippableIcon eastIcon = null; private FlippableIcon westIcon = null; - public BlockRenderInfo( BaseBlockRender inst ) + public BlockRenderInfo( final BaseBlockRender inst ) { this.rendererInstance = inst; } - public void updateIcons( FlippableIcon bottom, FlippableIcon top, FlippableIcon north, FlippableIcon south, FlippableIcon east, FlippableIcon west ) + public void updateIcons( final FlippableIcon bottom, final FlippableIcon top, final FlippableIcon north, final FlippableIcon south, final FlippableIcon east, final FlippableIcon west ) { this.topIcon = top; this.bottomIcon = bottom; @@ -58,7 +58,7 @@ public class BlockRenderInfo this.westIcon = west; } - public void setTemporaryRenderIcon( IAESprite icon ) + public void setTemporaryRenderIcon( final IAESprite icon ) { if( icon == null ) { @@ -76,7 +76,7 @@ public class BlockRenderInfo } } - public void setTemporaryRenderIcons( IAESprite nTopIcon, IAESprite nBottomIcon, IAESprite nSouthIcon, IAESprite nNorthIcon, IAESprite nEastIcon, IAESprite nWestIcon ) + public void setTemporaryRenderIcons( final IAESprite nTopIcon, final IAESprite nBottomIcon, final IAESprite nSouthIcon, final IAESprite nNorthIcon, final IAESprite nEastIcon, final IAESprite nWestIcon ) { this.tmpTopIcon.setOriginal( nTopIcon == null ? this.getTexture( AEPartLocation.UP ) : nTopIcon ); this.tmpBottomIcon.setOriginal( nBottomIcon == null ? this.getTexture( AEPartLocation.DOWN ) : nBottomIcon ); @@ -87,7 +87,7 @@ public class BlockRenderInfo this.useTmp = true; } - public FlippableIcon getTexture( AEPartLocation dir ) + public FlippableIcon getTexture( final AEPartLocation dir ) { if( this.useTmp ) { diff --git a/src/main/java/appeng/client/render/BusRenderHelper.java b/src/main/java/appeng/client/render/BusRenderHelper.java index 825c6e10..2e468257 100644 --- a/src/main/java/appeng/client/render/BusRenderHelper.java +++ b/src/main/java/appeng/client/render/BusRenderHelper.java @@ -95,14 +95,14 @@ public final class BusRenderHelper implements IPartRenderHelper return this.itemsRendered; } - public void setPass( int pass ) + public void setPass( final int pass ) { this.renderingForPass = 0; this.currentPass = pass; this.itemsRendered = 0; } - public double getBound( AEPartLocation side ) + public double getBound( final AEPartLocation side ) { switch( side ) { @@ -135,7 +135,7 @@ public final class BusRenderHelper implements IPartRenderHelper } */ - public void setOrientation( EnumFacing dx, EnumFacing dy, EnumFacing dz ) + public void setOrientation( final EnumFacing dx, final EnumFacing dy, final EnumFacing dz ) { this.ax = dx == null ? EnumFacing.EAST : dx; this.ay = dy == null ? EnumFacing.UP : dy; @@ -147,7 +147,7 @@ public final class BusRenderHelper implements IPartRenderHelper return new double[] { this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ }; } - public void setBounds( double[] bounds ) + public void setBounds( final double[] bounds ) { if( bounds == null || bounds.length != 6 ) { @@ -175,13 +175,13 @@ public final class BusRenderHelper implements IPartRenderHelper private float maxY; private float maxZ; - public BoundBoxCalculator( BusRenderHelper helper ) + public BoundBoxCalculator( final BusRenderHelper helper ) { this.helper = helper; } @Override - public void addBox( double minX, double minY, double minZ, double maxX, double maxY, double maxZ ) + public void addBox( final double minX, final double minY, final double minZ, final double maxX, final double maxY, final double maxZ ) { if( this.started ) { @@ -233,7 +233,7 @@ public final class BusRenderHelper implements IPartRenderHelper { @Nullable @Override - public AEBaseBlock apply( Block input ) + public AEBaseBlock apply( final Block input ) { if( input instanceof AEBaseBlock ) { @@ -245,7 +245,7 @@ public final class BusRenderHelper implements IPartRenderHelper } @Override - public void renderForPass( int pass ) + public void renderForPass( final int pass ) { this.renderingForPass = pass; } @@ -261,7 +261,7 @@ public final class BusRenderHelper implements IPartRenderHelper } @Override - public void setBounds( float minX, float minY, float minZ, float maxX, float maxY, float maxZ ) + public void setBounds( final float minX, final float minY, final float minZ, final float maxX, final float maxY, final float maxZ ) { this.minX = minX; this.minY = minY; @@ -272,24 +272,24 @@ public final class BusRenderHelper implements IPartRenderHelper } @Override - public void setInvColor( int newColor ) + public void setInvColor( final int newColor ) { this.color = newColor; } @Override - public void setTexture( IAESprite ico ) + public void setTexture( final IAESprite ico ) { - for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) { baseBlock.getRendererInstance().setTemporaryRenderIcon( ico ); } } @Override - public void setTexture( IAESprite down, IAESprite up, IAESprite north, IAESprite south, IAESprite west, IAESprite east ) + public void setTexture( final IAESprite down, final IAESprite up, final IAESprite north, final IAESprite south, final IAESprite west, final IAESprite east ) { - IAESprite[] list = new IAESprite[6]; + final IAESprite[] list = new IAESprite[6]; list[0] = down; list[1] = up; @@ -298,28 +298,28 @@ public final class BusRenderHelper implements IPartRenderHelper list[4] = west; list[5] = east; - for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) { baseBlock.getRendererInstance().setTemporaryRenderIcons( list[this.mapRotation( EnumFacing.UP ).ordinal()], list[this.mapRotation( EnumFacing.DOWN ).ordinal()], list[this.mapRotation( EnumFacing.SOUTH ).ordinal()], list[this.mapRotation( EnumFacing.NORTH ).ordinal()], list[this.mapRotation( EnumFacing.EAST ).ordinal()], list[this.mapRotation( EnumFacing.WEST ).ordinal()] ); } } - public EnumFacing mapRotation( EnumFacing dir ) + public EnumFacing mapRotation( final EnumFacing dir ) { - EnumFacing forward = this.az; - EnumFacing up = this.ay; + final EnumFacing forward = this.az; + final EnumFacing up = this.ay; if( forward == null || up == null ) { return dir; } - int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY(); - int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ(); - int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX(); + final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY(); + final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ(); + final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX(); EnumFacing west = null; - for( EnumFacing dx : EnumFacing.VALUES ) + for( final EnumFacing dx : EnumFacing.VALUES ) { if( dx.getFrontOffsetX() == west_x && dx.getFrontOffsetY() == west_y && dx.getFrontOffsetZ() == west_z ) { @@ -358,43 +358,43 @@ public final class BusRenderHelper implements IPartRenderHelper } @Override - public void renderInventoryBox( ModelGenerator renderer ) + public void renderInventoryBox( final ModelGenerator renderer ) { renderer.setRenderBounds( this.minX / 16.0, this.minY / 16.0, this.minZ / 16.0, this.maxX / 16.0, this.maxY / 16.0, this.maxZ / 16.0 ); - for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) { this.bbr.renderInvBlock( EnumSet.allOf( AEPartLocation.class ), baseBlock, null, this.color, renderer ); } } @Override - public void renderInventoryFace( IAESprite icon, EnumFacing face, ModelGenerator renderer ) + public void renderInventoryFace( final IAESprite icon, final EnumFacing face, final ModelGenerator renderer ) { renderer.setRenderBounds( this.minX / 16.0, this.minY / 16.0, this.minZ / 16.0, this.maxX / 16.0, this.maxY / 16.0, this.maxZ / 16.0 ); this.setTexture( icon ); - for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) { this.bbr.renderInvBlock( EnumSet.of( AEPartLocation.fromFacing( face ) ), baseBlock, null, this.color, renderer ); } } @Override - public void renderBlock( BlockPos pos, ModelGenerator renderer ) + public void renderBlock( final BlockPos pos, final ModelGenerator renderer ) { if( !this.renderThis() ) { return; } - for( Block multiPart : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) + for( final Block multiPart : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) { final AEBaseBlock block = (AEBaseBlock) multiPart; - BlockRenderInfo info = block.getRendererInstance(); - EnumFacing forward = BusRenderHelper.INSTANCE.az; - EnumFacing up = BusRenderHelper.INSTANCE.ay; + final BlockRenderInfo info = block.getRendererInstance(); + final EnumFacing forward = BusRenderHelper.INSTANCE.az; + final EnumFacing up = BusRenderHelper.INSTANCE.ay; renderer.uvRotateBottom = info.getTexture( AEPartLocation.DOWN ).setFlip( BaseBlockRender.getOrientation( EnumFacing.DOWN, forward, up ) ); renderer.uvRotateTop = info.getTexture( AEPartLocation.UP ).setFlip( BaseBlockRender.getOrientation( EnumFacing.UP, forward, up ) ); @@ -414,7 +414,7 @@ public final class BusRenderHelper implements IPartRenderHelper @Override public Block getBlock() { - for( Block block : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) + for( final Block block : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet() ) { return block; } @@ -422,33 +422,33 @@ public final class BusRenderHelper implements IPartRenderHelper throw new MissingDefinition( "Tried to access the multi part block without it being defined." ); } - public void prepareBounds( ModelGenerator renderer ) + public void prepareBounds( final ModelGenerator renderer ) { this.bbr.renderBlockBounds( renderer, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, this.az ); } @Override - public void setFacesToRender( EnumSet faces ) + public void setFacesToRender( final EnumSet faces ) { BusRenderer.INSTANCE.renderer.renderFaces = faces; } @Override - public void renderBlockCurrentBounds( BlockPos pos, ModelGenerator renderer ) + public void renderBlockCurrentBounds( final BlockPos pos, final ModelGenerator renderer ) { if( !this.renderThis() ) { return; } - for( Block block : this.maybeBlock.asSet() ) + for( final Block block : this.maybeBlock.asSet() ) { renderer.renderStandardBlock( block, pos ); } } @Override - public void renderFaceCutout( BlockPos pos, IAESprite ico, EnumFacing face, float edgeThickness, ModelGenerator renderer ) + public void renderFaceCutout( final BlockPos pos, final IAESprite ico, EnumFacing face, final float edgeThickness, final ModelGenerator renderer ) { if( !this.renderThis() ) { @@ -479,14 +479,14 @@ public final class BusRenderHelper implements IPartRenderHelper break; } - for( AEBaseBlock block : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock block : this.maybeBaseBlock.asSet() ) { this.bbr.renderCutoutFace( block, ico, pos, renderer, face, edgeThickness ); } } @Override - public void renderFace( BlockPos pos, IAESprite ico, EnumFacing face, ModelGenerator renderer ) + public void renderFace( final BlockPos pos, final IAESprite ico, EnumFacing face, final ModelGenerator renderer ) { if( !this.renderThis() ) { @@ -518,7 +518,7 @@ public final class BusRenderHelper implements IPartRenderHelper break; } - for( AEBaseBlock block : this.maybeBaseBlock.asSet() ) + for( final AEBaseBlock block : this.maybeBaseBlock.asSet() ) { this.bbr.renderFace( pos, block, ico, renderer, face ); } diff --git a/src/main/java/appeng/client/render/BusRenderer.java b/src/main/java/appeng/client/render/BusRenderer.java index 5a18cc0a..25804ffc 100644 --- a/src/main/java/appeng/client/render/BusRenderer.java +++ b/src/main/java/appeng/client/render/BusRenderer.java @@ -53,19 +53,19 @@ public class BusRenderer implements IItemRenderer public ModelGenerator renderer; @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { return true; } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return true; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { if( item == null ) { @@ -128,8 +128,8 @@ public class BusRenderer implements IItemRenderer if( item.getItem() instanceof IFacadeItem ) { - IFacadeItem fi = (IFacadeItem) item.getItem(); - IFacadePart fp = fi.createPartFromItemStack( item, AEPartLocation.SOUTH ); + final IFacadeItem fi = (IFacadeItem) item.getItem(); + final IFacadePart fp = fi.createPartFromItemStack( item, AEPartLocation.SOUTH ); if( type == ItemRenderType.EQUIPPED_FIRST_PERSON ) { @@ -144,12 +144,12 @@ public class BusRenderer implements IItemRenderer } else { - IPart ip = this.getRenderer( item, (IPartItem) item.getItem() ); + final IPart ip = this.getRenderer( item, (IPartItem) item.getItem() ); if( ip != null ) { if( type == ItemRenderType.ENTITY ) { - int depth = ip.cableConnectionRenderTo(); + final int depth = ip.cableConnectionRenderTo(); GL11.glTranslatef( 0.0f, 0.0f, -0.04f * ( 8 - depth ) - 0.06f ); } @@ -164,9 +164,9 @@ public class BusRenderer implements IItemRenderer } @Nullable - public IPart getRenderer( ItemStack is, IPartItem c ) + public IPart getRenderer( final ItemStack is, final IPartItem c ) { - int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage(); + final int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage(); IPart part = RENDER_PART.get( id ); if( part == null ) diff --git a/src/main/java/appeng/client/render/CableRenderHelper.java b/src/main/java/appeng/client/render/CableRenderHelper.java index d9d35368..d37239a5 100644 --- a/src/main/java/appeng/client/render/CableRenderHelper.java +++ b/src/main/java/appeng/client/render/CableRenderHelper.java @@ -47,10 +47,10 @@ public class CableRenderHelper return INSTANCE; } - public void renderStatic( CableBusContainer cableBusContainer, IFacadeContainer iFacadeContainer ) + public void renderStatic( final CableBusContainer cableBusContainer, final IFacadeContainer iFacadeContainer ) { - TileEntity te = cableBusContainer.getTile(); - ModelGenerator renderer = BusRenderer.INSTANCE.renderer; + final TileEntity te = cableBusContainer.getTile(); + final ModelGenerator renderer = BusRenderer.INSTANCE.renderer; if( renderer.overrideBlockTexture != null ) { @@ -66,9 +66,9 @@ public class CableRenderHelper renderer.blockAccess = Minecraft.getMinecraft().theWorld; } - for( AEPartLocation s : AEPartLocation.values() ) + for( final AEPartLocation s : AEPartLocation.values() ) { - IPart part = cableBusContainer.getPart( s ); + final IPart part = cableBusContainer.getPart( s ); if( part != null ) { this.setSide( s ); @@ -90,24 +90,24 @@ public class CableRenderHelper /** * snag list of boxes... */ - List boxes = new ArrayList(); - for( AEPartLocation s : AEPartLocation.values() ) + final List boxes = new ArrayList(); + for( final AEPartLocation s : AEPartLocation.values() ) { - IPart part = cableBusContainer.getPart( s ); + final IPart part = cableBusContainer.getPart( s ); if( part != null ) { this.setSide( s ); - BusRenderHelper brh = BusRenderHelper.INSTANCE; - BusCollisionHelper bch = new BusCollisionHelper( boxes, brh.getWorldX(), brh.getWorldY(), brh.getWorldZ(), null, true ); + final BusRenderHelper brh = BusRenderHelper.INSTANCE; + final BusCollisionHelper bch = new BusCollisionHelper( boxes, brh.getWorldX(), brh.getWorldY(), brh.getWorldZ(), null, true ); part.getBoxes( bch ); } } boolean useThinFacades = false; - double min = 2.0 / 16.0; - double max = 14.0 / 16.0; + final double min = 2.0 / 16.0; + final double max = 14.0 / 16.0; - for( AxisAlignedBB bb : boxes ) + for( final AxisAlignedBB bb : boxes ) { int o = 0; o += bb.maxX > max ? 1 : 0; @@ -123,15 +123,15 @@ public class CableRenderHelper } } - for( AEPartLocation s : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation s : AEPartLocation.SIDE_LOCATIONS ) { - IFacadePart fPart = iFacadeContainer.getFacade( s ); + final IFacadePart fPart = iFacadeContainer.getFacade( s ); if( fPart != null ) { fPart.setThinFacades( useThinFacades ); - AxisAlignedBB pb = fPart.getPrimaryBox(); + final AxisAlignedBB pb = fPart.getPrimaryBox(); AEAxisAlignedBB b = null; - for( AxisAlignedBB bb : boxes ) + for( final AxisAlignedBB bb : boxes ) { if( bb.intersectsWith( pb ) ) { @@ -167,11 +167,11 @@ public class CableRenderHelper } } - private void setSide( AEPartLocation s ) + private void setSide( final AEPartLocation s ) { - EnumFacing ax; - EnumFacing ay; - EnumFacing az; + final EnumFacing ax; + final EnumFacing ay; + final EnumFacing az; switch( s ) { @@ -215,16 +215,16 @@ public class CableRenderHelper BusRenderHelper.INSTANCE.setOrientation( ax, ay, az ); } - public void renderDynamic( CableBusContainer cableBusContainer, double x, double y, double z ) + public void renderDynamic( final CableBusContainer cableBusContainer, final double x, final double y, final double z ) { - for( EnumFacing s : EnumFacing.values() ) + for( final EnumFacing s : EnumFacing.values() ) { - IPart part = cableBusContainer.getPart( s ); + final IPart part = cableBusContainer.getPart( s ); if( part != null ) { - EnumFacing ax; - EnumFacing ay; - EnumFacing az; + final EnumFacing ax; + final EnumFacing ay; + final EnumFacing az; switch( s ) { diff --git a/src/main/java/appeng/client/render/IconUnwrapper.java b/src/main/java/appeng/client/render/IconUnwrapper.java index a246f03a..00356a78 100644 --- a/src/main/java/appeng/client/render/IconUnwrapper.java +++ b/src/main/java/appeng/client/render/IconUnwrapper.java @@ -17,7 +17,7 @@ public class IconUnwrapper extends TextureAtlasSprite float max_v; protected IconUnwrapper( - IAESprite src ) + final IAESprite src ) { super( src.getIconName() ); width = src.getIconWidth(); @@ -71,16 +71,16 @@ public class IconUnwrapper extends TextureAtlasSprite } @Override - public float getInterpolatedU(double d) + public float getInterpolatedU( final double d) { - float f = this.max_u - this.min_u; + final float f = this.max_u - this.min_u; return this.min_u + f * (float)d / 16.0F; } @Override - public float getInterpolatedV(double d) + public float getInterpolatedV( final double d) { - float f = this.max_v - this.min_v; + final float f = this.max_v - this.min_v; return this.min_v + f * ((float)d / 16.0F); } diff --git a/src/main/java/appeng/client/render/ModelGenerator.java b/src/main/java/appeng/client/render/ModelGenerator.java index 27356abc..026cf7ec 100644 --- a/src/main/java/appeng/client/render/ModelGenerator.java +++ b/src/main/java/appeng/client/render/ModelGenerator.java @@ -43,7 +43,7 @@ public class ModelGenerator public CachedModel() { general = new ArrayList(); - for ( EnumFacing f : EnumFacing.VALUES ) + for ( final EnumFacing f : EnumFacing.VALUES ) faces[f.ordinal()] = new ArrayList(); } @@ -85,7 +85,7 @@ public class ModelGenerator @Override public List getFaceQuads( - EnumFacing p_177551_1_ ) + final EnumFacing p_177551_1_ ) { return faces[p_177551_1_.ordinal()]; } @@ -120,7 +120,7 @@ public class ModelGenerator final float[] defUVs = new float[] { 0, 0, 1, 1 }; public void setRenderBoundsFromBlock( - Block block ) + final Block block ) { if ( block == null ) return; @@ -133,12 +133,12 @@ public class ModelGenerator } public void setRenderBounds( - double d, - double e, - double f, - double g, - double h, - double i ) + final double d, + final double e, + final double f, + final double g, + final double h, + final double i ) { renderMinX = d; renderMinY = e; @@ -151,18 +151,18 @@ public class ModelGenerator int color = -1; public void setBrightness( - int i ) + final int i ) { brightness=i; } public void setColorRGBA_F( - int r, - int g, - int b, - float a ) + final int r, + final int g, + final int b, + final float a ) { - int alpha = ( int ) ( a * 0xff ); + final int alpha = ( int ) ( a * 0xff ); color = alpha << 24 | r << 16 | b << 8 | @@ -170,18 +170,18 @@ public class ModelGenerator } public void setColorOpaque_I( - int whiteVariant ) + final int whiteVariant ) { - int alpha = 0xff; + final int alpha = 0xff; color = //alpha << 24 | whiteVariant; } public void setColorOpaque( - int r, - int g, - int b ) + final int r, + final int g, + final int b ) { - int alpha = 0xff; + final int alpha = 0xff; color =// alpha << 24 | r << 16 | g << 8 | @@ -189,11 +189,11 @@ public class ModelGenerator } public void setColorOpaque_F( - int r, - int g, - int b ) + final int r, + final int g, + final int b ) { - int alpha = 0xff; + final int alpha = 0xff; color = //alpha << 24 | Math.min( 0xff, Math.max( 0, r ) ) << 16 | Math.min( 0xff, Math.max( 0, g ) ) << 8 | @@ -201,14 +201,14 @@ public class ModelGenerator } public void setColorOpaque_F( - float rf, - float bf, - float gf ) + final float rf, + final float bf, + final float gf ) { - int r = (int)( rf * 0xff ); - int g = (int)( gf * 0xff ); - int b = (int)( bf * 0xff ); - int alpha = 0xff; + final int r = (int)( rf * 0xff ); + final int g = (int)( gf * 0xff ); + final int b = (int)( bf * 0xff ); + final int alpha = 0xff; color = //alpha << 24 | Math.min( 0xff, Math.max( 0, r ) ) << 16 | Math.min( 0xff, Math.max( 0, g ) ) << 8 | @@ -216,21 +216,21 @@ public class ModelGenerator } public IAESprite getIcon( - ItemStack is ) + final ItemStack is ) { - Item it = is.getItem(); + final Item it = is.getItem(); if ( it instanceof ItemMultiPart ) return ( (ItemMultiPart) it).getIcon( is); - Block blk = Block.getBlockFromItem( it ); + final Block blk = Block.getBlockFromItem( it ); if ( blk != null ) return getIcon(blk.getStateFromMeta( is.getMetadata() ))[0]; if ( it instanceof AEBaseItem ) { - IAESprite ico = ( (AEBaseItem)it ).getIcon(is); + final IAESprite ico = ( (AEBaseItem)it ).getIcon(is); if ( ico != null ) return ico; } @@ -239,20 +239,20 @@ public class ModelGenerator public IAESprite[] getIcon( - IBlockState state ) + final IBlockState state ) { - IAESprite[] out = new IAESprite[6]; + final IAESprite[] out = new IAESprite[6]; - Block blk = state.getBlock(); + final Block blk = state.getBlock(); if ( blk instanceof AEBaseBlock ) { - AEBaseBlock base = (AEBaseBlock)blk; - for ( EnumFacing face : EnumFacing.VALUES ) + final AEBaseBlock base = (AEBaseBlock)blk; + for ( final EnumFacing face : EnumFacing.VALUES ) out[face.ordinal()] = base.getIcon( face, state ); } else { - TextureAtlasSprite spite = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture( state ); + final TextureAtlasSprite spite = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture( state ); if ( spite == null ) { out[0] = new MissingIcon( blk ); @@ -264,7 +264,7 @@ public class ModelGenerator } else { - IAESprite mySpite = new BaseIcon( spite ); + final IAESprite mySpite = new BaseIcon( spite ); out[0] = mySpite; out[1] = mySpite; out[2] = mySpite; @@ -277,17 +277,17 @@ public class ModelGenerator return out; } - public IAESprite[] getIcon( IBlockAccess world, BlockPos pos) + public IAESprite[] getIcon( final IBlockAccess world, final BlockPos pos) { - IBlockState state = world.getBlockState( pos ); - Block blk = state.getBlock(); + final IBlockState state = world.getBlockState( pos ); + final Block blk = state.getBlock(); if ( blk instanceof AEBaseBlock ) { - IAESprite[] out = new IAESprite[6]; + final IAESprite[] out = new IAESprite[6]; - AEBaseBlock base = (AEBaseBlock)blk; - for ( EnumFacing face : EnumFacing.VALUES ) + final AEBaseBlock base = (AEBaseBlock)blk; + for ( final EnumFacing face : EnumFacing.VALUES ) out[face.ordinal()] = base.getIcon( world, pos, face ); return out; @@ -301,19 +301,19 @@ public class ModelGenerator float[][] points = new float[4][]; public void addVertexWithUV( - EnumFacing face, - double x, - double y, - double z, - double u, - double v ) + final EnumFacing face, + final double x, + final double y, + final double z, + final double u, + final double v ) { points[point++] = new float[]{ (float)x+tx, (float)y+ty, (float)z+tz, (float)u, (float)v }; if ( point == 4 ) { brightness = -1; - int[] vertData = new int[]{ + final int[] vertData = new int[]{ Float.floatToRawIntBits( points[0][0] ), Float.floatToRawIntBits( points[0][1] ), Float.floatToRawIntBits( points[0][2] ), @@ -354,12 +354,12 @@ public class ModelGenerator } public boolean renderStandardBlock( - Block block, - BlockPos pos ) + final Block block, + final BlockPos pos ) { //setRenderBoundsFromBlock( block ); - IAESprite[] textures = getIcon( blockAccess,pos ); + final IAESprite[] textures = getIcon( blockAccess,pos ); setColorOpaque_I( 0xffffff ); renderFaceXNeg( block, pos, textures[EnumFacing.WEST.ordinal()] ); @@ -373,9 +373,9 @@ public class ModelGenerator } public void setTranslation( - int x, - int y, - int z ) + final int x, + final int y, + final int z ) { tx=x; ty=y; @@ -466,88 +466,88 @@ public class ModelGenerator } public void renderFaceXNeg( - Block blk, - BlockPos pos, - IAESprite lights ) + final Block blk, + final BlockPos pos, + final IAESprite lights ) { - boolean isEdge = renderMinX < 0.0001; - Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMinY* 16.0f, (float)renderMinZ * 16.0f); - Vector3f from = new Vector3f( (float)renderMinX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMaxZ * 16.0f); + final boolean isEdge = renderMinX < 0.0001; + final Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMinY* 16.0f, (float)renderMinZ * 16.0f); + final Vector3f from = new Vector3f( (float)renderMinX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMaxZ * 16.0f); final EnumFacing myFace = EnumFacing.WEST; addFace(myFace, isEdge,to,from,defUVs,lights ); } public void renderFaceYNeg( - Block blk, - BlockPos pos, - IAESprite lights ) + final Block blk, + final BlockPos pos, + final IAESprite lights ) { - boolean isEdge = renderMinY < 0.0001; - Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMinY* 16.0f, (float)renderMinZ* 16.0f ); - Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMinY* 16.0f, (float)renderMaxZ* 16.0f ); + final boolean isEdge = renderMinY < 0.0001; + final Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMinY* 16.0f, (float)renderMinZ* 16.0f ); + final Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMinY* 16.0f, (float)renderMaxZ* 16.0f ); final EnumFacing myFace = EnumFacing.DOWN; addFace(myFace, isEdge,to,from,defUVs, lights ); } public void renderFaceZNeg( - Block blk, - BlockPos pos, - IAESprite lights ) + final Block blk, + final BlockPos pos, + final IAESprite lights ) { - boolean isEdge = renderMinZ < 0.0001; - Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMinY* 16.0f, (float)renderMinZ* 16.0f ); - Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMinZ* 16.0f ); + final boolean isEdge = renderMinZ < 0.0001; + final Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMinY* 16.0f, (float)renderMinZ* 16.0f ); + final Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMinZ* 16.0f ); final EnumFacing myFace = EnumFacing.NORTH; addFace(myFace, isEdge,to,from,defUVs, lights ); } public void renderFaceYPos( - Block blk, - BlockPos pos, - IAESprite lights ) + final Block blk, + final BlockPos pos, + final IAESprite lights ) { - boolean isEdge = renderMaxY > 0.9999; - Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMinZ* 16.0f ); - Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMaxZ * 16.0f); + final boolean isEdge = renderMaxY > 0.9999; + final Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMinZ* 16.0f ); + final Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMaxZ * 16.0f); final EnumFacing myFace = EnumFacing.UP; addFace(myFace, isEdge,to,from,defUVs,lights ); } public void renderFaceZPos( - Block blk, - BlockPos pos, - IAESprite lights ) + final Block blk, + final BlockPos pos, + final IAESprite lights ) { - boolean isEdge = renderMaxZ > 0.9999; - Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMinY* 16.0f, (float)renderMaxZ* 16.0f ); - Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMaxZ* 16.0f ); + final boolean isEdge = renderMaxZ > 0.9999; + final Vector3f to = new Vector3f( (float)renderMinX* 16.0f, (float)renderMinY* 16.0f, (float)renderMaxZ* 16.0f ); + final Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMaxZ* 16.0f ); final EnumFacing myFace = EnumFacing.SOUTH; addFace(myFace, isEdge,to,from,defUVs,lights ); } public void renderFaceXPos( - Block blk, - BlockPos pos, - IAESprite lights ) + final Block blk, + final BlockPos pos, + final IAESprite lights ) { - boolean isEdge = renderMaxX > 0.9999; - Vector3f to = new Vector3f( (float)renderMaxX * 16.0f, (float)renderMinY* 16.0f, (float)renderMinZ* 16.0f ); - Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMaxZ* 16.0f ); + final boolean isEdge = renderMaxX > 0.9999; + final Vector3f to = new Vector3f( (float)renderMaxX * 16.0f, (float)renderMinY* 16.0f, (float)renderMinZ* 16.0f ); + final Vector3f from = new Vector3f( (float)renderMaxX* 16.0f, (float)renderMaxY* 16.0f, (float)renderMaxZ* 16.0f ); final EnumFacing myFace = EnumFacing.EAST; addFace(myFace, isEdge,to,from,defUVs, lights ); } private void addFace( - EnumFacing face , boolean isEdge, - Vector3f to, - Vector3f from, - float[] defUVs2, + final EnumFacing face , final boolean isEdge, + final Vector3f to, + final Vector3f from, + final float[] defUVs2, IAESprite texture ) { if ( overrideBlockTexture != null ) @@ -559,9 +559,9 @@ public class ModelGenerator EnumFacing currentFace = EnumFacing.UP; public void setNormal( - float x, - float y, - float z ) + final float x, + final float y, + final float z ) { if ( x > 0.5 ) currentFace = EnumFacing.EAST; if ( x < -0.5 ) currentFace = EnumFacing.WEST; @@ -572,19 +572,19 @@ public class ModelGenerator } public void setOverrideBlockTexture( - IAESprite object ) + final IAESprite object ) { overrideBlockTexture = object; } - public void finalizeModel( boolean Flip ) + public void finalizeModel( final boolean Flip ) { ModelRotation mr = ModelRotation.X0_Y0; if ( Flip ) mr = ModelRotation.X0_Y180; - for ( SMFace face : faces ) + for ( final SMFace face : faces ) { final EnumFacing myFace = face.face; final float[] uvs = getFaceUvs( myFace, face.from, face.to ); diff --git a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java index de2331f5..11b6e4d9 100644 --- a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java +++ b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java @@ -37,7 +37,7 @@ public class RenderBlocksWorkaround extends ModelGenerator public float opacity; public void setTexture( - Object object ) + final Object object ) { // TODO Auto-generated method stub diff --git a/src/main/java/appeng/client/render/SMFace.java b/src/main/java/appeng/client/render/SMFace.java index dbe91f71..099f5d24 100644 --- a/src/main/java/appeng/client/render/SMFace.java +++ b/src/main/java/appeng/client/render/SMFace.java @@ -21,12 +21,12 @@ public class SMFace public final int color; public SMFace( - EnumFacing face , boolean isEdge, - int color, - Vector3f to, - Vector3f from, - float[] defUVs2, - TextureAtlasSprite iconUnwrapper ) + final EnumFacing face , final boolean isEdge, + final int color, + final Vector3f to, + final Vector3f from, + final float[] defUVs2, + final TextureAtlasSprite iconUnwrapper ) { this.color = color; this.face=face; diff --git a/src/main/java/appeng/client/render/SpatialSkyRender.java b/src/main/java/appeng/client/render/SpatialSkyRender.java index 0f03d1bf..fbf4dfa4 100644 --- a/src/main/java/appeng/client/render/SpatialSkyRender.java +++ b/src/main/java/appeng/client/render/SpatialSkyRender.java @@ -53,9 +53,9 @@ public class SpatialSkyRender extends IRenderHandler } @Override - public void render( float partialTicks, WorldClient world, Minecraft mc ) + public void render( final float partialTicks, final WorldClient world, final Minecraft mc ) { - long now = System.currentTimeMillis(); + final long now = System.currentTimeMillis(); if( now - this.cycle > 2000 ) { this.cycle = now; @@ -75,8 +75,8 @@ public class SpatialSkyRender extends IRenderHandler GL11.glDisable( GL11.GL_BLEND ); GL11.glDepthMask( false ); GL11.glColor4f( 0.0f, 0.0f, 0.0f, 1.0f ); - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + final Tessellator tessellator = Tessellator.getInstance(); + final WorldRenderer worldrenderer = tessellator.getWorldRenderer(); for( int i = 0; i < 6; ++i ) { @@ -144,8 +144,8 @@ public class SpatialSkyRender extends IRenderHandler private void renderTwinkles() { - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + final Tessellator tessellator = Tessellator.getInstance(); + final WorldRenderer worldrenderer = tessellator.getWorldRenderer(); worldrenderer.startDrawingQuads(); for( int i = 0; i < 50; ++i ) @@ -153,7 +153,7 @@ public class SpatialSkyRender extends IRenderHandler double iX = this.random.nextFloat() * 2.0F - 1.0F; double iY = this.random.nextFloat() * 2.0F - 1.0F; double iZ = this.random.nextFloat() * 2.0F - 1.0F; - double d3 = 0.05F + this.random.nextFloat() * 0.1F; + final double d3 = 0.05F + this.random.nextFloat() * 0.1F; double dist = iX * iX + iY * iY + iZ * iZ; if( dist < 1.0D && dist > 0.01D ) @@ -162,30 +162,30 @@ public class SpatialSkyRender extends IRenderHandler iX *= dist; iY *= dist; iZ *= dist; - double x = iX * 100.0D; - double y = iY * 100.0D; - double z = iZ * 100.0D; - double d8 = Math.atan2( iX, iZ ); - double d9 = Math.sin( d8 ); - double d10 = Math.cos( d8 ); - double d11 = Math.atan2( Math.sqrt( iX * iX + iZ * iZ ), iY ); - double d12 = Math.sin( d11 ); - double d13 = Math.cos( d11 ); - double d14 = this.random.nextDouble() * Math.PI * 2.0D; - double d15 = Math.sin( d14 ); - double d16 = Math.cos( d14 ); + final double x = iX * 100.0D; + final double y = iY * 100.0D; + final double z = iZ * 100.0D; + final double d8 = Math.atan2( iX, iZ ); + final double d9 = Math.sin( d8 ); + final double d10 = Math.cos( d8 ); + final double d11 = Math.atan2( Math.sqrt( iX * iX + iZ * iZ ), iY ); + final double d12 = Math.sin( d11 ); + final double d13 = Math.cos( d11 ); + final double d14 = this.random.nextDouble() * Math.PI * 2.0D; + final double d15 = Math.sin( d14 ); + final double d16 = Math.cos( d14 ); for( int j = 0; j < 4; ++j ) { - double d17 = 0.0D; - double d18 = ( ( j & 2 ) - 1 ) * d3; - double d19 = ( ( j + 1 & 2 ) - 1 ) * d3; - double d20 = d18 * d16 - d19 * d15; - double d21 = d19 * d16 + d18 * d15; - double d22 = d20 * d12 + d17 * d13; - double d23 = d17 * d12 - d20 * d13; - double d24 = d23 * d9 - d21 * d10; - double d25 = d21 * d9 + d23 * d10; + final double d17 = 0.0D; + final double d18 = ( ( j & 2 ) - 1 ) * d3; + final double d19 = ( ( j + 1 & 2 ) - 1 ) * d3; + final double d20 = d18 * d16 - d19 * d15; + final double d21 = d19 * d16 + d18 * d15; + final double d22 = d20 * d12 + d17 * d13; + final double d23 = d17 * d12 - d20 * d13; + final double d24 = d23 * d9 - d21 * d10; + final double d25 = d21 * d9 + d23 * d10; worldrenderer.addVertex( x + d24, y + d22, z + d25 ); } } diff --git a/src/main/java/appeng/client/render/TESRWrapper.java b/src/main/java/appeng/client/render/TESRWrapper.java index 9fd01f6b..2fec580a 100644 --- a/src/main/java/appeng/client/render/TESRWrapper.java +++ b/src/main/java/appeng/client/render/TESRWrapper.java @@ -42,18 +42,18 @@ public class TESRWrapper extends TileEntitySpecialRenderer private final BaseBlockRender blkRender; private final double maxDistance; - public TESRWrapper( BaseBlockRender render ) + public TESRWrapper( final BaseBlockRender render ) { this.blkRender = render; this.maxDistance = this.blkRender.getTesrRenderDistance(); } @Override - public final void renderTileEntityAt( TileEntity te, double x, double y, double z, float f, int something ) + public final void renderTileEntityAt( final TileEntity te, final double x, final double y, final double z, final float f, final int something ) { if( te instanceof AEBaseTile ) { - Block b = te.getBlockType(); + final Block b = te.getBlockType(); if( b instanceof AEBaseBlock && ( (AEBaseTile) te ).requiresTESR() ) { @@ -62,7 +62,7 @@ public class TESRWrapper extends TileEntitySpecialRenderer return; } - Tessellator tess = Tessellator.getInstance(); + final Tessellator tess = Tessellator.getInstance(); try { @@ -73,7 +73,7 @@ public class TESRWrapper extends TileEntitySpecialRenderer GL11.glPopMatrix(); } - catch( Throwable t ) + catch( final Throwable t ) { AELog.severe( "Hi, Looks like there was a crash while rendering something..." ); t.printStackTrace(); diff --git a/src/main/java/appeng/client/render/WorldRender.java b/src/main/java/appeng/client/render/WorldRender.java index fa14b92c..fb7b983e 100644 --- a/src/main/java/appeng/client/render/WorldRender.java +++ b/src/main/java/appeng/client/render/WorldRender.java @@ -45,36 +45,36 @@ public final class WorldRender implements ISimpleBlockRenderingHandler { } - void setRender( AEBaseBlock in, BaseBlockRender r ) + void setRender( final AEBaseBlock in, final BaseBlockRender r ) { this.blockRenders.put( in, r ); } @Override - public void renderInventoryBlock( Block block, int metadata, int modelID, ModelGenerator renderer ) + public void renderInventoryBlock( final Block block, final int metadata, final int modelID, final ModelGenerator renderer ) { // wtf is this for? } @Override - public boolean renderWorldBlock( IBlockAccess world, BlockPos pos, Block block, int modelId, ModelGenerator renderer ) + public boolean renderWorldBlock( final IBlockAccess world, final BlockPos pos, final Block block, final int modelId, final ModelGenerator renderer ) { - AEBaseBlock blk = (AEBaseBlock) block; + final AEBaseBlock blk = (AEBaseBlock) block; renderer.setRenderBoundsFromBlock( block ); return this.getRender( blk ).renderInWorld( blk, world, pos, renderer ); } - private BaseBlockRender getRender( AEBaseBlock block ) + private BaseBlockRender getRender( final AEBaseBlock block ) { return block.getRendererInstance().rendererInstance; } - public void renderItemBlock( ItemStack item, ItemRenderType type, Object[] data ) + public void renderItemBlock( final ItemStack item, final ItemRenderType type, final Object[] data ) { - Block blk = Block.getBlockFromItem( item.getItem() ); + final Block blk = Block.getBlockFromItem( item.getItem() ); if( blk instanceof AEBaseBlock ) { - AEBaseBlock block = (AEBaseBlock) blk; + final AEBaseBlock block = (AEBaseBlock) blk; this.renderer.setRenderBoundsFromBlock( block ); this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java index 4e523806..2ececdb6 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java @@ -55,7 +55,7 @@ public class RenderBlockAssembler extends BaseBlockRender= 2 ) { - int v = ( Math.abs( pos.getX() ) + Math.abs( pos.getY() ) + Math.abs( pos.getZ() ) ) % 2; + final int v = ( Math.abs( pos.getX() ) + Math.abs( pos.getY() ) + Math.abs( pos.getZ() ) ) % 2; renderer.uvRotateEast = renderer.uvRotateBottom = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; if( v == 0 ) @@ -157,7 +157,7 @@ public class RenderBlockController extends BaseBlockRender= 0 ) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java index fcb7f889..79308a82 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java @@ -46,7 +46,7 @@ import appeng.tile.crafting.TileCraftingTile; public class RenderBlockCraftingCPU extends BaseBlockRender { - protected RenderBlockCraftingCPU( boolean useTESR, int range ) + protected RenderBlockCraftingCPU( final boolean useTESR, final int range ) { super( useTESR, range ); } @@ -57,23 +57,23 @@ public class RenderBlockCraftingCPU 15.999 ) ) { - double width = 3.0 / 16.0; + final double width = 3.0 / 16.0; switch( a ) { case DOWN: @@ -350,7 +350,7 @@ public class RenderBlockCraftingCPU } @Override - public void renderInventory( BlockCrank blk, ItemStack is, ModelGenerator renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockCrank blk, final ItemStack is, final ModelGenerator renderer, final ItemRenderType type, final Object[] obj ) { renderer.renderAllFaces = true; @@ -61,13 +61,13 @@ public class RenderBlockCrank extends BaseBlockRender } @Override - public boolean renderInWorld( BlockCrank imb, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public boolean renderInWorld( final BlockCrank imb, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { return true; } @Override - public void renderTile( BlockCrank blk, TileCrank tile, WorldRenderer tess, double x, double y, double z, float f, ModelGenerator renderBlocks ) + public void renderTile( final BlockCrank blk, final TileCrank tile, final WorldRenderer tess, final double x, final double y, final double z, final float f, final ModelGenerator renderBlocks ) { if( tile.getUp() == null ) { @@ -97,11 +97,11 @@ public class RenderBlockCrank extends BaseBlockRender //tess.setTranslation( -tc.getPos().getX(), -tc.getPos().getY(), -tc.getPos().getZ() ); //tess.startDrawingQuads(); - RenderItem ri = Minecraft.getMinecraft().getRenderItem(); + final RenderItem ri = Minecraft.getMinecraft().getRenderItem(); - ItemStack stack = new ItemStack( blk ); - IBakedModel model = ri.getItemModelMesher().getItemModel( stack ); - Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(model, 1.0F, 1.0F, 1.0F, 1.0F); + final ItemStack stack = new ItemStack( blk ); + final IBakedModel model = ri.getItemModelMesher().getItemModel( stack ); + Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor( model, 1.0F, 1.0F, 1.0F, 1.0F ); /* renderBlocks.renderAllFaces = true; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java b/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java index bf00c49d..a0e9fb0f 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java @@ -39,11 +39,11 @@ public class RenderBlockEnergyCube extends BaseBlockRender } @Override - public void renderInventory( BlockPaint block, ItemStack is, ModelGenerator renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockPaint block, final ItemStack is, final ModelGenerator renderer, final ItemRenderType type, final Object[] obj ) { } @Override - public boolean renderInWorld( BlockPaint imb, IBlockAccess world, BlockPos pos, ModelGenerator tess ) + public boolean renderInWorld( final BlockPaint imb, final IBlockAccess world, final BlockPos pos, final ModelGenerator tess ) { - TilePaint tp = imb.getTileEntity( world, pos ); + final TilePaint tp = imb.getTileEntity( world, pos ); boolean out = false; if( tp != null ) { // super.renderInWorld( imb, world, x, y, z, renderer ); - int x = pos.getX(); - int y = pos.getY(); - int z = pos.getZ(); + final int x = pos.getX(); + final int y = pos.getY(); + final int z = pos.getZ(); - IAESprite[] icoSet = { imb.getIcon( EnumFacing.UP, imb.getDefaultState() ), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() }; + final IAESprite[] icoSet = { imb.getIcon( EnumFacing.UP, imb.getDefaultState() ), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() }; - int brightness = imb.getMixedBrightnessForBlock( world, pos ); + final int brightness = imb.getMixedBrightnessForBlock( world, pos ); - EnumSet validSides = EnumSet.noneOf( EnumFacing.class ); + final EnumSet validSides = EnumSet.noneOf( EnumFacing.class ); - for( EnumFacing side : EnumFacing.VALUES ) + for( final EnumFacing side : EnumFacing.VALUES ) { if( tp.isSideValid( side ) ) { @@ -76,8 +76,8 @@ public class RenderBlockPaint extends BaseBlockRender } double offsetConstant = 0.001; - int lumen = 14 << 20 | 14 << 4; - for( Splotch s : tp.getDots() ) + final int lumen = 14 << 20 | 14 << 4; + for( final Splotch s : tp.getDots() ) { if( !validSides.contains( s.side ) ) { @@ -98,7 +98,7 @@ public class RenderBlockPaint extends BaseBlockRender double offset = offsetConstant; offsetConstant += 0.001; - double buffer = 0.1; + final double buffer = 0.1; double pos_x = s.x(); double pos_y = s.y(); @@ -124,8 +124,8 @@ public class RenderBlockPaint extends BaseBlockRender pos_y += z; } - IAESprite ico = icoSet[s.getSeed() % icoSet.length]; - EnumFacing rs = s.side.getOpposite(); + final IAESprite ico = icoSet[s.getSeed() % icoSet.length]; + final EnumFacing rs = s.side.getOpposite(); switch( s.side ) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java b/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java index 65d20f6a..7ae1e811 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java @@ -39,20 +39,20 @@ public class RenderBlockQuartzAccelerator extends BaseBlockRender } @Override - public void renderInventory( BlockDrive block, ItemStack is, ModelGenerator renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockDrive block, final ItemStack is, final ModelGenerator renderer, final ItemRenderType type, final Object[] obj ) { renderer.overrideBlockTexture = ExtraBlockTextures.White.getIcon(); this.renderInvBlock( EnumSet.of( AEPartLocation.SOUTH ), block, is, 0x000000, renderer ); @@ -55,26 +55,26 @@ public class RenderDrive extends BaseBlockRender } @Override - public boolean renderInWorld( BlockDrive imb, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public boolean renderInWorld( final BlockDrive imb, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { - TileDrive sp = imb.getTileEntity( world, pos ); + final TileDrive sp = imb.getTileEntity( world, pos ); renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 ); - EnumFacing up = sp.getUp(); - EnumFacing forward = sp.getForward(); - EnumFacing west = Platform.crossProduct( forward, up ); + final EnumFacing up = sp.getUp(); + final EnumFacing forward = sp.getForward(); + final EnumFacing west = Platform.crossProduct( forward, up ); - boolean result = super.renderInWorld( imb, world, pos, renderer ); + final boolean result = super.renderInWorld( imb, world, pos, renderer ); - IAESprite ico = ExtraBlockTextures.MEStorageCellTextures.getIcon(); + final IAESprite ico = ExtraBlockTextures.MEStorageCellTextures.getIcon(); - int b = world.getCombinedLight( pos.offset( forward ), 0 ); + final int b = world.getCombinedLight( pos.offset( forward ), 0 ); for( int yy = 0; yy < 5; yy++ ) { for( int xx = 0; xx < 2; xx++ ) { - int stat = sp.getCellStatus( yy * 2 + ( 1 - xx ) ); + final int stat = sp.getCellStatus( yy * 2 + ( 1 - xx ) ); this.selectFace( renderer, west, up, forward, 2 + xx * 7, 7 + xx * 7, 1 + yy * 3, 3 + yy * 3 ); int spin = 0; @@ -210,9 +210,9 @@ public class RenderDrive extends BaseBlockRender double v3 = ico.getInterpolatedV( ( ( spin + 3 ) % 4 < 2 ) ? m : mx ); double v4 = ico.getInterpolatedV( ( ( spin ) % 4 < 2 ) ? m : mx ); - int x= pos.getX(); - int y= pos.getY(); - int z= pos.getZ(); + final int x= pos.getX(); + final int y= pos.getY(); + final int z= pos.getZ(); renderer.setBrightness( b ); renderer.setColorOpaque_I( 0xffffff ); @@ -267,7 +267,7 @@ public class RenderDrive extends BaseBlockRender if( stat != 0 ) { - IAESprite whiteIcon = ExtraBlockTextures.White.getIcon(); + final IAESprite whiteIcon = ExtraBlockTextures.White.getIcon(); u1 = whiteIcon.getInterpolatedU( ( spin % 4 < 2 ) ? 1 : 6 ); u2 = whiteIcon.getInterpolatedU( ( ( spin + 1 ) % 4 < 2 ) ? 1 : 6 ); u3 = whiteIcon.getInterpolatedU( ( ( spin + 2 ) % 4 < 2 ) ? 1 : 6 ); diff --git a/src/main/java/appeng/client/render/blocks/RenderMEChest.java b/src/main/java/appeng/client/render/blocks/RenderMEChest.java index 6ad3fea7..ad03651d 100644 --- a/src/main/java/appeng/client/render/blocks/RenderMEChest.java +++ b/src/main/java/appeng/client/render/blocks/RenderMEChest.java @@ -50,7 +50,7 @@ public class RenderMEChest extends BaseBlockRender } @Override - public void renderInventory( BlockChest block, ItemStack is, ModelGenerator renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockChest block, final ItemStack is, final ModelGenerator renderer, final ItemRenderType type, final Object[] obj ) { renderer.setBrightness( 0 ); renderer.overrideBlockTexture = ExtraBlockTextures.White.getIcon(); @@ -64,9 +64,9 @@ public class RenderMEChest extends BaseBlockRender } @Override - public boolean renderInWorld( BlockChest imb, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public boolean renderInWorld( final BlockChest imb, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { - TileChest sp = imb.getTileEntity( world, pos ); + final TileChest sp = imb.getTileEntity( world, pos ); renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 ); if( sp == null ) @@ -74,14 +74,14 @@ public class RenderMEChest extends BaseBlockRender return false; } - EnumFacing up = sp.getUp(); - EnumFacing forward = sp.getForward(); - EnumFacing west = Platform.crossProduct( forward, up ); + final EnumFacing up = sp.getUp(); + final EnumFacing forward = sp.getForward(); + final EnumFacing west = Platform.crossProduct( forward, up ); this.preRenderInWorld( imb, world, pos, renderer ); - int stat = sp.getCellStatus( 0 ); - boolean result = renderer.renderStandardBlock( imb, pos ); + final int stat = sp.getCellStatus( 0 ); + final boolean result = renderer.renderStandardBlock( imb, pos ); this.selectFace( renderer, west, up, forward, 5, 16 - 5, 9, 12 ); @@ -95,8 +95,8 @@ public class RenderMEChest extends BaseBlockRender renderer.setBrightness( b ); renderer.setColorOpaque_I( 0xffffff ); - int offsetU = -4; - FlippableIcon flippableIcon = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) ); + final int offsetU = -4; + final FlippableIcon flippableIcon = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) ); if( forward == EnumFacing.EAST && ( up == EnumFacing.NORTH || up == EnumFacing.SOUTH ) ) { flippableIcon.setFlip( true, false ); @@ -162,7 +162,7 @@ public class RenderMEChest extends BaseBlockRender renderer.setColorOpaque_I( 0xffffff ); renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 ); - ICellHandler ch = AEApi.instance().registries().cell().getHandler( sp.getStorageType() ); + final ICellHandler ch = AEApi.instance().registries().cell().getHandler( sp.getStorageType() ); renderer.setColorOpaque_I( sp.getColor().whiteVariant ); IAESprite ico = ch == null ? null : ch.getTopTexture_Light(); diff --git a/src/main/java/appeng/client/render/blocks/RenderNull.java b/src/main/java/appeng/client/render/blocks/RenderNull.java index 86d6273c..f9cc2a7a 100644 --- a/src/main/java/appeng/client/render/blocks/RenderNull.java +++ b/src/main/java/appeng/client/render/blocks/RenderNull.java @@ -38,13 +38,13 @@ public class RenderNull extends BaseBlockRender } @Override - public void renderInventory( AEBaseBlock block, ItemStack is, ModelGenerator renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final AEBaseBlock block, final ItemStack is, final ModelGenerator renderer, final ItemRenderType type, final Object[] obj ) { } @Override - public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public boolean renderInWorld( final AEBaseBlock block, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { return true; } diff --git a/src/main/java/appeng/client/render/blocks/RenderQNB.java b/src/main/java/appeng/client/render/blocks/RenderQNB.java index 75965645..10f5584b 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQNB.java +++ b/src/main/java/appeng/client/render/blocks/RenderQNB.java @@ -47,19 +47,19 @@ public class RenderQNB extends BaseBlockRender sides = tqb.getConnections(); + final EnumSet sides = tqb.getConnections(); this.renderCableAt( 0.11D, world, pos, block, renderer, renderer.getIcon( parts.cableGlass().stack( AEColor.Transparent, 1 ) ), 0.141D, sides ); - Item transCoveredCable = parts.cableCovered().item( AEColor.Transparent ); + final Item transCoveredCable = parts.cableCovered().item( AEColor.Transparent ); this.renderCableAt( 0.188D, world, pos, block, renderer, renderer.getIcon( parts.cableCovered().stack( AEColor.Transparent, 1 ) ), 0.1875D, sides ); } - float renderMin = 2.0f / 16.0f; - float renderMax = 14.0f / 16.0f; + final float renderMin = 2.0f / 16.0f; + final float renderMax = 14.0f / 16.0f; renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax ); renderer.renderStandardBlock( block, pos ); } @@ -94,14 +94,14 @@ public class RenderQNB extends BaseBlockRender connections ) + private void renderCableAt( final double thickness, final IBlockAccess world, final BlockPos pos, final BlockQuantumBase block, final ModelGenerator renderer, final IAESprite texture, final double pull, final Collection connections ) { block.getRendererInstance().setTemporaryRenderIcon( texture ); diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java b/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java index 25a7a4af..b3961433 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java @@ -45,7 +45,7 @@ public class RenderQuartzGlass extends BaseBlockRender } @Override - public void renderInventory( QuartzOreBlock blk, ItemStack is, ModelGenerator renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final QuartzOreBlock blk, final ItemStack is, final ModelGenerator renderer, final ItemRenderType type, final Object[] obj ) { super.renderInventory( blk, is, renderer, type, obj ); blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.OreQuartzStone.getIcon() ); @@ -48,14 +48,14 @@ public class RenderQuartzOre extends BaseBlockRender } @Override - public boolean renderInWorld( QuartzOreBlock quartz, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public boolean renderInWorld( final QuartzOreBlock quartz, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { quartz.setEnhanceBrightness( true ); super.renderInWorld( quartz, world, pos, renderer ); quartz.setEnhanceBrightness( false ); quartz.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.OreQuartzStone.getIcon() ); - boolean out = super.renderInWorld( quartz, world, pos, renderer ); + final boolean out = super.renderInWorld( quartz, world, pos, renderer ); quartz.getRendererInstance().setTemporaryRenderIcon( null ); return out; diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java index f11c0087..f88eb514 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java @@ -44,22 +44,22 @@ public class RenderQuartzTorch extends BaseBlockRender } @Override - public void renderInventory( AEBaseBlock blk, ItemStack is, ModelGenerator renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final AEBaseBlock blk, final ItemStack is, final ModelGenerator renderer, final ItemRenderType type, final Object[] obj ) { - float Point3 = 7.0f / 16.0f; - float Point12 = 9.0f / 16.0f; + final float Point3 = 7.0f / 16.0f; + final float Point12 = 9.0f / 16.0f; - float renderBottom = 5.0f / 16.0f; - float renderTop = 10.0f / 16.0f; + final float renderBottom = 5.0f / 16.0f; + final float renderTop = 10.0f / 16.0f; - float xOff = 0.0f; - float yOff = 0.0f; - float zOff = 0.0f; + final float xOff = 0.0f; + final float yOff = 0.0f; + final float zOff = 0.0f; renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff ); this.renderInvBlock( EnumSet.allOf( AEPartLocation.class ), blk, is, 0xffffff, renderer ); - float singlePixel = 1.0f / 16.0f; + final float singlePixel = 1.0f / 16.0f; renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff ); this.renderInvBlock( EnumSet.allOf( AEPartLocation.class ), blk, is, 0xffffff, renderer ); @@ -70,10 +70,10 @@ public class RenderQuartzTorch extends BaseBlockRender blk.getRendererInstance().setTemporaryRenderIcon( renderer.getIcon( Blocks.hopper.getDefaultState() )[0] ); renderer.renderAllFaces = true; - float top = 8.0f / 16.0f; - float bottom = 7.0f / 16.0f; - float Point13 = 10.0f / 16.0f; - float Point2 = 6.0f / 16.0f; + final float top = 8.0f / 16.0f; + final float bottom = 7.0f / 16.0f; + final float Point13 = 10.0f / 16.0f; + final float Point2 = 6.0f / 16.0f; renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff ); this.renderInvBlock( EnumSet.allOf( AEPartLocation.class ), blk, is, 0xffffff, renderer ); @@ -92,9 +92,9 @@ public class RenderQuartzTorch extends BaseBlockRender } @Override - public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public boolean renderInWorld( final AEBaseBlock block, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { - IOrientable te = ( (IOrientableBlock) block ).getOrientable( world, pos ); + final IOrientable te = ( (IOrientableBlock) block ).getOrientable( world, pos ); renderer.renderAllFaces = true; float zOff = 0.0f; @@ -102,21 +102,21 @@ public class RenderQuartzTorch extends BaseBlockRender float xOff = 0.0f; if( te != null ) { - AEPartLocation forward = AEPartLocation.fromFacing( te.getUp() ); + final AEPartLocation forward = AEPartLocation.fromFacing( te.getUp() ); xOff = forward.xOffset * -( 4.0f / 16.0f ); yOff = forward.yOffset * -( 4.0f / 16.0f ); zOff = forward.zOffset * -( 4.0f / 16.0f ); } - float renderTop = 10.0f / 16.0f; - float renderBottom = 5.0f / 16.0f; - float Point12 = 9.0f / 16.0f; - float Point3 = 7.0f / 16.0f; + final float renderTop = 10.0f / 16.0f; + final float renderBottom = 5.0f / 16.0f; + final float Point12 = 9.0f / 16.0f; + final float Point3 = 7.0f / 16.0f; renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff ); super.renderInWorld( block, world, pos, renderer ); - int r = ( pos.getX() + pos.getY() + pos.getZ() ) % 2; - float singlePixel = 1.0f / 16.0f; + final int r = ( pos.getX() + pos.getY() + pos.getZ() ) % 2; + final float singlePixel = 1.0f / 16.0f; if( r == 0 ) { renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff ); @@ -136,12 +136,12 @@ public class RenderQuartzTorch extends BaseBlockRender block.getRendererInstance().setTemporaryRenderIcon( renderer.getIcon( Blocks.hopper.getDefaultState() )[0] ); - float top = 8.0f / 16.0f; - float bottom = 7.0f / 16.0f; - float Point13 = 10.0f / 16.0f; - float Point2 = 6.0f / 16.0f; + final float top = 8.0f / 16.0f; + final float bottom = 7.0f / 16.0f; + final float Point13 = 10.0f / 16.0f; + final float Point2 = 6.0f / 16.0f; renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff ); - boolean out = renderer.renderStandardBlock( block, pos ); + final boolean out = renderer.renderStandardBlock( block, pos ); renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point12 + zOff, Point13 + xOff, top + yOff, Point13 + zOff ); renderer.renderStandardBlock( block, pos ); @@ -154,7 +154,7 @@ public class RenderQuartzTorch extends BaseBlockRender if( te != null ) { - AEPartLocation forward = AEPartLocation.fromFacing( te.getUp()); + final AEPartLocation forward = AEPartLocation.fromFacing( te.getUp()); switch( forward ) { case EAST: diff --git a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java index 882f1d92..fab131f5 100644 --- a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java +++ b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java @@ -43,7 +43,7 @@ public class RenderSpatialPylon extends BaseBlockRender } @Override - public void renderInventory( BlockTinyTNT block, ItemStack is, ModelGenerator renderer, ItemRenderType type, Object[] obj ) + public void renderInventory( final BlockTinyTNT block, final ItemStack is, final ModelGenerator renderer, final ItemRenderType type, final Object[] obj ) { renderer.setOverrideBlockTexture( new FullIcon( Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture( Blocks.tnt.getDefaultState() )) ); renderer.setRenderBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ); @@ -49,12 +49,12 @@ public class RenderTinyTNT extends BaseBlockRender } @Override - public boolean renderInWorld( BlockTinyTNT imb, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public boolean renderInWorld( final BlockTinyTNT imb, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { renderer.setOverrideBlockTexture( new FullIcon( Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture( Blocks.tnt.getDefaultState() )) ); renderer.renderAllFaces = true; renderer.setRenderBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ); - boolean out = super.renderInWorld( imb, world, pos, renderer ); + final boolean out = super.renderInWorld( imb, world, pos, renderer ); renderer.renderAllFaces = false; return out; } diff --git a/src/main/java/appeng/client/render/blocks/RendererCableBus.java b/src/main/java/appeng/client/render/blocks/RendererCableBus.java index 70826d42..b07e6ae4 100644 --- a/src/main/java/appeng/client/render/blocks/RendererCableBus.java +++ b/src/main/java/appeng/client/render/blocks/RendererCableBus.java @@ -54,7 +54,7 @@ public class RendererCableBus extends BaseBlockRender RENDER_PART = new HashMap(); @Override - public boolean renderInWorld( BlockCableBus block, IBlockAccess world, BlockPos pos, ModelGenerator renderer ) + public boolean renderInWorld( final BlockCableBus block, final IBlockAccess world, final BlockPos pos, final ModelGenerator renderer ) { - AEBaseTile t = block.getTileEntity( world, pos ); + final AEBaseTile t = block.getTileEntity( world, pos ); if( t instanceof TileCableBus ) { @@ -136,7 +136,7 @@ public class RendererCableBus extends BaseBlockRender 4.0 ) diff --git a/src/main/java/appeng/client/render/effects/ChargedOreFX.java b/src/main/java/appeng/client/render/effects/ChargedOreFX.java index 905deeb7..11344aec 100644 --- a/src/main/java/appeng/client/render/effects/ChargedOreFX.java +++ b/src/main/java/appeng/client/render/effects/ChargedOreFX.java @@ -26,13 +26,13 @@ import net.minecraft.world.World; public class ChargedOreFX extends EntityReddustFX { - public ChargedOreFX( World w, double x, double y, double z, float r, float g, float b ) + public ChargedOreFX( final World w, final double x, final double y, final double z, final float r, final float g, final float b ) { super( w, x, y, z, 0.21f, 0.61f, 1.0f ); } @Override - public int getBrightnessForRender( float par1 ) + public int getBrightnessForRender( final float par1 ) { int j1 = super.getBrightnessForRender( par1 ); j1 = Math.max( j1 >> 20, j1 >> 4 ); diff --git a/src/main/java/appeng/client/render/effects/CraftingFx.java b/src/main/java/appeng/client/render/effects/CraftingFx.java index 98620efa..1daeea8d 100644 --- a/src/main/java/appeng/client/render/effects/CraftingFx.java +++ b/src/main/java/appeng/client/render/effects/CraftingFx.java @@ -42,7 +42,7 @@ public class CraftingFx extends EntityBreakingFX private final int startBlkY; private final int startBlkZ; - public CraftingFx( World par1World, double par2, double par4, double par6, Item par8Item ) + public CraftingFx( final World par1World, final double par2, final double par4, final double par6, final Item par8Item ) { super( par1World, par2, par4, par6, par8Item ); this.particleGravity = 0; @@ -68,26 +68,26 @@ public class CraftingFx extends EntityBreakingFX } @Override - public void renderParticle(WorldRenderer par1Tessellator, Entity p_180434_2_, float partialTick, float x, float y, float z, float rx, float rz) + public void renderParticle( final WorldRenderer par1Tessellator, final Entity p_180434_2_, final float partialTick, final float x, final float y, final float z, final float rx, final float rz) { if( partialTick < 0 || partialTick > 1 ) { return; } - float f6 = this.particleTextureIndex.getMinU(); - float f7 = this.particleTextureIndex.getMaxU(); - float f8 = this.particleTextureIndex.getMinV(); - float f9 = this.particleTextureIndex.getMaxV(); - float scale = 0.1F * this.particleScale; + final float f6 = this.particleTextureIndex.getMinU(); + final float f7 = this.particleTextureIndex.getMaxU(); + final float f8 = this.particleTextureIndex.getMinV(); + final float f9 = this.particleTextureIndex.getMaxV(); + final float scale = 0.1F * this.particleScale; float offX = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * partialTick ); float offY = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * partialTick ); float offZ = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * partialTick ); - int blkX = MathHelper.floor_double( offX ); - int blkY = MathHelper.floor_double( offY ); - int blkZ = MathHelper.floor_double( offZ ); + final int blkX = MathHelper.floor_double( offX ); + final int blkY = MathHelper.floor_double( offY ); + final int blkZ = MathHelper.floor_double( offZ ); if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ ) { offX -= interpPosX; @@ -95,7 +95,7 @@ public class CraftingFx extends EntityBreakingFX offZ -= interpPosZ; // AELog.info( "" + partialTick ); - float f14 = 1.0F; + final float f14 = 1.0F; par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); par1Tessellator.addVertexWithUV( offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale, f7, f9 ); par1Tessellator.addVertexWithUV( offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale, f7, f8 ); @@ -104,7 +104,7 @@ public class CraftingFx extends EntityBreakingFX } } - public void fromItem( AEPartLocation d ) + public void fromItem( final AEPartLocation d ) { this.posX += 0.2 * d.xOffset; this.posY += 0.2 * d.yOffset; diff --git a/src/main/java/appeng/client/render/effects/EnergyFx.java b/src/main/java/appeng/client/render/effects/EnergyFx.java index 70986819..543b1934 100644 --- a/src/main/java/appeng/client/render/effects/EnergyFx.java +++ b/src/main/java/appeng/client/render/effects/EnergyFx.java @@ -42,7 +42,7 @@ public class EnergyFx extends EntityBreakingFX private final int startBlkY; private final int startBlkZ; - public EnergyFx( World par1World, double par2, double par4, double par6, Item par8Item ) + public EnergyFx( final World par1World, final double par2, final double par4, final double par6, final Item par8Item ) { super( par1World, par2, par4, par6, par8Item ); this.particleGravity = 0; @@ -67,25 +67,25 @@ public class EnergyFx extends EntityBreakingFX } @Override - public void renderParticle(WorldRenderer par1Tessellator, Entity p_180434_2_, float par2, float par3, float par4, float par5, float par6, float par7) + public void renderParticle( final WorldRenderer par1Tessellator, final Entity p_180434_2_, final float par2, final float par3, final float par4, final float par5, final float par6, final float par7) { - float f6 = this.particleTextureIndex.getMinU(); - float f7 = this.particleTextureIndex.getMaxU(); - float f8 = this.particleTextureIndex.getMinV(); - float f9 = this.particleTextureIndex.getMaxV(); - float f10 = 0.1F * this.particleScale; + final float f6 = this.particleTextureIndex.getMinU(); + final float f7 = this.particleTextureIndex.getMaxU(); + final float f8 = this.particleTextureIndex.getMinV(); + final float f9 = this.particleTextureIndex.getMaxV(); + final float f10 = 0.1F * this.particleScale; - float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX ); - float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY ); - float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ ); + final float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX ); + final float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY ); + final float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ ); - int blkX = MathHelper.floor_double( this.posX ); - int blkY = MathHelper.floor_double( this.posY ); - int blkZ = MathHelper.floor_double( this.posZ ); + final int blkX = MathHelper.floor_double( this.posX ); + final int blkY = MathHelper.floor_double( this.posY ); + final int blkZ = MathHelper.floor_double( this.posZ ); if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ ) { - float f14 = 1.0F; + final float f14 = 1.0F; par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9 ); par1Tessellator.addVertexWithUV( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f7, f8 ); @@ -94,7 +94,7 @@ public class EnergyFx extends EntityBreakingFX } } - public void fromItem( AEPartLocation d ) + public void fromItem( final AEPartLocation d ) { this.posX += 0.2 * d.xOffset; this.posY += 0.2 * d.yOffset; diff --git a/src/main/java/appeng/client/render/effects/LightningArcFX.java b/src/main/java/appeng/client/render/effects/LightningArcFX.java index 2caa8549..4869b291 100644 --- a/src/main/java/appeng/client/render/effects/LightningArcFX.java +++ b/src/main/java/appeng/client/render/effects/LightningArcFX.java @@ -32,7 +32,7 @@ public class LightningArcFX extends LightningFX final double ry; final double rz; - public LightningArcFX( World w, double x, double y, double z, double ex, double ey, double ez, double r, double g, double b ) + public LightningArcFX( final World w, final double x, final double y, final double z, final double ex, final double ey, final double ez, final double r, final double g, final double b ) { super( w, x, y, z, r, g, b, 6 ); this.noClip = true; @@ -47,12 +47,12 @@ public class LightningArcFX extends LightningFX @Override protected void regen() { - double i = 1.0 / ( this.steps - 1 ); - double lastDirectionX = this.rx * i; - double lastDirectionY = this.ry * i; - double lastDirectionZ = this.rz * i; + final double i = 1.0 / ( this.steps - 1 ); + final double lastDirectionX = this.rx * i; + final double lastDirectionY = this.ry * i; + final double lastDirectionZ = this.rz * i; - double len = Math.sqrt( lastDirectionX * lastDirectionX + lastDirectionY * lastDirectionY + lastDirectionZ * lastDirectionZ ); + final double len = Math.sqrt( lastDirectionX * lastDirectionX + lastDirectionY * lastDirectionY + lastDirectionZ * lastDirectionZ ); for( int s = 0; s < this.steps; s++ ) { this.Steps[s][0] = ( lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0; diff --git a/src/main/java/appeng/client/render/effects/LightningFX.java b/src/main/java/appeng/client/render/effects/LightningFX.java index bb6636fc..f5e6cbbb 100644 --- a/src/main/java/appeng/client/render/effects/LightningFX.java +++ b/src/main/java/appeng/client/render/effects/LightningFX.java @@ -41,13 +41,13 @@ public class LightningFX extends EntityFX float currentPoint = 0; boolean hasData = false; - public LightningFX( World w, double x, double y, double z, double r, double g, double b ) + public LightningFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b ) { this( w, x, y, z, r, g, b, 6 ); this.regen(); } - protected LightningFX( World w, double x, double y, double z, double r, double g, double b, int maxAge ) + protected LightningFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b, final int maxAge ) { super( w, x, y, z, r, g, b ); this.Steps = new double[this.steps][3]; @@ -77,39 +77,39 @@ public class LightningFX extends EntityFX } @Override - public int getBrightnessForRender( float par1 ) + public int getBrightnessForRender( final float par1 ) { - int j1 = 13; + final int j1 = 13; return j1 << 20 | j1 << 4; } @Override - public void renderParticle(WorldRenderer tess, Entity p_180434_2_, float l, float rX, float rY, float rZ, float rYZ, float rXY ) + public void renderParticle( final WorldRenderer tess, final Entity p_180434_2_, final float l, final float rX, final float rY, final float rZ, final float rYZ, final float rXY ) { - float j = 1.0f; + final float j = 1.0f; tess.setColorRGBA_F( this.particleRed * j * 0.9f, this.particleGreen * j * 0.95f, this.particleBlue * j, this.particleAlpha ); if( this.particleAge == 3 ) { this.regen(); } double f6 = this.particleTextureIndexX / 16.0; - double f7 = f6 + 0.0324375F; + final double f7 = f6 + 0.0324375F; double f8 = this.particleTextureIndexY / 16.0; - double f9 = f8 + 0.0324375F; + final double f9 = f8 + 0.0324375F; f6 = f7; f8 = f9; double scale = 0.02;// 0.02F * this.particleScale; - double[] a = new double[3]; - double[] b = new double[3]; + final double[] a = new double[3]; + final double[] b = new double[3]; double ox = 0; double oy = 0; double oz = 0; - EntityPlayer p = Minecraft.getMinecraft().thePlayer; + final EntityPlayer p = Minecraft.getMinecraft().thePlayer; double offX = -rZ; double offY = MathHelper.cos( (float) ( Math.PI / 2.0f + p.rotationPitch * 0.017453292F ) ); double offZ = rX; @@ -143,13 +143,13 @@ public class LightningFX extends EntityFX for( int s = 0; s < this.steps; s++ ) { - double xN = x + this.Steps[s][0]; - double yN = y + this.Steps[s][1]; - double zN = z + this.Steps[s][2]; + final double xN = x + this.Steps[s][0]; + final double yN = y + this.Steps[s][1]; + final double zN = z + this.Steps[s][2]; - double xD = xN - x; - double yD = yN - y; - double zD = zN - z; + final double xD = xN - x; + final double yD = yN - y; + final double zD = zN - z; if( cycle == 0 ) { @@ -170,7 +170,7 @@ public class LightningFX extends EntityFX oz = ( xD * 0 ) - ( 1 * yD ); } - double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( (double) this.steps - (double) s ) / this.steps ) * scale ); + final double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( (double) this.steps - (double) s ) / this.steps ) * scale ); ox /= ss; oy /= ss; oz /= ss; @@ -202,7 +202,7 @@ public class LightningFX extends EntityFX this.hasData = false; } - private void draw( WorldRenderer tess, double[] a, double[] b, double f6, double f8 ) + private void draw( final WorldRenderer tess, final double[] a, final double[] b, final double f6, final double f8 ) { if( this.hasData ) { diff --git a/src/main/java/appeng/client/render/effects/MatterCannonFX.java b/src/main/java/appeng/client/render/effects/MatterCannonFX.java index fb5b3b4f..b23f11e9 100644 --- a/src/main/java/appeng/client/render/effects/MatterCannonFX.java +++ b/src/main/java/appeng/client/render/effects/MatterCannonFX.java @@ -34,7 +34,7 @@ public class MatterCannonFX extends EntityBreakingFX private final TextureAtlasSprite particleTextureIndex; - public MatterCannonFX( World par1World, double par2, double par4, double par6, Item par8Item ) + public MatterCannonFX( final World par1World, final double par2, final double par4, final double par6, final Item par8Item ) { super( par1World, par2, par4, par6, par8Item ); this.particleGravity = 0; @@ -50,7 +50,7 @@ public class MatterCannonFX extends EntityBreakingFX this.noClip = true; } - public void fromItem( AEPartLocation d ) + public void fromItem( final AEPartLocation d ) { this.particleScale *= 1.2f; } @@ -70,18 +70,18 @@ public class MatterCannonFX extends EntityBreakingFX } @Override - public void renderParticle(WorldRenderer par1Tessellator, Entity p_180434_2_, float par2, float par3, float par4, float par5, float par6, float par7 ) + public void renderParticle( final WorldRenderer par1Tessellator, final Entity p_180434_2_, final float par2, final float par3, final float par4, final float par5, final float par6, final float par7 ) { - float f6 = this.particleTextureIndex.getMinU(); - float f7 = this.particleTextureIndex.getMaxU(); - float f8 = this.particleTextureIndex.getMinV(); - float f9 = this.particleTextureIndex.getMaxV(); - float f10 = 0.05F * this.particleScale; + final float f6 = this.particleTextureIndex.getMinU(); + final float f7 = this.particleTextureIndex.getMaxU(); + final float f8 = this.particleTextureIndex.getMinV(); + final float f9 = this.particleTextureIndex.getMaxV(); + final float f10 = 0.05F * this.particleScale; - float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX ); - float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY ); - float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ ); - float f14 = 1.0F; + final float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * par2 - interpPosX ); + final float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * par2 - interpPosY ); + final float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * par2 - interpPosZ ); + final float f14 = 1.0F; par1Tessellator.setColorRGBA_F( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha ); par1Tessellator.addVertexWithUV( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9 ); diff --git a/src/main/java/appeng/client/render/effects/VibrantFX.java b/src/main/java/appeng/client/render/effects/VibrantFX.java index b325a9bf..96c0191f 100644 --- a/src/main/java/appeng/client/render/effects/VibrantFX.java +++ b/src/main/java/appeng/client/render/effects/VibrantFX.java @@ -29,10 +29,10 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class VibrantFX extends EntityFX { - public VibrantFX( World par1World, double x, double y, double z, double par8, double par10, double par12 ) + public VibrantFX( final World par1World, final double x, final double y, final double z, final double par8, final double par10, final double par12 ) { super( par1World, x, y, z, par8, par10, par12 ); - float f = this.rand.nextFloat() * 0.1F + 0.8F; + final float f = this.rand.nextFloat() * 0.1F + 0.8F; this.particleRed = f * 0.7f; this.particleGreen = f * 0.89f; this.particleBlue = f * 0.9f; @@ -50,7 +50,7 @@ public class VibrantFX extends EntityFX } @Override - public float getBrightness( float par1 ) + public float getBrightness( final float par1 ) { return 1.0f; } diff --git a/src/main/java/appeng/client/render/items/PaintBallRender.java b/src/main/java/appeng/client/render/items/PaintBallRender.java index 1c9887d4..6f890adf 100644 --- a/src/main/java/appeng/client/render/items/PaintBallRender.java +++ b/src/main/java/appeng/client/render/items/PaintBallRender.java @@ -36,19 +36,19 @@ public class PaintBallRender implements IItemRenderer { @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { return true; } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { IIcon par2Icon = item.getIconIndex(); if( item.getItemDamage() >= 20 ) @@ -56,28 +56,28 @@ public class PaintBallRender implements IItemRenderer par2Icon = ExtraItemTextures.ItemPaintBallShimmer.getIcon(); } - float f4 = par2Icon.getMinU(); - float f5 = par2Icon.getMaxU(); - float f6 = par2Icon.getMinV(); - float f7 = par2Icon.getMaxV(); + final float f4 = par2Icon.getMinU(); + final float f5 = par2Icon.getMaxU(); + final float f6 = par2Icon.getMinV(); + final float f7 = par2Icon.getMaxV(); - ItemPaintBall ipb = (ItemPaintBall) item.getItem(); + final ItemPaintBall ipb = (ItemPaintBall) item.getItem(); - Tessellator tessellator = Tessellator.instance; + final Tessellator tessellator = Tessellator.instance; GL11.glPushMatrix(); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); - AEColor col = ipb.getColor( item ); + final AEColor col = ipb.getColor( item ); - int colorValue = item.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant; - int r = ( colorValue >> 16 ) & 0xff; - int g = ( colorValue >> 8 ) & 0xff; - int b = ( colorValue ) & 0xff; + final int colorValue = item.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant; + final int r = ( colorValue >> 16 ) & 0xff; + final int g = ( colorValue >> 8 ) & 0xff; + final int b = ( colorValue ) & 0xff; if( item.getItemDamage() >= 20 ) { - float fail = 0.7f; - int full = (int) ( 255 * 0.3 ); + final float fail = 0.7f; + final int full = (int) ( 255 * 0.3 ); GL11.glColor4ub( (byte) ( full + r * fail ), (byte) ( full + g * fail ), (byte) ( full + b * fail ), (byte) 255 ); } else @@ -110,7 +110,7 @@ public class PaintBallRender implements IItemRenderer { GL11.glTranslatef( -0.5F, -0.3F, 0.01F ); } - float f12 = 0.0625F; + final float f12 = 0.0625F; ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 ); GL11.glDisable( GL11.GL_CULL_FACE ); diff --git a/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java b/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java index 8e4278e7..699c7595 100644 --- a/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java +++ b/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java @@ -27,19 +27,19 @@ public class ToolBiometricCardRender implements IItemRenderer // TileEntityItemS { @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { return true; } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { /* TextureAtlasSprite par2Icon = item.getIconIndex(); diff --git a/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java b/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java index dbe00a6c..dadd33d5 100644 --- a/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java +++ b/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java @@ -27,19 +27,19 @@ public class ToolColorApplicatorRender implements IItemRenderer { @Override - public boolean handleRenderType( ItemStack item, ItemRenderType type ) + public boolean handleRenderType( final ItemStack item, final ItemRenderType type ) { return true; } @Override - public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper ) + public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper ) { return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; } @Override - public void renderItem( ItemRenderType type, ItemStack item, Object... data ) + public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data ) { /* TextureAtlasSprite par2Icon = item.getIconIndex(); diff --git a/src/main/java/appeng/client/render/model/ModelCompass.java b/src/main/java/appeng/client/render/model/ModelCompass.java index 92d28aad..bd60629b 100644 --- a/src/main/java/appeng/client/render/model/ModelCompass.java +++ b/src/main/java/appeng/client/render/model/ModelCompass.java @@ -93,14 +93,14 @@ public class ModelCompass extends ModelBase this.setRotation( this.Base, 0F, 0F, 0F ); } - private void setRotation( ModelRenderer model, float x, float y, float z ) + private void setRotation( final ModelRenderer model, final float x, final float y, final float z ) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } - public void renderAll( float rad ) + public void renderAll( final float rad ) { this.setRotation( this.Pointer, 0F, 0F, 0F ); diff --git a/src/main/java/appeng/client/texture/BaseIcon.java b/src/main/java/appeng/client/texture/BaseIcon.java index c90f93fb..a46f83a4 100644 --- a/src/main/java/appeng/client/texture/BaseIcon.java +++ b/src/main/java/appeng/client/texture/BaseIcon.java @@ -6,7 +6,7 @@ public class BaseIcon implements IAESprite { final private TextureAtlasSprite spite; - public BaseIcon( TextureAtlasSprite src ) + public BaseIcon( final TextureAtlasSprite src ) { spite = src; } @@ -31,7 +31,7 @@ public class BaseIcon implements IAESprite @Override public float getInterpolatedU( - double px ) + final double px ) { return spite.getInterpolatedU( px ); } @@ -56,7 +56,7 @@ public class BaseIcon implements IAESprite @Override public float getInterpolatedV( - double px ) + final double px ) { return spite.getInterpolatedV( px ); } diff --git a/src/main/java/appeng/client/texture/CableBusTextures.java b/src/main/java/appeng/client/texture/CableBusTextures.java index 02653f79..8e96ecb6 100644 --- a/src/main/java/appeng/client/texture/CableBusTextures.java +++ b/src/main/java/appeng/client/texture/CableBusTextures.java @@ -80,12 +80,12 @@ public enum CableBusTextures private final String name; public IAESprite IIcon; - CableBusTextures( String name ) + CableBusTextures( final String name ) { this.name = name; } - public static ResourceLocation GuiTexture( String string ) + public static ResourceLocation GuiTexture( final String string ) { return null; } @@ -106,7 +106,7 @@ public enum CableBusTextures return this.IIcon; } - public void registerIcon( TextureMap map ) + public void registerIcon( final TextureMap map ) { IIcon = new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/" + name ) ) ); } diff --git a/src/main/java/appeng/client/texture/ExtraBlockTextures.java b/src/main/java/appeng/client/texture/ExtraBlockTextures.java index a45da106..83ef8fcf 100644 --- a/src/main/java/appeng/client/texture/ExtraBlockTextures.java +++ b/src/main/java/appeng/client/texture/ExtraBlockTextures.java @@ -90,12 +90,12 @@ public enum ExtraBlockTextures private final String name; public IAESprite IIcon; - ExtraBlockTextures( String name ) + ExtraBlockTextures( final String name ) { this.name = name; } - public static ResourceLocation GuiTexture( String string ) + public static ResourceLocation GuiTexture( final String string ) { return new ResourceLocation( "appliedenergistics2", "textures/" + string ); } @@ -116,7 +116,7 @@ public enum ExtraBlockTextures return this.IIcon; } - public void registerIcon( TextureMap map ) + public void registerIcon( final TextureMap map ) { IIcon = new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/" + name ) ) ); } diff --git a/src/main/java/appeng/client/texture/ExtraItemTextures.java b/src/main/java/appeng/client/texture/ExtraItemTextures.java index 982830b9..ae365d2b 100644 --- a/src/main/java/appeng/client/texture/ExtraItemTextures.java +++ b/src/main/java/appeng/client/texture/ExtraItemTextures.java @@ -37,12 +37,12 @@ public enum ExtraItemTextures private final String name; public IAESprite IIcon; - ExtraItemTextures( String name ) + ExtraItemTextures( final String name ) { this.name = name; } - public static ResourceLocation GuiTexture( String string ) + public static ResourceLocation GuiTexture( final String string ) { return new ResourceLocation( "appliedenergistics2", "textures/" + string ); } @@ -57,7 +57,7 @@ public enum ExtraItemTextures return this.IIcon; } - public void registerIcon( TextureMap map ) + public void registerIcon( final TextureMap map ) { IIcon = new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "items/" + name ) ) ); } diff --git a/src/main/java/appeng/client/texture/FlippableIcon.java b/src/main/java/appeng/client/texture/FlippableIcon.java index 2fc94aea..aeff983b 100644 --- a/src/main/java/appeng/client/texture/FlippableIcon.java +++ b/src/main/java/appeng/client/texture/FlippableIcon.java @@ -35,7 +35,7 @@ public class FlippableIcon implements IAESprite return original.getAtlas(); } - public FlippableIcon( IAESprite o ) + public FlippableIcon( final IAESprite o ) { this.original = o; this.flip_u = false; @@ -75,7 +75,7 @@ public class FlippableIcon implements IAESprite } @Override - public float getInterpolatedU( double px ) + public float getInterpolatedU( final double px ) { if( this.flip_u ) { @@ -105,7 +105,7 @@ public class FlippableIcon implements IAESprite } @Override - public float getInterpolatedV( double px ) + public float getInterpolatedV( final double px ) { if( this.flip_v ) { @@ -125,13 +125,13 @@ public class FlippableIcon implements IAESprite return this.original; } - public void setFlip( boolean u, boolean v ) + public void setFlip( final boolean u, final boolean v ) { this.flip_u = u; this.flip_v = v; } - public int setFlip( int orientation ) + public int setFlip( final int orientation ) { this.flip_u = ( orientation & 8 ) == 8; this.flip_v = ( orientation & 16 ) == 16; diff --git a/src/main/java/appeng/client/texture/FullIcon.java b/src/main/java/appeng/client/texture/FullIcon.java index 6cb3fa53..abf6fac6 100644 --- a/src/main/java/appeng/client/texture/FullIcon.java +++ b/src/main/java/appeng/client/texture/FullIcon.java @@ -29,7 +29,7 @@ public class FullIcon implements IAESprite private final TextureAtlasSprite p; - public FullIcon( TextureAtlasSprite o ) + public FullIcon( final TextureAtlasSprite o ) { if( o == null ) { @@ -73,7 +73,7 @@ public class FullIcon implements IAESprite @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedU( double d0 ) + public float getInterpolatedU( final double d0 ) { if( d0 > 8.0 ) { @@ -98,7 +98,7 @@ public class FullIcon implements IAESprite @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedV( double d0 ) + public float getInterpolatedV( final double d0 ) { if( d0 > 8.0 ) { diff --git a/src/main/java/appeng/client/texture/MissingIcon.java b/src/main/java/appeng/client/texture/MissingIcon.java index c0bfd2f2..b169efce 100644 --- a/src/main/java/appeng/client/texture/MissingIcon.java +++ b/src/main/java/appeng/client/texture/MissingIcon.java @@ -31,7 +31,7 @@ public class MissingIcon implements IAESprite { TextureAtlasSprite missing; - public MissingIcon( Object forWhat ) + public MissingIcon( final Object forWhat ) { } @@ -72,7 +72,7 @@ public class MissingIcon implements IAESprite } @Override - public float getInterpolatedU( double var1 ) + public float getInterpolatedU( final double var1 ) { return this.getMissing().getInterpolatedU( var1 ); } @@ -90,7 +90,7 @@ public class MissingIcon implements IAESprite } @Override - public float getInterpolatedV( double var1 ) + public float getInterpolatedV( final double var1 ) { return this.getMissing().getInterpolatedV( var1 ); } diff --git a/src/main/java/appeng/client/texture/OffsetIcon.java b/src/main/java/appeng/client/texture/OffsetIcon.java index e25719b1..9a319718 100644 --- a/src/main/java/appeng/client/texture/OffsetIcon.java +++ b/src/main/java/appeng/client/texture/OffsetIcon.java @@ -32,7 +32,7 @@ public class OffsetIcon implements IAESprite private final IAESprite p; - public OffsetIcon( IAESprite iIcon, float x, float y ) + public OffsetIcon( final IAESprite iIcon, final float x, final float y ) { if( iIcon == null ) { @@ -72,7 +72,7 @@ public class OffsetIcon implements IAESprite @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedU( double d0 ) + public float getInterpolatedU( final double d0 ) { return this.u( d0 - this.offsetX ); } @@ -93,7 +93,7 @@ public class OffsetIcon implements IAESprite @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedV( double d0 ) + public float getInterpolatedV( final double d0 ) { return this.v( d0 - this.offsetY ); } @@ -105,12 +105,12 @@ public class OffsetIcon implements IAESprite return this.p.getIconName(); } - private float v( double d ) + private float v( final double d ) { return this.p.getInterpolatedV( Math.min( 16.0, Math.max( 0.0, d ) ) ); } - private float u( double d ) + private float u( final double d ) { return this.p.getInterpolatedU( Math.min( 16.0, Math.max( 0.0, d ) ) ); } diff --git a/src/main/java/appeng/client/texture/TaughtIcon.java b/src/main/java/appeng/client/texture/TaughtIcon.java index 26be277e..5304d93b 100644 --- a/src/main/java/appeng/client/texture/TaughtIcon.java +++ b/src/main/java/appeng/client/texture/TaughtIcon.java @@ -37,7 +37,7 @@ public class TaughtIcon implements IAESprite return icon.getAtlas(); } - public TaughtIcon( IAESprite iIcon, float tightness ) + public TaughtIcon( final IAESprite iIcon, final float tightness ) { if( iIcon == null ) { @@ -76,7 +76,7 @@ public class TaughtIcon implements IAESprite @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedU( double d0 ) + public float getInterpolatedU( final double d0 ) { return this.u( d0 ); } @@ -97,7 +97,7 @@ public class TaughtIcon implements IAESprite @Override @SideOnly( Side.CLIENT ) - public float getInterpolatedV( double d0 ) + public float getInterpolatedV( final double d0 ) { return this.v( d0 ); } diff --git a/src/main/java/appeng/client/texture/TmpFlippableIcon.java b/src/main/java/appeng/client/texture/TmpFlippableIcon.java index 68f28a34..b90af563 100644 --- a/src/main/java/appeng/client/texture/TmpFlippableIcon.java +++ b/src/main/java/appeng/client/texture/TmpFlippableIcon.java @@ -35,7 +35,7 @@ public class TmpFlippableIcon extends FlippableIcon while( i instanceof FlippableIcon ) { - FlippableIcon fi = (FlippableIcon) i; + final FlippableIcon fi = (FlippableIcon) i; if( fi.flip_u ) { this.flip_u = !this.flip_u; diff --git a/src/main/java/appeng/container/AEBaseContainer.java b/src/main/java/appeng/container/AEBaseContainer.java index 62dc3887..2c8e3189 100644 --- a/src/main/java/appeng/container/AEBaseContainer.java +++ b/src/main/java/appeng/container/AEBaseContainer.java @@ -101,12 +101,12 @@ public abstract class AEBaseContainer extends Container int ticksSinceCheck = 900; IAEItemStack clientRequestedTargetItem = null; - public AEBaseContainer( InventoryPlayer ip, TileEntity myTile, IPart myPart ) + public AEBaseContainer( final InventoryPlayer ip, final TileEntity myTile, final IPart myPart ) { this( ip, myTile, myPart, null ); } - public AEBaseContainer( InventoryPlayer ip, TileEntity myTile, IPart myPart, IGuiItemObject gio ) + public AEBaseContainer( final InventoryPlayer ip, final TileEntity myTile, final IPart myPart, final IGuiItemObject gio ) { this.invPlayer = ip; this.tileEntity = myTile; @@ -138,11 +138,11 @@ public abstract class AEBaseContainer extends Container private void prepareSync() { - for( Field f : this.getClass().getFields() ) + for( final Field f : this.getClass().getFields() ) { if( f.isAnnotationPresent( GuiSync.class ) ) { - GuiSync annotation = f.getAnnotation( GuiSync.class ); + final GuiSync annotation = f.getAnnotation( GuiSync.class ); if( this.syncData.containsKey( annotation.value() ) ) { AELog.warning( "Channel already in use: " + annotation.value() + " for " + f.getName() ); @@ -155,7 +155,7 @@ public abstract class AEBaseContainer extends Container } } - public AEBaseContainer( InventoryPlayer ip, Object anchor ) + public AEBaseContainer( final InventoryPlayer ip, final Object anchor ) { this.invPlayer = ip; this.tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null; @@ -172,7 +172,7 @@ public abstract class AEBaseContainer extends Container this.prepareSync(); } - public void postPartial( PacketPartialItem packetPartialItem ) + public void postPartial( final PacketPartialItem packetPartialItem ) { this.dataChunks.add( packetPartialItem ); if( packetPartialItem.getPageCount() == this.dataChunks.size() ) @@ -184,28 +184,28 @@ public abstract class AEBaseContainer extends Container private void parsePartials() { int total = 0; - for( PacketPartialItem ppi : this.dataChunks ) + for( final PacketPartialItem ppi : this.dataChunks ) { total += ppi.getSize(); } - byte[] buffer = new byte[total]; + final byte[] buffer = new byte[total]; int cursor = 0; - for( PacketPartialItem ppi : this.dataChunks ) + for( final PacketPartialItem ppi : this.dataChunks ) { cursor = ppi.write( buffer, cursor ); } try { - NBTTagCompound data = CompressedStreamTools.readCompressed( new ByteArrayInputStream( buffer ) ); + final NBTTagCompound data = CompressedStreamTools.readCompressed( new ByteArrayInputStream( buffer ) ); if( data != null ) { this.setTargetStack( AEApi.instance().storage().createItemStack( ItemStack.loadItemStackFromNBT( data ) ) ); } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -218,21 +218,21 @@ public abstract class AEBaseContainer extends Container return this.clientRequestedTargetItem; } - public void setTargetStack( IAEItemStack stack ) + public void setTargetStack( final IAEItemStack stack ) { // client doesn't need to re-send, makes for lower overhead rapid packets. if( Platform.isClient() ) { - ItemStack a = stack == null ? null : stack.getItemStack(); - ItemStack b = this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack(); + final ItemStack a = stack == null ? null : stack.getItemStack(); + final ItemStack b = this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack(); if( Platform.isSameItemPrecise( a, b ) ) { return; } - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - NBTTagCompound item = new NBTTagCompound(); + final ByteArrayOutputStream stream = new ByteArrayOutputStream(); + final NBTTagCompound item = new NBTTagCompound(); if( stack != null ) { @@ -243,16 +243,16 @@ public abstract class AEBaseContainer extends Container { CompressedStreamTools.writeCompressed( item, stream ); - int maxChunkSize = 30000; - List miniPackets = new LinkedList(); + final int maxChunkSize = 30000; + final List miniPackets = new LinkedList(); - byte[] data = stream.toByteArray(); + final byte[] data = stream.toByteArray(); - ByteArrayInputStream bis = new ByteArrayInputStream( data, 0, stream.size() ); + final ByteArrayInputStream bis = new ByteArrayInputStream( data, 0, stream.size() ); while( bis.available() > 0 ) { - int nextBLock = bis.available() > maxChunkSize ? maxChunkSize : bis.available(); - byte[] nextSegment = new byte[nextBLock]; + final int nextBLock = bis.available() > maxChunkSize ? maxChunkSize : bis.available(); + final byte[] nextSegment = new byte[nextBLock]; bis.read( nextSegment ); miniPackets.add( nextSegment ); } @@ -260,14 +260,14 @@ public abstract class AEBaseContainer extends Container stream.close(); int page = 0; - for( byte[] packet : miniPackets ) + for( final byte[] packet : miniPackets ) { - PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet ); + final PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet ); page++; NetworkHandler.instance.sendToServer( ppi ); } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); return; @@ -282,7 +282,7 @@ public abstract class AEBaseContainer extends Container return this.mySrc; } - public void verifyPermissions( SecurityPermissions security, boolean requirePower ) + public void verifyPermissions( final SecurityPermissions security, final boolean requirePower ) { if( Platform.isClient() ) { @@ -299,28 +299,28 @@ public abstract class AEBaseContainer extends Container this.isContainerValid = this.isContainerValid && this.hasAccess( security, requirePower ); } - protected boolean hasAccess( SecurityPermissions perm, boolean requirePower ) + protected boolean hasAccess( final SecurityPermissions perm, final boolean requirePower ) { - IActionHost host = this.getActionHost(); + final IActionHost host = this.getActionHost(); if( host != null ) { - IGridNode gn = host.getActionableNode(); + final IGridNode gn = host.getActionableNode(); if( gn != null ) { - IGrid g = gn.getGrid(); + final IGrid g = gn.getGrid(); if( g != null ) { if( requirePower ) { - IEnergyGrid eg = g.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = g.getCache( IEnergyGrid.class ); if( !eg.isNetworkPowered() ) { return false; } } - ISecurityGrid sg = g.getCache( ISecurityGrid.class ); + final ISecurityGrid sg = g.getCache( ISecurityGrid.class ); if( sg.hasPermission( this.invPlayer.player, perm ) ) { return true; @@ -332,7 +332,7 @@ public abstract class AEBaseContainer extends Container return false; } - public void lockPlayerInventorySlot( int idx ) + public void lockPlayerInventorySlot( final int idx ) { this.locked.add( idx ); } @@ -364,7 +364,7 @@ public abstract class AEBaseContainer extends Container return this.tileEntity; } - public final void updateFullProgressBar( int idx, long value ) + public final void updateFullProgressBar( final int idx, final long value ) { if( this.syncData.containsKey( idx ) ) { @@ -375,7 +375,7 @@ public abstract class AEBaseContainer extends Container this.updateProgressBar( idx, (int) value ); } - public void stringSync( int idx, String value ) + public void stringSync( final int idx, final String value ) { if( this.syncData.containsKey( idx ) ) { @@ -383,7 +383,7 @@ public abstract class AEBaseContainer extends Container } } - protected void bindPlayerInventory( InventoryPlayer inventoryPlayer, int offsetX, int offsetY ) + protected void bindPlayerInventory( final InventoryPlayer inventoryPlayer, final int offsetX, final int offsetY ) { // bind player inventory for( int i = 0; i < 3; i++ ) @@ -416,11 +416,11 @@ public abstract class AEBaseContainer extends Container } @Override - protected Slot addSlotToContainer( Slot newSlot ) + protected Slot addSlotToContainer( final Slot newSlot ) { if( newSlot instanceof AppEngSlot ) { - AppEngSlot s = (AppEngSlot) newSlot; + final AppEngSlot s = (AppEngSlot) newSlot; s.myContainer = this; return super.addSlotToContainer( newSlot ); } @@ -437,11 +437,11 @@ public abstract class AEBaseContainer extends Container if( Platform.isServer() ) { - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { - ICrafting icrafting = (ICrafting) crafter; + final ICrafting icrafting = (ICrafting) crafter; - for( SyncData sd : this.syncData.values() ) + for( final SyncData sd : this.syncData.values() ) { sd.tick( icrafting ); } @@ -452,7 +452,7 @@ public abstract class AEBaseContainer extends Container } @Override - public ItemStack transferStackInSlot( EntityPlayer p, int idx ) + public ItemStack transferStackInSlot( final EntityPlayer p, final int idx ) { if( Platform.isClient() ) { @@ -460,7 +460,7 @@ public abstract class AEBaseContainer extends Container } boolean hasMETiles = false; - for( Object is : this.inventorySlots ) + for( final Object is : this.inventorySlots ) { if( is instanceof InternalSlotME ) { @@ -474,7 +474,7 @@ public abstract class AEBaseContainer extends Container return null; } - AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get( idx ); // require AE SLots! + final AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get( idx ); // require AE SLots! if( clickSlot instanceof SlotDisabled || clickSlot instanceof SlotInaccessible ) { @@ -489,7 +489,7 @@ public abstract class AEBaseContainer extends Container return null; } - List selectedSlots = new ArrayList(); + final List selectedSlots = new ArrayList(); /** * Gather a list of valid destinations. @@ -499,9 +499,9 @@ public abstract class AEBaseContainer extends Container tis = this.shiftStoreItem( tis ); // target slots in the container... - for( Object inventorySlot : this.inventorySlots ) + for( final Object inventorySlot : this.inventorySlots ) { - AppEngSlot cs = (AppEngSlot) inventorySlot; + final AppEngSlot cs = (AppEngSlot) inventorySlot; if( !( cs.isPlayerSide() ) && !( cs instanceof SlotFake ) && !( cs instanceof SlotCraftingMatrix ) ) { @@ -515,9 +515,9 @@ public abstract class AEBaseContainer extends Container else { // target slots in the container... - for( Object inventorySlot : this.inventorySlots ) + for( final Object inventorySlot : this.inventorySlots ) { - AppEngSlot cs = (AppEngSlot) inventorySlot; + final AppEngSlot cs = (AppEngSlot) inventorySlot; if( ( cs.isPlayerSide() ) && !( cs instanceof SlotFake ) && !( cs instanceof SlotCraftingMatrix ) ) { @@ -537,10 +537,10 @@ public abstract class AEBaseContainer extends Container if( tis != null ) { // target slots in the container... - for( Object inventorySlot : this.inventorySlots ) + for( final Object inventorySlot : this.inventorySlots ) { - AppEngSlot cs = (AppEngSlot) inventorySlot; - ItemStack destination = cs.getStack(); + final AppEngSlot cs = (AppEngSlot) inventorySlot; + final ItemStack destination = cs.getStack(); if( !( cs.isPlayerSide() ) && cs instanceof SlotFake ) { @@ -563,7 +563,7 @@ public abstract class AEBaseContainer extends Container if( tis != null ) { // find partials.. - for( Slot d : selectedSlots ) + for( final Slot d : selectedSlots ) { if( d instanceof SlotDisabled || d instanceof SlotME ) { @@ -574,7 +574,7 @@ public abstract class AEBaseContainer extends Container { if( d.getHasStack() ) { - ItemStack t = d.getStack(); + final ItemStack t = d.getStack(); if( Platform.isSameItemPrecise( tis, t ) ) // t.isItemEqual(tis)) { @@ -615,7 +615,7 @@ public abstract class AEBaseContainer extends Container } // any match.. - for( Slot d : selectedSlots ) + for( final Slot d : selectedSlots ) { if( d instanceof SlotDisabled || d instanceof SlotME ) { @@ -626,7 +626,7 @@ public abstract class AEBaseContainer extends Container { if( d.getHasStack() ) { - ItemStack t = d.getStack(); + final ItemStack t = d.getStack(); if( Platform.isSameItemPrecise( t, tis ) ) { @@ -673,7 +673,7 @@ public abstract class AEBaseContainer extends Container maxSize = d.getSlotStackLimit(); } - ItemStack tmp = tis.copy(); + final ItemStack tmp = tis.copy(); if( tmp.stackSize > maxSize ) { tmp.stackSize = maxSize; @@ -712,7 +712,7 @@ public abstract class AEBaseContainer extends Container } @Override - public final void updateProgressBar( int idx, int value ) + public final void updateProgressBar( final int idx, final int value ) { if( this.syncData.containsKey( idx ) ) { @@ -721,7 +721,7 @@ public abstract class AEBaseContainer extends Container } @Override - public boolean canInteractWith( EntityPlayer entityplayer ) + public boolean canInteractWith( final EntityPlayer entityplayer ) { if( this.isContainerValid ) { @@ -735,16 +735,16 @@ public abstract class AEBaseContainer extends Container } @Override - public boolean canDragIntoSlot( Slot s ) + public boolean canDragIntoSlot( final Slot s ) { return ( (AppEngSlot) s ).isDraggable; } - public void doAction( EntityPlayerMP player, InventoryAction action, int slot, long id ) + public void doAction( final EntityPlayerMP player, final InventoryAction action, final int slot, final long id ) { if( slot >= 0 && slot < this.inventorySlots.size() ) { - Slot s = this.getSlot( slot ); + final Slot s = this.getSlot( slot ); if( s instanceof SlotCraftingTerm ) { @@ -761,7 +761,7 @@ public abstract class AEBaseContainer extends Container if( s instanceof SlotFake ) { - ItemStack hand = player.inventory.getItemStack(); + final ItemStack hand = player.inventory.getItemStack(); switch( action ) { @@ -781,7 +781,7 @@ public abstract class AEBaseContainer extends Container if( hand != null ) { - ItemStack is = hand.copy(); + final ItemStack is = hand.copy(); is.stackSize = 1; s.putStack( is ); } @@ -826,9 +826,9 @@ public abstract class AEBaseContainer extends Container if( action == InventoryAction.MOVE_REGION ) { - List from = new LinkedList(); + final List from = new LinkedList(); - for( Object j : this.inventorySlots ) + for( final Object j : this.inventorySlots ) { if( j instanceof Slot && j.getClass() == s.getClass() ) { @@ -836,7 +836,7 @@ public abstract class AEBaseContainer extends Container } } - for( Slot fr : from ) + for( final Slot fr : from ) { this.transferStackInSlot( player, fr.slotNumber ); } @@ -846,7 +846,7 @@ public abstract class AEBaseContainer extends Container } // get target item. - IAEItemStack slotItem = this.clientRequestedTargetItem; + final IAEItemStack slotItem = this.clientRequestedTargetItem; switch( action ) { @@ -863,7 +863,7 @@ public abstract class AEBaseContainer extends Container ais.setStackSize( myItem.getMaxStackSize() ); - InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); + final InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); myItem.stackSize = (int) ais.getStackSize(); myItem = adp.simulateAdd( myItem ); @@ -885,21 +885,21 @@ public abstract class AEBaseContainer extends Container return; } - int releaseQty = 1; - ItemStack isg = player.inventory.getItemStack(); + final int releaseQty = 1; + final ItemStack isg = player.inventory.getItemStack(); if( isg != null && releaseQty > 0 ) { IAEItemStack ais = AEApi.instance().storage().createItemStack( isg ); ais.setStackSize( 1 ); - IAEItemStack extracted = ais.copy(); + final IAEItemStack extracted = ais.copy(); ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc ); if( ais == null ) { - InventoryAdaptor ia = new AdaptorPlayerHand( player ); + final InventoryAdaptor ia = new AdaptorPlayerHand( player ); - ItemStack fail = ia.removeItems( 1, extracted.getItemStack(), null ); + final ItemStack fail = ia.removeItems( 1, extracted.getItemStack(), null ); if( fail == null ) { this.cellInv.extractItems( extracted, Actionable.MODULATE, this.mySrc ); @@ -920,7 +920,7 @@ public abstract class AEBaseContainer extends Container if( slotItem != null ) { int liftQty = 1; - ItemStack item = player.inventory.getItemStack(); + final ItemStack item = player.inventory.getItemStack(); if( item != null ) { @@ -941,9 +941,9 @@ public abstract class AEBaseContainer extends Container ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc ); if( ais != null ) { - InventoryAdaptor ia = new AdaptorPlayerHand( player ); + final InventoryAdaptor ia = new AdaptorPlayerHand( player ); - ItemStack fail = ia.addItems( ais.getItemStack() ); + final ItemStack fail = ia.addItems( ais.getItemStack() ); if( fail != null ) { this.cellInv.injectItems( ais, Actionable.MODULATE, this.mySrc ); @@ -1005,13 +1005,13 @@ public abstract class AEBaseContainer extends Container if( slotItem != null ) { IAEItemStack ais = slotItem.copy(); - long maxSize = ais.getItemStack().getMaxStackSize(); + final long maxSize = ais.getItemStack().getMaxStackSize(); ais.setStackSize( maxSize ); ais = this.cellInv.extractItems( ais, Actionable.SIMULATE, this.mySrc ); if( ais != null ) { - long stackSize = Math.min( maxSize, ais.getStackSize() ); + final long stackSize = Math.min( maxSize, ais.getStackSize() ); ais.setStackSize( ( stackSize + 1 ) >> 1 ); ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc ); } @@ -1034,7 +1034,7 @@ public abstract class AEBaseContainer extends Container ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc ); if( ais == null ) { - ItemStack is = player.inventory.getItemStack(); + final ItemStack is = player.inventory.getItemStack(); is.stackSize--; if( is.stackSize <= 0 ) { @@ -1048,7 +1048,7 @@ public abstract class AEBaseContainer extends Container case CREATIVE_DUPLICATE: if( player.capabilities.isCreativeMode && slotItem != null ) { - ItemStack is = slotItem.getItemStack(); + final ItemStack is = slotItem.getItemStack(); is.stackSize = is.getMaxStackSize(); player.inventory.setItemStack( is ); this.updateHeld( player ); @@ -1063,7 +1063,7 @@ public abstract class AEBaseContainer extends Container if( slotItem != null ) { - int playerInv = 9 * 4; + final int playerInv = 9 * 4; for( int slotNum = 0; slotNum < playerInv; slotNum++ ) { IAEItemStack ais = slotItem.copy(); @@ -1071,7 +1071,7 @@ public abstract class AEBaseContainer extends Container ais.setStackSize( myItem.getMaxStackSize() ); - InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); + final InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); myItem.stackSize = (int) ais.getStackSize(); myItem = adp.simulateAdd( myItem ); @@ -1098,7 +1098,7 @@ public abstract class AEBaseContainer extends Container } } - protected void updateHeld( EntityPlayerMP p ) + protected void updateHeld( final EntityPlayerMP p ) { if( Platform.isServer() ) { @@ -1106,20 +1106,20 @@ public abstract class AEBaseContainer extends Container { NetworkHandler.instance.sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.create( p.inventory.getItemStack() ) ), p ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } } - public ItemStack shiftStoreItem( ItemStack input ) + public ItemStack shiftStoreItem( final ItemStack input ) { if( this.powerSrc == null || this.cellInv == null ) { return input; } - IAEItemStack ais = Platform.poweredInsert( this.powerSrc, this.cellInv, AEApi.instance().storage().createItemStack( input ), this.mySrc ); + final IAEItemStack ais = Platform.poweredInsert( this.powerSrc, this.cellInv, AEApi.instance().storage().createItemStack( input ), this.mySrc ); if( ais == null ) { return null; @@ -1127,7 +1127,7 @@ public abstract class AEBaseContainer extends Container return ais.getItemStack(); } - private void updateSlot( Slot clickSlot ) + private void updateSlot( final Slot clickSlot ) { // ??? this.detectAndSendChanges(); @@ -1175,7 +1175,7 @@ public abstract class AEBaseContainer extends Container { NetworkHandler.instance.sendTo( new PacketValueConfig( "CustomName", this.customName ), (EntityPlayerMP) this.invPlayer.player ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -1185,10 +1185,10 @@ public abstract class AEBaseContainer extends Container } } - public void swapSlotContents( int slotA, int slotB ) + public void swapSlotContents( final int slotA, final int slotB ) { - Slot a = this.getSlot( slotA ); - Slot b = this.getSlot( slotB ); + final Slot a = this.getSlot( slotA ); + final Slot b = this.getSlot( slotB ); // NPE protection... if( a == null || b == null ) @@ -1196,8 +1196,8 @@ public abstract class AEBaseContainer extends Container return; } - ItemStack isA = a.getStack(); - ItemStack isB = b.getStack(); + final ItemStack isA = a.getStack(); + final ItemStack isB = b.getStack(); // something to do? if( isA == null && isB == null ) @@ -1240,7 +1240,7 @@ public abstract class AEBaseContainer extends Container return; } - int totalA = testA.stackSize; + final int totalA = testA.stackSize; testA.stackSize = a.getSlotStackLimit(); testB = testA.copy(); @@ -1254,7 +1254,7 @@ public abstract class AEBaseContainer extends Container return; } - int totalB = testB.stackSize; + final int totalB = testB.stackSize; testB.stackSize = b.getSlotStackLimit(); testA = testB.copy(); @@ -1265,17 +1265,17 @@ public abstract class AEBaseContainer extends Container b.putStack( testB ); } - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { } - public void onSlotChange( Slot s ) + public void onSlotChange( final Slot s ) { } - public boolean isValidForSlot( Slot s, ItemStack i ) + public boolean isValidForSlot( final Slot s, final ItemStack i ) { return true; } diff --git a/src/main/java/appeng/container/ContainerNull.java b/src/main/java/appeng/container/ContainerNull.java index c1c8ee73..8e94d3ca 100644 --- a/src/main/java/appeng/container/ContainerNull.java +++ b/src/main/java/appeng/container/ContainerNull.java @@ -30,7 +30,7 @@ public class ContainerNull extends Container { @Override - public boolean canInteractWith( EntityPlayer entityplayer ) + public boolean canInteractWith( final EntityPlayer entityplayer ) { return false; } diff --git a/src/main/java/appeng/container/ContainerOpenContext.java b/src/main/java/appeng/container/ContainerOpenContext.java index 01438b6d..f7376a66 100644 --- a/src/main/java/appeng/container/ContainerOpenContext.java +++ b/src/main/java/appeng/container/ContainerOpenContext.java @@ -36,9 +36,9 @@ public class ContainerOpenContext public int z; public AEPartLocation side; - public ContainerOpenContext( Object myItem ) + public ContainerOpenContext( final Object myItem ) { - boolean isWorld = myItem instanceof IPart || myItem instanceof TileEntity; + final boolean isWorld = myItem instanceof IPart || myItem instanceof TileEntity; this.isItem = !isWorld; } diff --git a/src/main/java/appeng/container/guisync/SyncData.java b/src/main/java/appeng/container/guisync/SyncData.java index fdac2312..1e49303d 100644 --- a/src/main/java/appeng/container/guisync/SyncData.java +++ b/src/main/java/appeng/container/guisync/SyncData.java @@ -40,7 +40,7 @@ public class SyncData private final int channel; private Object clientVersion; - public SyncData( AEBaseContainer container, Field field, GuiSync annotation ) + public SyncData( final AEBaseContainer container, final Field field, final GuiSync annotation ) { this.clientVersion = null; this.source = container; @@ -53,11 +53,11 @@ public class SyncData return this.channel; } - public void tick( ICrafting c ) + public void tick( final ICrafting c ) { try { - Object val = this.field.get( this.source ); + final Object val = this.field.get( this.source ); if( val != null && this.clientVersion == null ) { this.send( c, val ); @@ -67,21 +67,21 @@ public class SyncData this.send( c, val ); } } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } } - private void send( ICrafting o, Object val ) throws IOException + private void send( final ICrafting o, final Object val ) throws IOException { if( val instanceof String ) { @@ -110,11 +110,11 @@ public class SyncData this.clientVersion = val; } - public void update( Object val ) + public void update( final Object val ) { try { - Object oldValue = this.field.get( this.source ); + final Object oldValue = this.field.get( this.source ); if( val instanceof String ) { this.updateString( oldValue, (String) val ); @@ -124,40 +124,40 @@ public class SyncData this.updateValue( oldValue, (Long) val ); } } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } } - private void updateString( Object oldValue, String val ) + private void updateString( final Object oldValue, final String val ) { try { this.field.set( this.source, val ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } } - private void updateValue( Object oldValue, long val ) + private void updateValue( final Object oldValue, final long val ) { try { if( this.field.getType().isEnum() ) { - EnumSet valList = EnumSet.allOf( (Class) this.field.getType() ); - for( Enum e : valList ) + final EnumSet valList = EnumSet.allOf( (Class) this.field.getType() ); + for( final Enum e : valList ) { if( e.ordinal() == val ) { @@ -196,11 +196,11 @@ public class SyncData this.source.onUpdate( this.field.getName(), oldValue, this.field.get( this.source ) ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java index d0991a5d..c94797d2 100644 --- a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java +++ b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java @@ -57,15 +57,15 @@ public class ContainerCellWorkbench extends ContainerUpgradeable private int lastUpgrades = 0; private ItemStack LastCell; - public ContainerCellWorkbench( InventoryPlayer ip, TileCellWorkbench te ) + public ContainerCellWorkbench( final InventoryPlayer ip, final TileCellWorkbench te ) { super( ip, te ); this.workBench = te; } - public void setFuzzy( FuzzyMode valueOf ) + public void setFuzzy( final FuzzyMode valueOf ) { - ICellWorkbenchItem cwi = this.workBench.getCell(); + final ICellWorkbenchItem cwi = this.workBench.getCell(); if( cwi != null ) { cwi.setFuzzyMode( this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ), valueOf ); @@ -92,16 +92,16 @@ public class ContainerCellWorkbench extends ContainerUpgradeable protected void setupConfig() { - IInventory cell = this.upgradeable.getInventoryByName( "cell" ); + final IInventory cell = this.upgradeable.getInventoryByName( "cell" ); this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.invPlayer ) ); - IInventory inv = this.upgradeable.getInventoryByName( "config" ); - IInventory upgradeInventory = new Upgrades(); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory upgradeInventory = new Upgrades(); // null, 3 * 8 ); int offset = 0; - int y = 29; - int x = 8; + final int y = 29; + final int x = 8; for( int w = 0; w < 7; w++ ) { for( int z = 0; z < 9; z++ ) @@ -115,7 +115,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable { for( int z = 0; z < 8; z++ ) { - int iSLot = zz * 8 + z; + final int iSLot = zz * 8 + z; this.addSlotToContainer( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this.invPlayer ) ); } } @@ -132,7 +132,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public int availableUpgrades() { - ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); + final ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); if( this.prevStack != is ) { this.prevStack = is; @@ -144,7 +144,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @Override public void detectAndSendChanges() { - ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); + final ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ); if( Platform.isServer() ) { if( this.workBench.getWorld().getTileEntity( this.workBench.getPos() ) != this.workBench ) @@ -152,18 +152,18 @@ public class ContainerCellWorkbench extends ContainerUpgradeable this.isContainerValid = false; } - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { - ICrafting icrafting = (ICrafting) crafter; + final ICrafting icrafting = (ICrafting) crafter; if( this.prevStack != is ) { // if the bars changed an item was probably made, so just send shit! - for( Object s : this.inventorySlots ) + for( final Object s : this.inventorySlots ) { if( s instanceof OptionalSlotRestrictedInput ) { - OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s; + final OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s; icrafting.sendSlotContents( this, sri.slotNumber, sri.getStack() ); } } @@ -180,7 +180,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { return idx < this.availableUpgrades(); } @@ -193,7 +193,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { if( field.equals( "copyMode" ) ) { @@ -205,7 +205,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable public void clear() { - IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); for( int x = 0; x < inv.getSizeInventory(); x++ ) { inv.setInventorySlotContents( x, null ); @@ -215,7 +215,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable private FuzzyMode getFuzzyMode() { - ICellWorkbenchItem cwi = this.workBench.getCell(); + final ICellWorkbenchItem cwi = this.workBench.getCell(); if( cwi != null ) { return cwi.getFuzzyMode( this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ) ); @@ -225,14 +225,14 @@ public class ContainerCellWorkbench extends ContainerUpgradeable public void partition() { - IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); - IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( this.upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS ); + final IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( this.upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS ); Iterator i = new NullIterator(); if( cellInv != null ) { - IItemList list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() ); + final IItemList list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() ); i = list.iterator(); } @@ -240,7 +240,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable { if( i.hasNext() ) { - ItemStack g = i.next().getItemStack(); + final ItemStack g = i.next().getItemStack(); g.stackSize = 1; inv.setInventorySlotContents( x, g ); } @@ -263,33 +263,33 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return ContainerCellWorkbench.this.getCellUpgradeInventory().getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { - IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); - ItemStack is = inv.decrStackSize( i, j ); + final IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); + final ItemStack is = inv.decrStackSize( i, j ); inv.markDirty(); return is; } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { - IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); - ItemStack is = inv.getStackInSlotOnClosing( i ); + final IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); + final ItemStack is = inv.getStackInSlotOnClosing( i ); inv.markDirty(); return is; } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { - IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); + final IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory(); inv.setInventorySlotContents( i, itemstack ); inv.markDirty(); } @@ -319,27 +319,27 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } @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 ContainerCellWorkbench.this.getCellUpgradeInventory().isItemValidForSlot( i, itemstack ); } @@ -352,15 +352,15 @@ public class ContainerCellWorkbench extends ContainerUpgradeable @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 ) { } diff --git a/src/main/java/appeng/container/implementations/ContainerChest.java b/src/main/java/appeng/container/implementations/ContainerChest.java index 0f43537c..c0cb379f 100644 --- a/src/main/java/appeng/container/implementations/ContainerChest.java +++ b/src/main/java/appeng/container/implementations/ContainerChest.java @@ -30,7 +30,7 @@ public class ContainerChest extends AEBaseContainer final TileChest chest; - public ContainerChest( InventoryPlayer ip, TileChest chest ) + public ContainerChest( final InventoryPlayer ip, final TileChest chest ) { super( ip, chest, null ); this.chest = chest; diff --git a/src/main/java/appeng/container/implementations/ContainerCondenser.java b/src/main/java/appeng/container/implementations/ContainerCondenser.java index c60e3461..976aba47 100644 --- a/src/main/java/appeng/container/implementations/ContainerCondenser.java +++ b/src/main/java/appeng/container/implementations/ContainerCondenser.java @@ -42,7 +42,7 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv @GuiSync( 2 ) public CondenserOutput output = CondenserOutput.TRASH; - public ContainerCondenser( InventoryPlayer ip, TileCondenser condenser ) + public ContainerCondenser( final InventoryPlayer ip, final TileCondenser condenser ) { super( ip, condenser, null ); this.condenser = condenser; @@ -59,8 +59,8 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv { if( Platform.isServer() ) { - double maxStorage = this.condenser.getStorage(); - double requiredEnergy = this.condenser.getRequiredPower(); + final double maxStorage = this.condenser.getStorage(); + final double requiredEnergy = this.condenser.getRequiredPower(); this.requiredEnergy = requiredEnergy == 0 ? (int) maxStorage : (int) Math.min( requiredEnergy, maxStorage ); this.storedPower = (int) this.condenser.storedPower; diff --git a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java index 2adfd7c9..1b7ebcf2 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java @@ -41,7 +41,7 @@ public class ContainerCraftAmount extends AEBaseContainer final ITerminalHost priHost; public IAEItemStack whatToMake; - public ContainerCraftAmount( InventoryPlayer ip, ITerminalHost te ) + public ContainerCraftAmount( final InventoryPlayer ip, final ITerminalHost te ) { super( ip, te ); this.priHost = te; @@ -59,7 +59,7 @@ public class ContainerCraftAmount extends AEBaseContainer public IGrid getGrid() { - IActionHost h = ( (IActionHost) this.getTarget() ); + final IActionHost h = ( (IActionHost) this.getTarget() ); return h.getActionableNode().getGrid(); } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java index 1e2d14a2..bee6e6a7 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java @@ -88,13 +88,13 @@ public class ContainerCraftConfirm extends AEBaseContainer public String myName = ""; protected long cpuIdx = Long.MIN_VALUE; - public ContainerCraftConfirm( InventoryPlayer ip, ITerminalHost te ) + public ContainerCraftConfirm( final InventoryPlayer ip, final ITerminalHost te ) { super( ip, te ); this.priHost = te; } - public void cycleCpu( boolean next ) + public void cycleCpu( final boolean next ) { if( next ) { @@ -136,15 +136,15 @@ public class ContainerCraftConfirm extends AEBaseContainer return; } - ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); - ImmutableSet cpuSet = cc.getCpus(); + final ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); + final ImmutableSet cpuSet = cc.getCpus(); int matches = 0; boolean changed = false; - for( ICraftingCPU c : cpuSet ) + for( final ICraftingCPU c : cpuSet ) { boolean found = false; - for( CraftingCPURecord ccr : this.cpus ) + for( final CraftingCPURecord ccr : this.cpus ) { if( ccr.cpu == c ) { @@ -152,7 +152,7 @@ public class ContainerCraftConfirm extends AEBaseContainer } } - boolean matched = this.cpuMatches( c ); + final boolean matched = this.cpuMatches( c ); if( matched ) { @@ -168,7 +168,7 @@ public class ContainerCraftConfirm extends AEBaseContainer if( changed || this.cpus.size() != matches ) { this.cpus.clear(); - for( ICraftingCPU c : cpuSet ) + for( final ICraftingCPU c : cpuSet ) { if( this.cpuMatches( c ) ) { @@ -205,28 +205,28 @@ public class ContainerCraftConfirm extends AEBaseContainer try { - PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 ); - PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); - PacketMEInventoryUpdate c = this.result.isSimulation() ? new PacketMEInventoryUpdate( (byte) 2 ) : null; + final PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 ); + final PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); + final PacketMEInventoryUpdate c = this.result.isSimulation() ? new PacketMEInventoryUpdate( (byte) 2 ) : null; - IItemList plan = AEApi.instance().storage().createItemList(); + final IItemList plan = AEApi.instance().storage().createItemList(); this.result.populatePlan( plan ); this.bytesUsed = this.result.getByteTotal(); - for( IAEItemStack out : plan ) + for( final IAEItemStack out : plan ) { IAEItemStack o = out.copy(); o.reset(); o.setStackSize( out.getStackSize() ); - IAEItemStack p = out.copy(); + final IAEItemStack p = out.copy(); p.reset(); p.setStackSize( out.getCountRequestable() ); - IStorageGrid sg = this.getGrid().getCache( IStorageGrid.class ); - IMEInventory items = sg.getItemInventory(); + final IStorageGrid sg = this.getGrid().getCache( IStorageGrid.class ); + final IMEInventory items = sg.getItemInventory(); IAEItemStack m = null; if( c != null && this.result.isSimulation() ) @@ -259,7 +259,7 @@ public class ContainerCraftConfirm extends AEBaseContainer } } - for( Object g : this.crafters ) + for( final Object g : this.crafters ) { if( g instanceof EntityPlayer ) { @@ -272,12 +272,12 @@ public class ContainerCraftConfirm extends AEBaseContainer } } } - catch( IOException e ) + catch( final IOException e ) { // :P } } - catch( Throwable e ) + catch( final Throwable e ) { this.getPlayerInv().player.addChatMessage( new ChatComponentText( "Error: " + e.toString() ) ); AELog.error( e ); @@ -292,11 +292,11 @@ public class ContainerCraftConfirm extends AEBaseContainer public IGrid getGrid() { - IActionHost h = ( (IActionHost) this.getTarget() ); + final IActionHost h = ( (IActionHost) this.getTarget() ); return h.getActionableNode().getGrid(); } - private boolean cpuMatches( ICraftingCPU c ) + private boolean cpuMatches( final ICraftingCPU c ) { return c.getAvailableStorage() >= this.bytesUsed && !c.isBusy(); } @@ -324,7 +324,7 @@ public class ContainerCraftConfirm extends AEBaseContainer { GuiBridge originalGui = null; - IActionHost ah = this.getActionHost(); + final IActionHost ah = this.getActionHost(); if( ah instanceof WirelessTerminalGuiObject ) { originalGui = GuiBridge.GUI_WIRELESS_TERM; @@ -347,14 +347,14 @@ public class ContainerCraftConfirm extends AEBaseContainer if( this.result != null && !this.simulation ) { - ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); - ICraftingLink g = cc.submitJob( this.result, null, this.selectedCpu == -1 ? null : this.cpus.get( this.selectedCpu ).cpu, true, this.getActionSrc() ); + final ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class ); + final ICraftingLink g = cc.submitJob( this.result, null, this.selectedCpu == -1 ? null : this.cpus.get( this.selectedCpu ).cpu, true, this.getActionSrc() ); this.autoStart = false; if( g != null && originalGui != null && this.openContext != null ) { NetworkHandler.instance.sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.invPlayer.player ); - TileEntity te = this.openContext.getTile(); + final TileEntity te = this.openContext.getTile(); Platform.openGUI( this.invPlayer.player, te, this.openContext.side, originalGui ); } } @@ -366,7 +366,7 @@ public class ContainerCraftConfirm extends AEBaseContainer } @Override - public void removeCraftingFromCrafters( ICrafting c ) + public void removeCraftingFromCrafters( final ICrafting c ) { super.removeCraftingFromCrafters( c ); if( this.job != null ) @@ -377,7 +377,7 @@ public class ContainerCraftConfirm extends AEBaseContainer } @Override - public void onContainerClosed( EntityPlayer par1EntityPlayer ) + public void onContainerClosed( final EntityPlayer par1EntityPlayer ) { super.onContainerClosed( par1EntityPlayer ); if( this.job != null ) diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java index bd7ac183..2c025643 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java @@ -62,15 +62,15 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH @GuiSync( 0 ) public long eta = -1; - public ContainerCraftingCPU( InventoryPlayer ip, Object te ) + public ContainerCraftingCPU( final InventoryPlayer ip, final Object te ) { super( ip, te ); - IGridHost host = (IGridHost) ( te instanceof IGridHost ? te : null ); + final IGridHost host = (IGridHost) ( te instanceof IGridHost ? te : null ); if( host != null ) { this.findNode( host, AEPartLocation.INTERNAL ); - for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) { this.findNode( host, d ); } @@ -87,11 +87,11 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } } - private void findNode( IGridHost host, AEPartLocation d ) + private void findNode( final IGridHost host, final AEPartLocation d ) { if( this.network == null ) { - IGridNode node = host.getGridNode( d ); + final IGridNode node = host.getGridNode( d ); if( node != null ) { this.network = node.getGrid(); @@ -99,7 +99,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } } - protected void setCPU( ICraftingCPU c ) + protected void setCPU( final ICraftingCPU c ) { if( c == this.monitor ) { @@ -111,7 +111,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH this.monitor.removeListener( this ); } - for( Object g : this.crafters ) + for( final Object g : this.crafters ) { if( g instanceof EntityPlayer ) { @@ -119,7 +119,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH { NetworkHandler.instance.sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (EntityPlayerMP) g ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -153,7 +153,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } @Override - public void removeCraftingFromCrafters( ICrafting c ) + public void removeCraftingFromCrafters( final ICrafting c ) { super.removeCraftingFromCrafters( c ); @@ -164,7 +164,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } @Override - public void onContainerClosed( EntityPlayer player ) + public void onContainerClosed( final EntityPlayer player ) { super.onContainerClosed( player ); if( this.monitor != null ) @@ -189,11 +189,11 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH this.eta = eta; } - PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 ); - PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); - PacketMEInventoryUpdate c = new PacketMEInventoryUpdate( (byte) 2 ); + final PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 ); + final PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 ); + final PacketMEInventoryUpdate c = new PacketMEInventoryUpdate( (byte) 2 ); - for( IAEItemStack out : this.list ) + for( final IAEItemStack out : this.list ) { a.appendItem( this.monitor.getItemStack( out, CraftingItemList.STORAGE ) ); b.appendItem( this.monitor.getItemStack( out, CraftingItemList.ACTIVE ) ); @@ -202,7 +202,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH this.list.resetStatus(); - for( Object g : this.crafters ) + for( final Object g : this.crafters ) { if( g instanceof EntityPlayer ) { @@ -223,7 +223,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } } } - catch( IOException e ) + catch( final IOException e ) { // :P } @@ -232,13 +232,13 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH } @Override - public boolean isValid( Object verificationToken ) + public boolean isValid( final Object verificationToken ) { return true; } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource actionSource ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource actionSource ) { for( IAEItemStack is : change ) { diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java index afac23e7..bf9d6e90 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java @@ -42,7 +42,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU @GuiSync( 7 ) public String myName = ""; - public ContainerCraftingStatus( InventoryPlayer ip, ITerminalHost te ) + public ContainerCraftingStatus( final InventoryPlayer ip, final ITerminalHost te ) { super( ip, te ); } @@ -50,15 +50,15 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU @Override public void detectAndSendChanges() { - ICraftingGrid cc = this.network.getCache( ICraftingGrid.class ); - ImmutableSet cpuSet = cc.getCpus(); + final ICraftingGrid cc = this.network.getCache( ICraftingGrid.class ); + final ImmutableSet cpuSet = cc.getCpus(); int matches = 0; boolean changed = false; - for( ICraftingCPU c : cpuSet ) + for( final ICraftingCPU c : cpuSet ) { boolean found = false; - for( CraftingCPURecord ccr : this.cpus ) + for( final CraftingCPURecord ccr : this.cpus ) { if( ccr.cpu == c ) { @@ -66,7 +66,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU } } - boolean matched = this.cpuMatches( c ); + final boolean matched = this.cpuMatches( c ); if( matched ) { @@ -82,7 +82,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU if( changed || this.cpus.size() != matches ) { this.cpus.clear(); - for( ICraftingCPU c : cpuSet ) + for( final ICraftingCPU c : cpuSet ) { if( this.cpuMatches( c ) ) { @@ -98,7 +98,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU super.detectAndSendChanges(); } - private boolean cpuMatches( ICraftingCPU c ) + private boolean cpuMatches( final ICraftingCPU c ) { return c.isBusy(); } @@ -135,7 +135,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU } } - public void cycleCpu( boolean next ) + public void cycleCpu( final boolean next ) { if( next ) { diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java index 58943f92..f538173e 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java @@ -43,12 +43,12 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE final SlotCraftingMatrix[] craftingSlots = new SlotCraftingMatrix[9]; final SlotCraftingTerm outputSlot; - public ContainerCraftingTerm( InventoryPlayer ip, ITerminalHost monitorable ) + public ContainerCraftingTerm( final InventoryPlayer ip, final ITerminalHost monitorable ) { super( ip, monitorable, false ); this.ct = (PartCraftingTerminal) monitorable; - IInventory crafting = this.ct.getInventoryByName( "crafting" ); + final IInventory crafting = this.ct.getInventoryByName( "crafting" ); for( int y = 0; y < 3; y++ ) { @@ -69,10 +69,10 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE * Callback for when the crafting matrix is changed. */ @Override - public void onCraftMatrixChanged( IInventory par1IInventory ) + public void onCraftMatrixChanged( final IInventory par1IInventory ) { - ContainerNull cn = new ContainerNull(); - InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 ); + final ContainerNull cn = new ContainerNull(); + final InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 ); for( int x = 0; x < 9; x++ ) { @@ -89,13 +89,13 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "player" ) ) { diff --git a/src/main/java/appeng/container/implementations/ContainerDrive.java b/src/main/java/appeng/container/implementations/ContainerDrive.java index 3e570656..97459cb6 100644 --- a/src/main/java/appeng/container/implementations/ContainerDrive.java +++ b/src/main/java/appeng/container/implementations/ContainerDrive.java @@ -30,7 +30,7 @@ public class ContainerDrive extends AEBaseContainer final TileDrive drive; - public ContainerDrive( InventoryPlayer ip, TileDrive drive ) + public ContainerDrive( final InventoryPlayer ip, final TileDrive drive ) { super( ip, drive, null ); this.drive = drive; diff --git a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java index 42b11852..0d7f04ae 100644 --- a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java +++ b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java @@ -42,7 +42,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable @GuiSync( 6 ) public YesNo placeMode; - public ContainerFormationPlane( InventoryPlayer ip, PartFormationPlane te ) + public ContainerFormationPlane( final InventoryPlayer ip, final PartFormationPlane te ) { super( ip, te ); this.storageBus = te; @@ -57,10 +57,10 @@ public class ContainerFormationPlane extends ContainerUpgradeable @Override protected void setupConfig() { - int xo = 8; - int yo = 23 + 6; + final int xo = 8; + final int yo = 23 + 6; - IInventory config = this.upgradeable.getInventoryByName( "config" ); + final IInventory config = this.upgradeable.getInventoryByName( "config" ); for( int y = 0; y < 7; y++ ) { for( int x = 0; x < 9; x++ ) @@ -76,7 +76,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable } } - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() ); @@ -111,9 +111,9 @@ public class ContainerFormationPlane extends ContainerUpgradeable } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { - int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); + final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); return upgrades > idx; } diff --git a/src/main/java/appeng/container/implementations/ContainerGrinder.java b/src/main/java/appeng/container/implementations/ContainerGrinder.java index 1de44a8a..60264f18 100644 --- a/src/main/java/appeng/container/implementations/ContainerGrinder.java +++ b/src/main/java/appeng/container/implementations/ContainerGrinder.java @@ -32,7 +32,7 @@ public class ContainerGrinder extends AEBaseContainer final TileGrinder grinder; - public ContainerGrinder( InventoryPlayer ip, TileGrinder grinder ) + public ContainerGrinder( final InventoryPlayer ip, final TileGrinder grinder ) { super( ip, grinder, null ); this.grinder = grinder; diff --git a/src/main/java/appeng/container/implementations/ContainerIOPort.java b/src/main/java/appeng/container/implementations/ContainerIOPort.java index ce2745f1..8248a72a 100644 --- a/src/main/java/appeng/container/implementations/ContainerIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerIOPort.java @@ -43,7 +43,7 @@ public class ContainerIOPort extends ContainerUpgradeable @GuiSync( 3 ) public OperationMode opMode = OperationMode.EMPTY; - public ContainerIOPort( InventoryPlayer ip, TileIOPort te ) + public ContainerIOPort( final InventoryPlayer ip, final TileIOPort te ) { super( ip, te ); this.ioPort = te; @@ -61,7 +61,7 @@ public class ContainerIOPort extends ContainerUpgradeable int offX = 19; int offY = 17; - IInventory cells = this.upgradeable.getInventoryByName( "cells" ); + final IInventory cells = this.upgradeable.getInventoryByName( "cells" ); for( int y = 0; y < 3; y++ ) { @@ -81,7 +81,7 @@ public class ContainerIOPort extends ContainerUpgradeable } } - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() ); diff --git a/src/main/java/appeng/container/implementations/ContainerInscriber.java b/src/main/java/appeng/container/implementations/ContainerInscriber.java index fe5f6a9f..707d0ea1 100644 --- a/src/main/java/appeng/container/implementations/ContainerInscriber.java +++ b/src/main/java/appeng/container/implementations/ContainerInscriber.java @@ -54,7 +54,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres @GuiSync( 3 ) public int processingTime = -1; - public ContainerInscriber( InventoryPlayer ip, TileInscriber te ) + public ContainerInscriber( final InventoryPlayer ip, final TileInscriber te ) { super( ip, te ); this.ti = te; @@ -105,14 +105,14 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres } @Override - public boolean isValidForSlot( Slot s, ItemStack is ) + public boolean isValidForSlot( final Slot s, final ItemStack is ) { - ItemStack top = this.ti.getStackInSlot( 0 ); - ItemStack bot = this.ti.getStackInSlot( 1 ); + final ItemStack top = this.ti.getStackInSlot( 0 ); + final ItemStack bot = this.ti.getStackInSlot( 1 ); if( s == this.middle ) { - for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() ) + for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() ) { if( Platform.isSameItemPrecise( optional, is ) ) { @@ -123,18 +123,18 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres boolean matches = false; boolean found = false; - for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) { - boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and... + final boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and... ( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orNull() ) ); - boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and... + final boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and... ( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orNull() ) ); if( matchA || matchB ) { matches = true; - for( ItemStack option : recipe.getInputs() ) + for( final ItemStack option : recipe.getInputs() ) { if( Platform.isSameItemPrecise( is, option ) ) { @@ -171,7 +171,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres // everything else boolean isValid = false; - for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) { if( Platform.isSameItemPrecise( recipe.getTopOptional().orNull(), otherSlot ) ) { diff --git a/src/main/java/appeng/container/implementations/ContainerInterface.java b/src/main/java/appeng/container/implementations/ContainerInterface.java index 5c5ce027..29cadd8e 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterface.java +++ b/src/main/java/appeng/container/implementations/ContainerInterface.java @@ -43,7 +43,7 @@ public class ContainerInterface extends ContainerUpgradeable @GuiSync( 4 ) public YesNo iTermMode = YesNo.YES; - public ContainerInterface( InventoryPlayer ip, IInterfaceHost te ) + public ContainerInterface( final InventoryPlayer ip, final IInterfaceHost te ) { super( ip, te.getInterfaceDuality().getHost() ); @@ -91,7 +91,7 @@ public class ContainerInterface extends ContainerUpgradeable } @Override - protected void loadSettingsFromHost( IConfigManager cm ) + protected void loadSettingsFromHost( final IConfigManager cm ) { this.bMode = (YesNo) cm.getSetting( Settings.BLOCK ); this.iTermMode = (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL ); diff --git a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java index c1d354d8..eab63eed 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java +++ b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java @@ -66,7 +66,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer IGrid grid; NBTTagCompound data = new NBTTagCompound(); - public ContainerInterfaceTerminal( InventoryPlayer ip, PartInterfaceTerminal anchor ) + public ContainerInterfaceTerminal( final InventoryPlayer ip, final PartInterfaceTerminal anchor ) { super( ip, anchor ); @@ -96,23 +96,23 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer int total = 0; boolean missing = false; - IActionHost host = this.getActionHost(); + final IActionHost host = this.getActionHost(); if( host != null ) { - IGridNode agn = host.getActionableNode(); + final IGridNode agn = host.getActionableNode(); if( agn != null && agn.isActive() ) { - for( IGridNode gn : this.grid.getMachines( TileInterface.class ) ) + for( final IGridNode gn : this.grid.getMachines( TileInterface.class ) ) { if( gn.isActive() ) { - IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); if( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO ) { continue; } - InvTracker t = this.diList.get( ih ); + final InvTracker t = this.diList.get( ih ); if( t == null ) { @@ -120,7 +120,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } else { - DualityInterface dual = ih.getInterfaceDuality(); + final DualityInterface dual = ih.getInterfaceDuality(); if( !t.unlocalizedName.equals( dual.getTermName() ) ) { missing = true; @@ -131,17 +131,17 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } } - for( IGridNode gn : this.grid.getMachines( PartInterface.class ) ) + for( final IGridNode gn : this.grid.getMachines( PartInterface.class ) ) { if( gn.isActive() ) { - IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); if( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO ) { continue; } - InvTracker t = this.diList.get( ih ); + final InvTracker t = this.diList.get( ih ); if( t == null ) { @@ -149,7 +149,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } else { - DualityInterface dual = ih.getInterfaceDuality(); + final DualityInterface dual = ih.getInterfaceDuality(); if( !t.unlocalizedName.equals( dual.getTermName() ) ) { missing = true; @@ -168,9 +168,9 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } else { - for( Entry en : this.diList.entrySet() ) + for( final Entry en : this.diList.entrySet() ) { - InvTracker inv = en.getValue(); + final InvTracker inv = en.getValue(); for( int x = 0; x < inv.server.getSizeInventory(); x++ ) { if( this.isDifferent( inv.server.getStackInSlot( x ), inv.client.getStackInSlot( x ) ) ) @@ -187,7 +187,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer { NetworkHandler.instance.sendTo( new PacketCompressedNBT( this.data ), (EntityPlayerMP) this.getPlayerInv().player ); } - catch( IOException e ) + catch( final IOException e ) { // :P } @@ -197,20 +197,20 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } @Override - public void doAction( EntityPlayerMP player, InventoryAction action, int slot, long id ) + public void doAction( final EntityPlayerMP player, final InventoryAction action, final int slot, final long id ) { - InvTracker inv = this.byId.get( id ); + final InvTracker inv = this.byId.get( id ); if( inv != null ) { - ItemStack is = inv.server.getStackInSlot( slot ); - boolean hasItemInHand = player.inventory.getItemStack() != null; + final ItemStack is = inv.server.getStackInSlot( slot ); + final boolean hasItemInHand = player.inventory.getItemStack() != null; - InventoryAdaptor playerHand = new AdaptorPlayerHand( player ); + final InventoryAdaptor playerHand = new AdaptorPlayerHand( player ); - WrapperInvSlot slotInv = new PatternInvSlot( inv.server ); + final WrapperInvSlot slotInv = new PatternInvSlot( inv.server ); - IInventory theSlot = slotInv.getWrapper( slot ); - InventoryAdaptor interfaceSlot = new AdaptorIInventory( theSlot ); + final IInventory theSlot = slotInv.getWrapper( slot ); + final InventoryAdaptor interfaceSlot = new AdaptorIInventory( theSlot ); switch( action ) { @@ -226,7 +226,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer else { inSlot = inSlot.copy(); - ItemStack inHand = player.inventory.getItemStack().copy(); + final ItemStack inHand = player.inventory.getItemStack().copy(); theSlot.setInventorySlotContents( 0, null ); player.inventory.setItemStack( null ); @@ -246,7 +246,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } else { - IInventory mySlot = slotInv.getWrapper( slot ); + final IInventory mySlot = slotInv.getWrapper( slot ); mySlot.setInventorySlotContents( 0, playerHand.addItems( mySlot.getStackInSlot( 0 ) ) ); } @@ -281,14 +281,14 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer break; case SHIFT_CLICK: - IInventory mySlot = slotInv.getWrapper( slot ); - InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); + final IInventory mySlot = slotInv.getWrapper( slot ); + final InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); mySlot.setInventorySlotContents( 0, playerInv.addItems( mySlot.getStackInSlot( 0 ) ) ); break; case MOVE_REGION: - InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); + final InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); for( int x = 0; x < inv.server.getSizeInventory(); x++ ) { inv.server.setInventorySlotContents( x, playerInvAd.addItems( inv.server.getStackInSlot( x ) ) ); @@ -311,31 +311,31 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } } - private void regenList( NBTTagCompound data ) + private void regenList( final NBTTagCompound data ) { this.byId.clear(); this.diList.clear(); - IActionHost host = this.getActionHost(); + final IActionHost host = this.getActionHost(); if( host != null ) { - IGridNode agn = host.getActionableNode(); + final IGridNode agn = host.getActionableNode(); if( agn != null && agn.isActive() ) { - for( IGridNode gn : this.grid.getMachines( TileInterface.class ) ) + for( final IGridNode gn : this.grid.getMachines( TileInterface.class ) ) { - IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); - DualityInterface dual = ih.getInterfaceDuality(); + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final DualityInterface dual = ih.getInterfaceDuality(); if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) { this.diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) ); } } - for( IGridNode gn : this.grid.getMachines( PartInterface.class ) ) + for( final IGridNode gn : this.grid.getMachines( PartInterface.class ) ) { - IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); - DualityInterface dual = ih.getInterfaceDuality(); + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final DualityInterface dual = ih.getInterfaceDuality(); if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) { this.diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) ); @@ -346,15 +346,15 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer data.setBoolean( "clear", true ); - for( Entry en : this.diList.entrySet() ) + for( final Entry en : this.diList.entrySet() ) { - InvTracker inv = en.getValue(); + final InvTracker inv = en.getValue(); this.byId.put( inv.which, inv ); this.addItems( data, inv, 0, inv.server.getSizeInventory() ); } } - private boolean isDifferent( ItemStack a, ItemStack b ) + private boolean isDifferent( final ItemStack a, final ItemStack b ) { if( a == null && b == null ) { @@ -369,10 +369,10 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer return !ItemStack.areItemStacksEqual( a, b ); } - private void addItems( NBTTagCompound data, InvTracker inv, int offset, int length ) + private void addItems( final NBTTagCompound data, final InvTracker inv, final int offset, final int length ) { - String name = '=' + Long.toString( inv.which, Character.MAX_RADIX ); - NBTTagCompound tag = data.getCompoundTag( name ); + final String name = '=' + Long.toString( inv.which, Character.MAX_RADIX ); + final NBTTagCompound tag = data.getCompoundTag( name ); if( tag.hasNoTags() ) { @@ -382,9 +382,9 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer for( int x = 0; x < length; x++ ) { - NBTTagCompound itemNBT = new NBTTagCompound(); + final NBTTagCompound itemNBT = new NBTTagCompound(); - ItemStack is = inv.server.getStackInSlot( x + offset ); + final ItemStack is = inv.server.getStackInSlot( x + offset ); // "update" client side. inv.client.setInventorySlotContents( x + offset, is == null ? null : is.copy() ); @@ -409,7 +409,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer final IInventory client; final IInventory server; - public InvTracker( DualityInterface dual, IInventory patterns, String unlocalizedName ) + public InvTracker( final DualityInterface dual, final IInventory patterns, final String unlocalizedName ) { this.server = patterns; this.client = new AppEngInternalInventory( null, this.server.getSizeInventory() ); @@ -421,13 +421,13 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer static class PatternInvSlot extends WrapperInvSlot { - public PatternInvSlot( IInventory inv ) + public PatternInvSlot( final IInventory inv ) { super( inv ); } @Override - public boolean isItemValid( ItemStack itemstack ) + public boolean isItemValid( final ItemStack itemstack ) { return itemstack != null && itemstack.getItem() instanceof ItemEncodedPattern; } diff --git a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java index 50b9cb91..8ff4289c 100644 --- a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java +++ b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java @@ -52,20 +52,20 @@ public class ContainerLevelEmitter extends ContainerUpgradeable @GuiSync( 4 ) public YesNo cmType; - public ContainerLevelEmitter( InventoryPlayer ip, PartLevelEmitter te ) + public ContainerLevelEmitter( final InventoryPlayer ip, final PartLevelEmitter te ) { super( ip, te ); this.lvlEmitter = te; } @SideOnly( Side.CLIENT ) - public void setTextField( GuiTextField level ) + public void setTextField( final GuiTextField level ) { this.textField = level; this.textField.setText( String.valueOf( this.EmitterValue ) ); } - public void setLevel( long l, EntityPlayer player ) + public void setLevel( final long l, final EntityPlayer player ) { this.lvlEmitter.setReportingValue( l ); this.EmitterValue = l; @@ -75,7 +75,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable protected void setupConfig() { - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); if( this.availableUpgrades() > 0 ) { this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); @@ -93,9 +93,9 @@ public class ContainerLevelEmitter extends ContainerUpgradeable this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer ) ).setNotDraggable() ); } - IInventory inv = this.upgradeable.getInventoryByName( "config" ); - int y = 40; - int x = 80 + 44; + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final int y = 40; + final int x = 80 + 44; this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); } @@ -130,7 +130,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { if( field.equals( "EmitterValue" ) ) { diff --git a/src/main/java/appeng/container/implementations/ContainerMAC.java b/src/main/java/appeng/container/implementations/ContainerMAC.java index 3d132fcb..4a6fde9a 100644 --- a/src/main/java/appeng/container/implementations/ContainerMAC.java +++ b/src/main/java/appeng/container/implementations/ContainerMAC.java @@ -45,17 +45,17 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi @GuiSync( 4 ) public int craftProgress = 0; - public ContainerMAC( InventoryPlayer ip, TileMolecularAssembler te ) + public ContainerMAC( final InventoryPlayer ip, final TileMolecularAssembler te ) { super( ip, te ); this.tma = te; } - public boolean isValidItemForSlot( int slotIndex, ItemStack i ) + public boolean isValidItemForSlot( final int slotIndex, final ItemStack i ) { - IInventory mac = this.upgradeable.getInventoryByName( "mac" ); + final IInventory mac = this.upgradeable.getInventoryByName( "mac" ); - ItemStack is = mac.getStackInSlot( 10 ); + final ItemStack is = mac.getStackInSlot( 10 ); if( is == null ) { return false; @@ -63,9 +63,9 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi if( is.getItem() instanceof ItemEncodedPattern ) { - World w = this.getTileEntity().getWorld(); - ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); - ICraftingPatternDetails ph = iep.getPatternForItem( is, w ); + final World w = this.getTileEntity().getWorld(); + final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); + final ICraftingPatternDetails ph = iep.getPatternForItem( is, w ); if( ph.isCraftable() ) { return ph.isValidItemForSlot( slotIndex, i, w ); @@ -87,13 +87,13 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi int offX = 29; int offY = 30; - IInventory mac = this.upgradeable.getInventoryByName( "mac" ); + final IInventory mac = this.upgradeable.getInventoryByName( "mac" ); for( int y = 0; y < 3; y++ ) { for( int x = 0; x < 3; x++ ) { - SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offX + x * 18, offY + y * 18 ); + final SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offX + x * 18, offY + y * 18 ); this.addSlotToContainer( s ); } } @@ -107,7 +107,7 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi offX = 122; offY = 17; - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() ); diff --git a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java index cfe88547..7454e6b4 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java +++ b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java @@ -84,12 +84,12 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa IConfigManager serverCM; private IGridNode networkNode; - public ContainerMEMonitorable( InventoryPlayer ip, ITerminalHost monitorable ) + public ContainerMEMonitorable( final InventoryPlayer ip, final ITerminalHost monitorable ) { this( ip, monitorable, true ); } - protected ContainerMEMonitorable( InventoryPlayer ip, ITerminalHost monitorable, boolean bindInventory ) + protected ContainerMEMonitorable( final InventoryPlayer ip, final ITerminalHost monitorable, final boolean bindInventory ) { super( ip, monitorable instanceof TileEntity ? (TileEntity) monitorable : null, monitorable instanceof IPart ? (IPart) monitorable : null ); @@ -121,11 +121,11 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } else if( monitorable instanceof IGridHost ) { - IGridNode node = ( (IGridHost) monitorable ).getGridNode( AEPartLocation.INTERNAL ); + final IGridNode node = ( (IGridHost) monitorable ).getGridNode( AEPartLocation.INTERNAL ); if( node != null ) { this.networkNode = node; - IGrid g = node.getGrid(); + final IGrid g = node.getGrid(); if( g != null ) { this.powerSrc = new ChannelPowerSrc( this.networkNode, (IEnergySource) g.getCache( IEnergyGrid.class ) ); @@ -175,21 +175,21 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa this.isContainerValid = false; } - for( Settings set : this.serverCM.getSettings() ) + for( final Settings set : this.serverCM.getSettings() ) { - Enum sideLocal = this.serverCM.getSetting( set ); - Enum sideRemote = this.clientCM.getSetting( set ); + final Enum sideLocal = this.serverCM.getSetting( set ); + final Enum sideRemote = this.clientCM.getSetting( set ); if( sideLocal != sideRemote ) { this.clientCM.putSetting( set, sideLocal ); - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { try { NetworkHandler.instance.sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -201,13 +201,13 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa { try { - IItemList monitorCache = this.monitor.getStorageList(); + final IItemList monitorCache = this.monitor.getStorageList(); - PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); + final PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); - for( IAEItemStack is : this.items ) + for( final IAEItemStack is : this.items ) { - IAEItemStack send = monitorCache.findPrecise( is ); + final IAEItemStack send = monitorCache.findPrecise( is ); if( send == null ) { is.setStackSize( 0 ); @@ -223,7 +223,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa { this.items.resetStatus(); - for( Object c : this.crafters ) + for( final Object c : this.crafters ) { if( c instanceof EntityPlayer ) { @@ -232,7 +232,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } } } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -240,7 +240,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa this.updatePowerStatus(); - boolean oldAccessible = this.canAccessViewCells; + final boolean oldAccessible = this.canAccessViewCells; this.canAccessViewCells = this.hasAccess( SecurityPermissions.BUILD, false ); if( this.canAccessViewCells != oldAccessible ) { @@ -274,14 +274,14 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa this.hasPower = this.powerSrc.extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.8; } } - catch( Throwable t ) + catch( final Throwable t ) { // :P } } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { if( field.equals( "canAccessViewCells" ) ) { @@ -298,29 +298,29 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } @Override - public void onCraftGuiOpened( ICrafting c ) + public void onCraftGuiOpened( final ICrafting c ) { super.onCraftGuiOpened( c ); this.queueInventory( c ); } - public void queueInventory( ICrafting c ) + public void queueInventory( final ICrafting c ) { if( Platform.isServer() && c instanceof EntityPlayer && this.monitor != null ) { try { PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); - IItemList monitorCache = this.monitor.getStorageList(); + final IItemList monitorCache = this.monitor.getStorageList(); - for( IAEItemStack send : monitorCache ) + for( final IAEItemStack send : monitorCache ) { try { piu.appendItem( send ); } - catch( BufferOverflowException boe ) + catch( final BufferOverflowException boe ) { NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c ); @@ -331,7 +331,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -339,7 +339,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } @Override - public void removeCraftingFromCrafters( ICrafting c ) + public void removeCraftingFromCrafters( final ICrafting c ) { super.removeCraftingFromCrafters( c ); @@ -350,7 +350,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } @Override - public void onContainerClosed( EntityPlayer player ) + public void onContainerClosed( final EntityPlayer player ) { super.onContainerClosed( player ); if( this.monitor != null ) @@ -360,15 +360,15 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } @Override - public boolean isValid( Object verificationToken ) + public boolean isValid( final Object verificationToken ) { return true; } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource source ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource source ) { - for( IAEItemStack is : change ) + for( final IAEItemStack is : change ) { this.items.add( is ); } @@ -377,18 +377,18 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa @Override public void onListUpdate() { - for( Object c : this.crafters ) + for( final Object c : this.crafters ) { if( c instanceof ICrafting ) { - ICrafting cr = (ICrafting) c; + final ICrafting cr = (ICrafting) c; this.queueInventory( cr ); } } } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { if( this.gui != null ) { @@ -408,7 +408,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa public ItemStack[] getViewCells() { - ItemStack[] list = new ItemStack[this.cellView.length]; + final ItemStack[] list = new ItemStack[this.cellView.length]; for( int x = 0; x < this.cellView.length; x++ ) { diff --git a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java index ba72fa27..4a7038f7 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java +++ b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java @@ -37,12 +37,12 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable private int ticks = 0; private final int slot; - public ContainerMEPortableCell( InventoryPlayer ip, IPortableCell monitorable ) + public ContainerMEPortableCell( final InventoryPlayer ip, final IPortableCell monitorable ) { super( ip, monitorable, false ); if( monitorable instanceof IInventorySlotAware ) { - int slotIndex = ( (IInventorySlotAware) monitorable ).getInventorySlot(); + final int slotIndex = ( (IInventorySlotAware) monitorable ).getInventorySlot(); this.lockPlayerInventorySlot( slotIndex ); this.slot = slotIndex; } @@ -58,7 +58,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable @Override public void detectAndSendChanges() { - ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem() : this.getPlayerInv().getStackInSlot( this.slot ); + final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem() : this.getPlayerInv().getStackInSlot( this.slot ); if( this.civ != null ) { diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java index 67e57c51..a2a289d9 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java @@ -57,15 +57,15 @@ public class ContainerNetworkStatus extends AEBaseContainer IGrid network; int delay = 40; - public ContainerNetworkStatus( InventoryPlayer ip, INetworkTool te ) + public ContainerNetworkStatus( final InventoryPlayer ip, final INetworkTool te ) { super( ip, null, null ); - IGridHost host = te.getGridHost(); + final IGridHost host = te.getGridHost(); if( host != null ) { this.findNode( host, AEPartLocation.INTERNAL ); - for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) { this.findNode( host, d ); } @@ -77,11 +77,11 @@ public class ContainerNetworkStatus extends AEBaseContainer } } - private void findNode( IGridHost host, AEPartLocation d ) + private void findNode( final IGridHost host, final AEPartLocation d ) { if( this.network == null ) { - IGridNode node = host.getGridNode( d ); + final IGridNode node = host.getGridNode( d ); if( node != null ) { this.network = node.getGrid(); @@ -97,7 +97,7 @@ public class ContainerNetworkStatus extends AEBaseContainer { this.delay = 0; - IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); if( eg != null ) { this.avgAddition = (long) ( 100.0 * eg.getAvgPowerInjection() ); @@ -108,31 +108,31 @@ public class ContainerNetworkStatus extends AEBaseContainer try { - PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); + final PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); - for( Class machineClass : this.network.getMachinesClasses() ) + for( final Class machineClass : this.network.getMachinesClasses() ) { - IItemList list = AEApi.instance().storage().createItemList(); - for( IGridNode machine : this.network.getMachines( machineClass ) ) + final IItemList list = AEApi.instance().storage().createItemList(); + for( final IGridNode machine : this.network.getMachines( machineClass ) ) { - IGridBlock blk = machine.getGridBlock(); - ItemStack is = blk.getMachineRepresentation(); + final IGridBlock blk = machine.getGridBlock(); + final ItemStack is = blk.getMachineRepresentation(); if( is != null && is.getItem() != null ) { - IAEItemStack ais = AEItemStack.create( is ); + final IAEItemStack ais = AEItemStack.create( is ); ais.setStackSize( 1 ); ais.setCountRequestable( (long) ( blk.getIdlePowerUsage() * 100.0 ) ); list.add( ais ); } } - for( IAEItemStack ais : list ) + for( final IAEItemStack ais : list ) { piu.appendItem( ais ); } } - for( Object c : this.crafters ) + for( final Object c : this.crafters ) { if( c instanceof EntityPlayer ) { @@ -140,7 +140,7 @@ public class ContainerNetworkStatus extends AEBaseContainer } } } - catch( IOException e ) + catch( final IOException e ) { // :P } diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java index 7823c4e4..8c801c27 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java @@ -37,7 +37,7 @@ public class ContainerNetworkTool extends AEBaseContainer @GuiSync( 1 ) public boolean facadeMode; - public ContainerNetworkTool( InventoryPlayer ip, INetworkTool te ) + public ContainerNetworkTool( final InventoryPlayer ip, final INetworkTool te ) { super( ip, null, null ); this.toolInv = te; @@ -57,7 +57,7 @@ public class ContainerNetworkTool extends AEBaseContainer public void toggleFacadeMode() { - NBTTagCompound data = Platform.openNbtData( this.toolInv.getItemStack() ); + final NBTTagCompound data = Platform.openNbtData( this.toolInv.getItemStack() ); data.setBoolean( "hideFacades", !data.getBoolean( "hideFacades" ) ); this.detectAndSendChanges(); } @@ -65,7 +65,7 @@ public class ContainerNetworkTool extends AEBaseContainer @Override public void detectAndSendChanges() { - ItemStack currentItem = this.getPlayerInv().getCurrentItem(); + final ItemStack currentItem = this.getPlayerInv().getCurrentItem(); if( currentItem != this.toolInv.getItemStack() ) { @@ -88,7 +88,7 @@ public class ContainerNetworkTool extends AEBaseContainer if( this.isContainerValid ) { - NBTTagCompound data = Platform.openNbtData( currentItem ); + final NBTTagCompound data = Platform.openNbtData( currentItem ); this.facadeMode = data.getBoolean( "hideFacades" ); } diff --git a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java index 773f2a52..b6c26afa 100644 --- a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java @@ -80,13 +80,13 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA @GuiSync( 97 ) public boolean craftingMode = true; - public ContainerPatternTerm( InventoryPlayer ip, ITerminalHost monitorable ) + public ContainerPatternTerm( final InventoryPlayer ip, final ITerminalHost monitorable ) { super( ip, monitorable, false ); this.ct = (PartPatternTerminal) monitorable; - IInventory patternInv = this.ct.getInventoryByName( "pattern" ); - IInventory output = this.ct.getInventoryByName( "output" ); + final IInventory patternInv = this.ct.getInventoryByName( "pattern" ); + final IInventory output = this.ct.getInventoryByName( "output" ); this.crafting = this.ct.getInventoryByName( "crafting" ); for( int y = 0; y < 3; y++ ) @@ -139,14 +139,14 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public void putStackInSlot( int par1, ItemStack par2ItemStack ) + public void putStackInSlot( final int par1, final ItemStack par2ItemStack ) { super.putStackInSlot( par1, par2ItemStack ); this.getAndUpdateOutput(); } @Override - public void putStacksInSlots( ItemStack[] par1ArrayOfItemStack ) + public void putStacksInSlots( final ItemStack[] par1ArrayOfItemStack ) { super.putStacksInSlots( par1ArrayOfItemStack ); this.getAndUpdateOutput(); @@ -154,13 +154,13 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA public ItemStack getAndUpdateOutput() { - InventoryCrafting ic = new InventoryCrafting( this, 3, 3 ); + final InventoryCrafting ic = new InventoryCrafting( this, 3, 3 ); for( int x = 0; x < ic.getSizeInventory(); x++ ) { ic.setInventorySlotContents( x, this.crafting.getStackInSlot( x ) ); } - ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj ); + final ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj ); this.cOut.setInventorySlotContents( 0, is ); return is; } @@ -172,7 +172,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { } @@ -181,8 +181,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { ItemStack output = this.patternSlotOUT.getStack(); - ItemStack[] in = this.getInputs(); - ItemStack[] out = this.getOutputs(); + final ItemStack[] in = this.getInputs(); + final ItemStack[] out = this.getOutputs(); // if there is no input, this would be silly. if( in == null || out == null ) @@ -211,7 +211,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } // add a new encoded pattern. - for( ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern().maybeStack( 1 ).asSet() ) + for( final ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern().maybeStack( 1 ).asSet() ) { output = encodedPatternStack; this.patternSlotOUT.putStack( output ); @@ -219,17 +219,17 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } // encode the slot. - NBTTagCompound encodedValue = new NBTTagCompound(); + final NBTTagCompound encodedValue = new NBTTagCompound(); - NBTTagList tagIn = new NBTTagList(); - NBTTagList tagOut = new NBTTagList(); + final NBTTagList tagIn = new NBTTagList(); + final NBTTagList tagOut = new NBTTagList(); - for( ItemStack i : in ) + for( final ItemStack i : in ) { tagIn.appendTag( this.createItemTag( i ) ); } - for( ItemStack i : out ) + for( final ItemStack i : out ) { tagOut.appendTag( this.createItemTag( i ) ); } @@ -243,7 +243,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA private ItemStack[] getInputs() { - ItemStack[] input = new ItemStack[9]; + final ItemStack[] input = new ItemStack[9]; boolean hasValue = false; for( int x = 0; x < this.craftingSlots.length; x++ ) @@ -267,7 +267,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { if( this.craftingMode ) { - ItemStack out = this.getAndUpdateOutput(); + final ItemStack out = this.getAndUpdateOutput(); if( out != null && out.stackSize > 0 ) { return new ItemStack[] { out }; @@ -275,12 +275,12 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } else { - List list = new ArrayList( 3 ); + final List list = new ArrayList( 3 ); boolean hasValue = false; - for( OptionalSlotFake outputSlot : this.outputSlots ) + for( final OptionalSlotFake outputSlot : this.outputSlots ) { - ItemStack out = outputSlot.getStack(); + final ItemStack out = outputSlot.getStack(); if( out != null && out.stackSize > 0 ) { list.add( out ); @@ -297,7 +297,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA return null; } - private boolean isPattern( ItemStack output ) + private boolean isPattern( final ItemStack output ) { if( output == null ) { @@ -312,9 +312,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA return isPattern; } - private NBTBase createItemTag( ItemStack i ) + private NBTBase createItemTag( final ItemStack i ) { - NBTTagCompound c = new NBTTagCompound(); + final NBTTagCompound c = new NBTTagCompound(); if( i != null ) { @@ -325,7 +325,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { if( idx == 1 ) { @@ -341,14 +341,14 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } } - public void craftOrGetItem( PacketPatternSlot packetPatternSlot ) + public void craftOrGetItem( final PacketPatternSlot packetPatternSlot ) { if( packetPatternSlot.slotItem != null && this.cellInv != null ) { - IAEItemStack out = packetPatternSlot.slotItem.copy(); + final IAEItemStack out = packetPatternSlot.slotItem.copy(); InventoryAdaptor inv = new AdaptorPlayerHand( this.getPlayerInv().player ); - InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( this.getPlayerInv().player, EnumFacing.UP ); + final InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( this.getPlayerInv().player, EnumFacing.UP ); if( packetPatternSlot.shift ) { inv = playerInv; @@ -359,8 +359,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA return; } - IAEItemStack extracted = Platform.poweredExtraction( this.powerSrc, this.cellInv, out, this.mySrc ); - EntityPlayer p = this.getPlayerInv().player; + final IAEItemStack extracted = Platform.poweredExtraction( this.powerSrc, this.cellInv, out, this.mySrc ); + final EntityPlayer p = this.getPlayerInv().player; if( extracted != null ) { @@ -373,44 +373,44 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA return; } - InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); - InventoryCrafting real = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting real = new InventoryCrafting( new ContainerNull(), 3, 3 ); for( int x = 0; x < 9; x++ ) { ic.setInventorySlotContents( x, packetPatternSlot.pattern[x] == null ? null : packetPatternSlot.pattern[x].getItemStack() ); } - IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj ); + final IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj ); if( r == null ) { return; } - IMEMonitor storage = this.ct.getItemInventory(); - IItemList all = storage.getStorageList(); + final IMEMonitor storage = this.ct.getItemInventory(); + final IItemList all = storage.getStorageList(); - ItemStack is = r.getCraftingResult( ic ); + final ItemStack is = r.getCraftingResult( ic ); for( int x = 0; x < ic.getSizeInventory(); x++ ) { if( ic.getStackInSlot( x ) != null ) { - ItemStack pulled = Platform.extractItemsByRecipe( this.powerSrc, this.mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, Actionable.MODULATE, ItemViewCell.createFilter( this.getViewCells() ) ); + final ItemStack pulled = Platform.extractItemsByRecipe( this.powerSrc, this.mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, Actionable.MODULATE, ItemViewCell.createFilter( this.getViewCells() ) ); real.setInventorySlotContents( x, pulled ); } } - IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj ); + final IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj ); if( rr == r && Platform.isSameItemPrecise( rr.getCraftingResult( real ), is ) ) { - SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 ); + final SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 ); sc.onPickupFromSlot( p, is ); for( int x = 0; x < real.getSizeInventory(); x++ ) { - ItemStack failed = playerInv.addItems( real.getStackInSlot( x ) ); + final ItemStack failed = playerInv.addItems( real.getStackInSlot( x ) ); if( failed != null ) { p.dropPlayerItemWithRandomChoice( failed, false ); @@ -428,7 +428,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { for( int x = 0; x < real.getSizeInventory(); x++ ) { - ItemStack failed = real.getStackInSlot( x ); + final ItemStack failed = real.getStackInSlot( x ); if( failed != null ) { this.cellInv.injectItems( AEItemStack.create( failed ), Actionable.MODULATE, new MachineSource( this.ct ) ); @@ -453,7 +453,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { super.onUpdate( field, oldValue, newValue ); @@ -465,19 +465,19 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public void onSlotChange( Slot s ) + public void onSlotChange( final Slot s ) { if( s == this.patternSlotOUT && Platform.isServer() ) { - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { - ICrafting icrafting = (ICrafting) crafter; + final ICrafting icrafting = (ICrafting) crafter; - for( Object g : this.inventorySlots ) + for( final Object g : this.inventorySlots ) { if( g instanceof OptionalSlotFake || g instanceof SlotFakeCraftingMatrix ) { - Slot sri = (Slot) g; + final Slot sri = (Slot) g; icrafting.sendSlotContents( this, sri.slotNumber, sri.getStack() ); } } @@ -489,12 +489,12 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA public void clear() { - for( Slot s : this.craftingSlots ) + for( final Slot s : this.craftingSlots ) { s.putStack( null ); } - for( Slot s : this.outputSlots ) + for( final Slot s : this.outputSlots ) { s.putStack( null ); } @@ -504,7 +504,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "player" ) ) { diff --git a/src/main/java/appeng/container/implementations/ContainerPriority.java b/src/main/java/appeng/container/implementations/ContainerPriority.java index 323f5c67..db2320bb 100644 --- a/src/main/java/appeng/container/implementations/ContainerPriority.java +++ b/src/main/java/appeng/container/implementations/ContainerPriority.java @@ -43,20 +43,20 @@ public class ContainerPriority extends AEBaseContainer @GuiSync( 2 ) public long PriorityValue = -1; - public ContainerPriority( InventoryPlayer ip, IPriorityHost te ) + public ContainerPriority( final InventoryPlayer ip, final IPriorityHost te ) { super( ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) ); this.priHost = te; } @SideOnly( Side.CLIENT ) - public void setTextField( GuiTextField level ) + public void setTextField( final GuiTextField level ) { this.textField = level; this.textField.setText( String.valueOf( this.PriorityValue ) ); } - public void setPriority( int newValue, EntityPlayer player ) + public void setPriority( final int newValue, final EntityPlayer player ) { this.priHost.setPriority( newValue ); this.PriorityValue = newValue; @@ -75,7 +75,7 @@ public class ContainerPriority extends AEBaseContainer } @Override - public void onUpdate( String field, Object oldValue, Object newValue ) + public void onUpdate( final String field, final Object oldValue, final Object newValue ) { if( field.equals( "PriorityValue" ) ) { diff --git a/src/main/java/appeng/container/implementations/ContainerQNB.java b/src/main/java/appeng/container/implementations/ContainerQNB.java index a5b6aa69..1ea00e24 100644 --- a/src/main/java/appeng/container/implementations/ContainerQNB.java +++ b/src/main/java/appeng/container/implementations/ContainerQNB.java @@ -30,7 +30,7 @@ public class ContainerQNB extends AEBaseContainer final TileQuantumBridge quantumBridge; - public ContainerQNB( InventoryPlayer ip, TileQuantumBridge quantumBridge ) + public ContainerQNB( final InventoryPlayer ip, final TileQuantumBridge quantumBridge ) { super( ip, quantumBridge, null ); this.quantumBridge = quantumBridge; diff --git a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java index b7c09670..24bda1ba 100644 --- a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java +++ b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java @@ -48,7 +48,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn final QuartzKnifeOutput output; String myName = ""; - public ContainerQuartzKnife( InventoryPlayer ip, QuartzKnifeObj te ) + public ContainerQuartzKnife( final InventoryPlayer ip, final QuartzKnifeObj te ) { super( ip, null, null ); this.toolInv = te; @@ -61,7 +61,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn this.bindPlayerInventory( ip, 0, 184 - /* height of player inventory */82 ); } - public void setName( String value ) + public void setName( final String value ) { this.myName = value; } @@ -69,7 +69,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn @Override public void detectAndSendChanges() { - ItemStack currentItem = this.getPlayerInv().getCurrentItem(); + final ItemStack currentItem = this.getPlayerInv().getCurrentItem(); if( currentItem != this.toolInv.getItemStack() ) { @@ -94,7 +94,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public void onContainerClosed( EntityPlayer par1EntityPlayer ) + public void onContainerClosed( final EntityPlayer par1EntityPlayer ) { if( this.inSlot.getStackInSlot( 0 ) != null ) { @@ -109,7 +109,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { } @@ -121,9 +121,9 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { - ItemStack input = this.inSlot.getStackInSlot( 0 ); + final ItemStack input = this.inSlot.getStackInSlot( 0 ); if( input == null ) { return null; @@ -133,7 +133,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn { if( this.myName.length() > 0 ) { - for( ItemStack namePressStack : AEApi.instance().definitions().materials().namePress().maybeStack( 1 ).asSet() ) + for( final ItemStack namePressStack : AEApi.instance().definitions().materials().namePress().maybeStack( 1 ).asSet() ) { final NBTTagCompound compound = Platform.openNbtData( namePressStack ); compound.setString( "InscribeName", this.myName ); @@ -147,9 +147,9 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public ItemStack decrStackSize( int var1, int var2 ) + public ItemStack decrStackSize( final int var1, final int var2 ) { - ItemStack is = this.getStackInSlot( 0 ); + final ItemStack is = this.getStackInSlot( 0 ); if( is != null ) { if( this.makePlate() ) @@ -164,7 +164,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn { if( this.inSlot.decrStackSize( 0, 1 ) != null ) { - ItemStack item = this.toolInv.getItemStack(); + final ItemStack item = this.toolInv.getItemStack(); item.damageItem( 1, this.getPlayerInv().player ); if( item.stackSize == 0 ) @@ -179,13 +179,13 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return null; } @Override - public void setInventorySlotContents( int var1, ItemStack var2 ) + public void setInventorySlotContents( final int var1, final ItemStack var2 ) { if( var2 == null && Platform.isServer() ) { @@ -218,27 +218,27 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { 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 var1, ItemStack var2 ) + public boolean isItemValidForSlot( final int var1, final ItemStack var2 ) { return false; } @@ -251,15 +251,15 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn @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 ) { } diff --git a/src/main/java/appeng/container/implementations/ContainerSecurity.java b/src/main/java/appeng/container/implementations/ContainerSecurity.java index e17485ae..ac0c0740 100644 --- a/src/main/java/appeng/container/implementations/ContainerSecurity.java +++ b/src/main/java/appeng/container/implementations/ContainerSecurity.java @@ -53,7 +53,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE @GuiSync( 0 ) public int security = 0; - public ContainerSecurity( InventoryPlayer ip, ITerminalHost monitorable ) + public ContainerSecurity( final InventoryPlayer ip, final ITerminalHost monitorable ) { super( ip, monitorable, false ); @@ -67,16 +67,16 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE this.bindPlayerInventory( ip, 0, 0 ); } - public void toggleSetting( String value, EntityPlayer player ) + public void toggleSetting( final String value, final EntityPlayer player ) { try { - SecurityPermissions permission = SecurityPermissions.valueOf( value ); + final SecurityPermissions permission = SecurityPermissions.valueOf( value ); - ItemStack a = this.configSlot.getStack(); + final ItemStack a = this.configSlot.getStack(); if( a != null && a.getItem() instanceof IBiometricCard ) { - IBiometricCard bc = (IBiometricCard) a.getItem(); + final IBiometricCard bc = (IBiometricCard) a.getItem(); if( bc.hasPermission( a, permission ) ) { bc.removePermission( a, permission ); @@ -87,7 +87,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE } } } - catch( EnumConstantNotPresentException ex ) + catch( final EnumConstantNotPresentException ex ) { // :( } @@ -100,12 +100,12 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE this.security = 0; - ItemStack a = this.configSlot.getStack(); + final ItemStack a = this.configSlot.getStack(); if( a != null && a.getItem() instanceof IBiometricCard ) { - IBiometricCard bc = (IBiometricCard) a.getItem(); + final IBiometricCard bc = (IBiometricCard) a.getItem(); - for( SecurityPermissions sp : bc.getPermissions( a ) ) + for( final SecurityPermissions sp : bc.getPermissions( a ) ) { this.security |= ( 1 << sp.ordinal() ); } @@ -117,7 +117,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE } @Override - public void onContainerClosed( EntityPlayer player ) + public void onContainerClosed( final EntityPlayer player ) { super.onContainerClosed( player ); @@ -139,13 +139,13 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( !this.wirelessOut.getHasStack() ) { if( this.wirelessIn.getHasStack() ) { - ItemStack term = this.wirelessIn.getStack().copy(); + final ItemStack term = this.wirelessIn.getStack().copy(); INetworkEncodable networkEncodable = null; if( term.getItem() instanceof INetworkEncodable ) @@ -153,7 +153,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE networkEncodable = (INetworkEncodable) term.getItem(); } - IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless().getWirelessTerminalHandler( term ); + final IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless().getWirelessTerminalHandler( term ); if( wTermHandler != null ) { networkEncodable = wTermHandler; @@ -167,9 +167,9 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE this.wirelessOut.putStack( term ); // update the two slots in question... - for( Object crafter : this.crafters ) + for( final Object crafter : this.crafters ) { - ICrafting icrafting = (ICrafting) crafter; + final ICrafting icrafting = (ICrafting) crafter; icrafting.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() ); icrafting.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() ); } diff --git a/src/main/java/appeng/container/implementations/ContainerSkyChest.java b/src/main/java/appeng/container/implementations/ContainerSkyChest.java index 2da37e43..846427d0 100644 --- a/src/main/java/appeng/container/implementations/ContainerSkyChest.java +++ b/src/main/java/appeng/container/implementations/ContainerSkyChest.java @@ -33,7 +33,7 @@ public class ContainerSkyChest extends AEBaseContainer final TileSkyChest chest; - public ContainerSkyChest( InventoryPlayer ip, TileSkyChest chest ) + public ContainerSkyChest( final InventoryPlayer ip, final TileSkyChest chest ) { super( ip, chest, null ); this.chest = chest; @@ -52,7 +52,7 @@ public class ContainerSkyChest extends AEBaseContainer } @Override - public void onContainerClosed( EntityPlayer par1EntityPlayer ) + public void onContainerClosed( final EntityPlayer par1EntityPlayer ) { super.onContainerClosed( par1EntityPlayer ); this.chest.closeInventory(par1EntityPlayer); diff --git a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java index d7f40147..60c0a707 100644 --- a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java @@ -48,7 +48,7 @@ public class ContainerSpatialIOPort extends AEBaseContainer IGrid network; int delay = 40; - public ContainerSpatialIOPort( InventoryPlayer ip, TileSpatialIOPort spatialIOPort ) + public ContainerSpatialIOPort( final InventoryPlayer ip, final TileSpatialIOPort spatialIOPort ) { super( ip, spatialIOPort, null ); this.spatialIOPort = spatialIOPort; @@ -76,8 +76,8 @@ public class ContainerSpatialIOPort extends AEBaseContainer { this.delay = 0; - IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); - ISpatialCache sc = this.network.getCache( ISpatialCache.class ); + final IEnergyGrid eg = this.network.getCache( IEnergyGrid.class ); + final ISpatialCache sc = this.network.getCache( ISpatialCache.class ); if( eg != null ) { this.currentPower = (long) ( 100.0 * eg.getStoredPower() ); diff --git a/src/main/java/appeng/container/implementations/ContainerStorageBus.java b/src/main/java/appeng/container/implementations/ContainerStorageBus.java index d85850ba..59f722fc 100644 --- a/src/main/java/appeng/container/implementations/ContainerStorageBus.java +++ b/src/main/java/appeng/container/implementations/ContainerStorageBus.java @@ -54,7 +54,7 @@ public class ContainerStorageBus extends ContainerUpgradeable @GuiSync( 4 ) public StorageFilter storageFilter = StorageFilter.EXTRACTABLE_ONLY; - public ContainerStorageBus( InventoryPlayer ip, PartStorageBus te ) + public ContainerStorageBus( final InventoryPlayer ip, final PartStorageBus te ) { super( ip, te ); this.storageBus = te; @@ -69,10 +69,10 @@ public class ContainerStorageBus extends ContainerUpgradeable @Override protected void setupConfig() { - int xo = 8; - int yo = 23 + 6; + final int xo = 8; + final int yo = 23 + 6; - IInventory config = this.upgradeable.getInventoryByName( "config" ); + final IInventory config = this.upgradeable.getInventoryByName( "config" ); for( int y = 0; y < 7; y++ ) { for( int x = 0; x < 9; x++ ) @@ -88,7 +88,7 @@ public class ContainerStorageBus extends ContainerUpgradeable } } - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() ); this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() ); @@ -124,16 +124,16 @@ public class ContainerStorageBus extends ContainerUpgradeable } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { - int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); + final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); return upgrades > idx; } public void clear() { - IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); for( int x = 0; x < inv.getSizeInventory(); x++ ) { inv.setInventorySlotContents( x, null ); @@ -143,14 +143,14 @@ public class ContainerStorageBus extends ContainerUpgradeable public void partition() { - IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); - IMEInventory cellInv = this.storageBus.getInternalHandler(); + final IMEInventory cellInv = this.storageBus.getInternalHandler(); Iterator i = new NullIterator(); if( cellInv != null ) { - IItemList list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() ); + final IItemList list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() ); i = list.iterator(); } @@ -158,7 +158,7 @@ public class ContainerStorageBus extends ContainerUpgradeable { if( i.hasNext() && this.isSlotEnabled( ( x / 9 ) - 2 ) ) { - ItemStack g = i.next().getItemStack(); + final ItemStack g = i.next().getItemStack(); g.stackSize = 1; inv.setInventorySlotContents( x, g ); } diff --git a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java index d56ebb07..58b03482 100644 --- a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java +++ b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java @@ -64,7 +64,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl int tbSlot; NetworkToolViewer tbInventory; - public ContainerUpgradeable( InventoryPlayer ip, IUpgradeableHost te ) + public ContainerUpgradeable( final InventoryPlayer ip, final IUpgradeableHost te ) { super( ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) ); this.upgradeable = te; @@ -76,7 +76,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl if( te instanceof TileEntity ) { - TileEntity myTile = (TileEntity) te; + final TileEntity myTile = (TileEntity) te; w = myTile.getWorld(); xCoord = myTile.getPos().getX(); yCoord = myTile.getPos().getY(); @@ -85,17 +85,17 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl if( te instanceof IPart ) { - TileEntity mk = te.getTile(); + final TileEntity mk = te.getTile(); w = mk.getWorld(); xCoord = mk.getPos().getX(); yCoord = mk.getPos().getY(); zCoord = mk.getPos().getZ(); } - IInventory pi = this.getPlayerInv(); + final IInventory pi = this.getPlayerInv(); for( int x = 0; x < pi.getSizeInventory(); x++ ) { - ItemStack pii = pi.getStackInSlot( x ); + final ItemStack pii = pi.getStackInSlot( x ); if( pii != null && pii.getItem() instanceof ToolNetworkTool ) { this.lockPlayerInventorySlot( x ); @@ -135,9 +135,9 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl { this.setupUpgrades(); - IInventory inv = this.upgradeable.getInventoryByName( "config" ); - int y = 40; - int x = 80; + final IInventory inv = this.upgradeable.getInventoryByName( "config" ); + final int y = 40; + final int x = 80; this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); if( this.supportCapacity() ) @@ -156,7 +156,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl protected void setupUpgrades() { - IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); + final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); if( this.availableUpgrades() > 0 ) { this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); @@ -192,17 +192,17 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl if( Platform.isServer() ) { - IConfigManager cm = this.upgradeable.getConfigManager(); + final IConfigManager cm = this.upgradeable.getConfigManager(); this.loadSettingsFromHost( cm ); } this.checkToolbox(); - for( Object o : this.inventorySlots ) + for( final Object o : this.inventorySlots ) { if( o instanceof OptionalSlotFake ) { - OptionalSlotFake fs = (OptionalSlotFake) o; + final OptionalSlotFake fs = (OptionalSlotFake) o; if( !fs.isEnabled() && fs.getDisplayStack() != null ) { fs.clearStack(); @@ -213,7 +213,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl this.standardDetectAndSendChanges(); } - protected void loadSettingsFromHost( IConfigManager cm ) + protected void loadSettingsFromHost( final IConfigManager cm ) { this.fzMode = (FuzzyMode) cm.getSetting( Settings.FUZZY_MODE ); this.rsMode = (RedstoneMode) cm.getSetting( Settings.REDSTONE_CONTROLLED ); @@ -228,7 +228,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl { if( this.hasToolbox() ) { - ItemStack currentItem = this.getPlayerInv().getStackInSlot( this.tbSlot ); + final ItemStack currentItem = this.getPlayerInv().getStackInSlot( this.tbSlot ); if( currentItem != this.tbInventory.getItemStack() ) { @@ -257,9 +257,9 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl } @Override - public boolean isSlotEnabled( int idx ) + public boolean isSlotEnabled( final int idx ) { - int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); + final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); if( idx == 1 && upgrades > 0 ) { diff --git a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java index 133951b4..70809c57 100644 --- a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java +++ b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java @@ -39,7 +39,7 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr @GuiSync( 1 ) public int burnSpeed = 100; - public ContainerVibrationChamber( InventoryPlayer ip, TileVibrationChamber vibrationChamber ) + public ContainerVibrationChamber( final InventoryPlayer ip, final TileVibrationChamber vibrationChamber ) { super( ip, vibrationChamber, null ); this.vibrationChamber = vibrationChamber; diff --git a/src/main/java/appeng/container/implementations/ContainerWireless.java b/src/main/java/appeng/container/implementations/ContainerWireless.java index afc721fd..48e5c04d 100644 --- a/src/main/java/appeng/container/implementations/ContainerWireless.java +++ b/src/main/java/appeng/container/implementations/ContainerWireless.java @@ -37,7 +37,7 @@ public class ContainerWireless extends AEBaseContainer @GuiSync( 2 ) public long drain = 0; - public ContainerWireless( InventoryPlayer ip, TileWireless te ) + public ContainerWireless( final InventoryPlayer ip, final TileWireless te ) { super( ip, te, null ); this.wirelessTerminal = te; @@ -50,7 +50,7 @@ public class ContainerWireless extends AEBaseContainer @Override public void detectAndSendChanges() { - int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize; + final int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize; this.range = (long) ( 10 * AEConfig.instance.wireless_getMaxRange( boosters ) ); this.drain = (long) ( 100 * AEConfig.instance.wireless_getPowerDrain( boosters ) ); diff --git a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java index 086d8c7d..5d6d53a6 100644 --- a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java @@ -31,7 +31,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell final WirelessTerminalGuiObject wirelessTerminalGUIObject; - public ContainerWirelessTerm( InventoryPlayer ip, WirelessTerminalGuiObject gui ) + public ContainerWirelessTerm( final InventoryPlayer ip, final WirelessTerminalGuiObject gui ) { super( ip, gui ); this.wirelessTerminalGUIObject = gui; diff --git a/src/main/java/appeng/container/implementations/CraftingCPURecord.java b/src/main/java/appeng/container/implementations/CraftingCPURecord.java index b75325a2..adcb1a95 100644 --- a/src/main/java/appeng/container/implementations/CraftingCPURecord.java +++ b/src/main/java/appeng/container/implementations/CraftingCPURecord.java @@ -33,7 +33,7 @@ public class CraftingCPURecord implements Comparable final long size; final int processors; - public CraftingCPURecord( long size, int coProcessors, ICraftingCPU server ) + public CraftingCPURecord( final long size, final int coProcessors, final ICraftingCPU server ) { this.size = size; this.processors = coProcessors; @@ -42,9 +42,9 @@ public class CraftingCPURecord implements Comparable } @Override - public int compareTo( @Nonnull CraftingCPURecord o ) + public int compareTo( @Nonnull final CraftingCPURecord o ) { - int a = ItemSorters.compareLong( o.processors, this.processors ); + final int a = ItemSorters.compareLong( o.processors, this.processors ); if( a != 0 ) { return a; diff --git a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java index 493b15f4..3013a14b 100644 --- a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java +++ b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java @@ -52,7 +52,7 @@ public class AppEngCraftingSlot extends AppEngSlot */ private int amountCrafted; - public AppEngCraftingSlot( EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6 ) + public AppEngCraftingSlot( final EntityPlayer par1EntityPlayer, final IInventory par2IInventory, final IInventory par3IInventory, final int par4, final int par5, final int par6 ) { super( par3IInventory, par4, par5, par6 ); this.thePlayer = par1EntityPlayer; @@ -63,7 +63,7 @@ public class AppEngCraftingSlot extends AppEngSlot * Check if the stack is a valid item for this slot. Always true beside for the armor slots. */ @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @@ -73,7 +73,7 @@ public class AppEngCraftingSlot extends AppEngSlot * internal count then calls onCrafting(item). */ @Override - protected void onCrafting( ItemStack par1ItemStack, int par2 ) + protected void onCrafting( final ItemStack par1ItemStack, final int par2 ) { this.amountCrafted += par2; this.onCrafting( par1ItemStack ); @@ -83,7 +83,7 @@ public class AppEngCraftingSlot extends AppEngSlot * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. */ @Override - protected void onCrafting( ItemStack par1ItemStack ) + protected void onCrafting( final ItemStack par1ItemStack ) { par1ItemStack.onCrafting( this.thePlayer.worldObj, this.thePlayer, this.amountCrafted ); this.amountCrafted = 0; @@ -140,17 +140,17 @@ public class AppEngCraftingSlot extends AppEngSlot } @Override - public void onPickupFromSlot( EntityPlayer playerIn, ItemStack stack ) + public void onPickupFromSlot( final EntityPlayer playerIn, final ItemStack stack ) { net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix); this.onCrafting(stack); net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn); - InventoryCrafting ic = new InventoryCrafting( this.myContainer, 3, 3 ); + final InventoryCrafting ic = new InventoryCrafting( this.myContainer, 3, 3 ); for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ ) ic.setInventorySlotContents( x, this.craftMatrix.getStackInSlot( x ) ); - ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(ic, playerIn.worldObj); + final ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(ic, playerIn.worldObj); for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ ) craftMatrix.setInventorySlotContents( x, ic.getStackInSlot( x ) ); @@ -159,8 +159,8 @@ public class AppEngCraftingSlot extends AppEngSlot for (int i = 0; i < aitemstack.length; ++i) { - ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); - ItemStack itemstack2 = aitemstack[i]; + final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); + final ItemStack itemstack2 = aitemstack[i]; if (itemstack1 != null) { @@ -186,7 +186,7 @@ public class AppEngCraftingSlot extends AppEngSlot * stack. */ @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { if( this.getHasStack() ) { diff --git a/src/main/java/appeng/container/slot/AppEngSlot.java b/src/main/java/appeng/container/slot/AppEngSlot.java index 26ea484f..dbc100bb 100644 --- a/src/main/java/appeng/container/slot/AppEngSlot.java +++ b/src/main/java/appeng/container/slot/AppEngSlot.java @@ -39,7 +39,7 @@ public class AppEngSlot extends Slot public hasCalculatedValidness isValid; public boolean isDisplay = false; - public AppEngSlot( IInventory inv, int idx, int x, int y ) + public AppEngSlot( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); this.defX = x; @@ -70,7 +70,7 @@ public class AppEngSlot extends Slot } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { if( this.isEnabled() ) { @@ -101,7 +101,7 @@ public class AppEngSlot extends Slot } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { if( this.isEnabled() ) { @@ -130,7 +130,7 @@ public class AppEngSlot extends Slot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { if( this.isEnabled() ) { diff --git a/src/main/java/appeng/container/slot/NullSlot.java b/src/main/java/appeng/container/slot/NullSlot.java index d46f3b8b..3ab30bd7 100644 --- a/src/main/java/appeng/container/slot/NullSlot.java +++ b/src/main/java/appeng/container/slot/NullSlot.java @@ -34,19 +34,19 @@ public class NullSlot extends Slot } @Override - public void onSlotChange( ItemStack par1ItemStack, ItemStack par2ItemStack ) + public void onSlotChange( final ItemStack par1ItemStack, final ItemStack par2ItemStack ) { } @Override - public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack ) + public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack ) { } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @@ -58,7 +58,7 @@ public class NullSlot extends Slot } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { } @@ -76,19 +76,19 @@ public class NullSlot extends Slot } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { return null; } @Override - public boolean isHere( IInventory inv, int slotIn ) + public boolean isHere( final IInventory inv, final int slotIn ) { return false; } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } diff --git a/src/main/java/appeng/container/slot/OptionalSlotFake.java b/src/main/java/appeng/container/slot/OptionalSlotFake.java index 47a509f7..9bbc8a5d 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotFake.java +++ b/src/main/java/appeng/container/slot/OptionalSlotFake.java @@ -33,7 +33,7 @@ public class OptionalSlotFake extends SlotFake final IOptionalSlotHost host; public boolean renderDisabled = true; - public OptionalSlotFake( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum ) + public OptionalSlotFake( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum ) { super( inv, idx, x + offX * 18, y + offY * 18 ); this.srcX = x; diff --git a/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java b/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java index 5dbaa0a0..666d9b60 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java +++ b/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java @@ -26,7 +26,7 @@ import net.minecraft.item.ItemStack; public class OptionalSlotFakeTypeOnly extends OptionalSlotFake { - public OptionalSlotFakeTypeOnly( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum ) + public OptionalSlotFakeTypeOnly( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum ) { super( inv, containerBus, idx, x, y, offX, offY, groupNum ); } diff --git a/src/main/java/appeng/container/slot/OptionalSlotNormal.java b/src/main/java/appeng/container/slot/OptionalSlotNormal.java index eae5b639..7edd1dc8 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotNormal.java +++ b/src/main/java/appeng/container/slot/OptionalSlotNormal.java @@ -28,7 +28,7 @@ public class OptionalSlotNormal extends AppEngSlot final int groupNum; final IOptionalSlotHost host; - public OptionalSlotNormal( IInventory inv, IOptionalSlotHost containerBus, int slot, int xPos, int yPos, int groupNum ) + public OptionalSlotNormal( final IInventory inv, final IOptionalSlotHost containerBus, final int slot, final int xPos, final int yPos, final int groupNum ) { super( inv, slot, xPos, yPos ); this.groupNum = groupNum; diff --git a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java index 45c194d0..175b7ed5 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java @@ -29,7 +29,7 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput final int groupNum; final IOptionalSlotHost host; - public OptionalSlotRestrictedInput( PlacableItemType valid, IInventory i, IOptionalSlotHost host, int slotIndex, int x, int y, int grpNum, InventoryPlayer invPlayer ) + public OptionalSlotRestrictedInput( final PlacableItemType valid, final IInventory i, final IOptionalSlotHost host, final int slotIndex, final int x, final int y, final int grpNum, final InventoryPlayer invPlayer ) { super( valid, i, slotIndex, x, y, invPlayer ); this.groupNum = grpNum; diff --git a/src/main/java/appeng/container/slot/QuartzKnifeOutput.java b/src/main/java/appeng/container/slot/QuartzKnifeOutput.java index 8e793852..319d479a 100644 --- a/src/main/java/appeng/container/slot/QuartzKnifeOutput.java +++ b/src/main/java/appeng/container/slot/QuartzKnifeOutput.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class QuartzKnifeOutput extends SlotOutput { - public QuartzKnifeOutput( IInventory a, int b, int c, int d, int i ) + public QuartzKnifeOutput( final IInventory a, final int b, final int c, final int d, final int i ) { super( a, b, c, d, i ); } diff --git a/src/main/java/appeng/container/slot/SlotCraftingMatrix.java b/src/main/java/appeng/container/slot/SlotCraftingMatrix.java index de23c969..923a0874 100644 --- a/src/main/java/appeng/container/slot/SlotCraftingMatrix.java +++ b/src/main/java/appeng/container/slot/SlotCraftingMatrix.java @@ -29,7 +29,7 @@ public class SlotCraftingMatrix extends AppEngSlot final Container c; - public SlotCraftingMatrix( Container c, IInventory par1iInventory, int par2, int par3, int par4 ) + public SlotCraftingMatrix( final Container c, final IInventory par1iInventory, final int par2, final int par3, final int par4 ) { super( par1iInventory, par2, par3, par4 ); this.c = c; @@ -43,7 +43,7 @@ public class SlotCraftingMatrix extends AppEngSlot } @Override - public void putStack( ItemStack par1ItemStack ) + public void putStack( final ItemStack par1ItemStack ) { super.putStack( par1ItemStack ); this.c.onCraftMatrixChanged( this.inventory ); @@ -56,9 +56,9 @@ public class SlotCraftingMatrix extends AppEngSlot } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { - ItemStack is = super.decrStackSize( par1 ); + final ItemStack is = super.decrStackSize( par1 ); this.c.onCraftMatrixChanged( this.inventory ); return is; } diff --git a/src/main/java/appeng/container/slot/SlotCraftingTerm.java b/src/main/java/appeng/container/slot/SlotCraftingTerm.java index fccaa401..f60a3ed9 100644 --- a/src/main/java/appeng/container/slot/SlotCraftingTerm.java +++ b/src/main/java/appeng/container/slot/SlotCraftingTerm.java @@ -57,7 +57,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot private final IStorageMonitorable storage; private final IContainerCraftingPacket container; - public SlotCraftingTerm( EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix, IInventory secondMatrix, IInventory output, int x, int y, IContainerCraftingPacket ccp ) + public SlotCraftingTerm( final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, final IInventory output, final int x, final int y, final IContainerCraftingPacket ccp ) { super( player, cMatrix, output, 0, x, y ); this.energySrc = energySrc; @@ -74,17 +74,17 @@ public class SlotCraftingTerm extends AppEngCraftingSlot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } @Override - public void onPickupFromSlot( EntityPlayer p, ItemStack is ) + public void onPickupFromSlot( final EntityPlayer p, final ItemStack is ) { } - public void doClick( InventoryAction action, EntityPlayer who ) + public void doClick( final InventoryAction action, final EntityPlayer who ) { if( this.getStack() == null ) { @@ -95,8 +95,8 @@ public class SlotCraftingTerm extends AppEngCraftingSlot return; } - IMEMonitor inv = this.storage.getItemInventory(); - int howManyPerCraft = this.getStack().stackSize; + final IMEMonitor inv = this.storage.getItemInventory(); + final int howManyPerCraft = this.getStack().stackSize; int maxTimesToCraft = 0; InventoryAdaptor ia = null; @@ -124,7 +124,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot return; } - ItemStack rs = Platform.cloneItemStack( this.getStack() ); + final ItemStack rs = Platform.cloneItemStack( this.getStack() ); if( rs == null ) { return; @@ -134,11 +134,11 @@ public class SlotCraftingTerm extends AppEngCraftingSlot { if( ia.simulateAdd( rs ) == null ) { - IItemList all = inv.getStorageList(); - ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) ); + final IItemList all = inv.getStorageList(); + final ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) ); if( extra != null ) { - List drops = new ArrayList(); + final List drops = new ArrayList(); drops.add( extra ); Platform.spawnDrops( who.worldObj, new BlockPos( (int) who.posX, (int) who.posY, (int) who.posZ ), drops ); return; @@ -147,40 +147,40 @@ public class SlotCraftingTerm extends AppEngCraftingSlot } } - protected int capCraftingAttempts( int maxTimesToCraft ) + protected int capCraftingAttempts( final int maxTimesToCraft ) { return maxTimesToCraft; } - public ItemStack craftItem( EntityPlayer p, ItemStack request, IMEMonitor inv, IItemList all ) + public ItemStack craftItem( final EntityPlayer p, final ItemStack request, final IMEMonitor inv, final IItemList all ) { // update crafting matrix... ItemStack is = this.getStack(); if( is != null && Platform.isSameItem( request, is ) ) { - ItemStack[] set = new ItemStack[this.pattern.getSizeInventory()]; + final ItemStack[] set = new ItemStack[this.pattern.getSizeInventory()]; // add one of each item to the items on the board... if( Platform.isServer() ) { - InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); for( int x = 0; x < 9; x++ ) { ic.setInventorySlotContents( x, this.pattern.getStackInSlot( x ) ); } - IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj ); + final IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj ); if( r == null ) { - Item target = request.getItem(); + final Item target = request.getItem(); if( target.isDamageable() && target.isRepairable() ) { boolean isBad = false; for( int x = 0; x < ic.getSizeInventory(); x++ ) { - ItemStack pis = ic.getStackInSlot( x ); + final ItemStack pis = ic.getStackInSlot( x ); if( pis == null ) { continue; @@ -232,19 +232,19 @@ public class SlotCraftingTerm extends AppEngCraftingSlot return null; } - public boolean preCraft( EntityPlayer p, IMEMonitor inv, ItemStack[] set, ItemStack result ) + public boolean preCraft( final EntityPlayer p, final IMEMonitor inv, final ItemStack[] set, final ItemStack result ) { return true; } - public void makeItem( EntityPlayer p, ItemStack is ) + public void makeItem( final EntityPlayer p, final ItemStack is ) { super.onPickupFromSlot( p, is ); } - public void postCraft( EntityPlayer p, IMEMonitor inv, ItemStack[] set, ItemStack result ) + public void postCraft( final EntityPlayer p, final IMEMonitor inv, final ItemStack[] set, final ItemStack result ) { - List drops = new ArrayList(); + final List drops = new ArrayList(); // add one of each item to the items on the board... if( Platform.isServer() ) @@ -259,7 +259,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot else if( set[x] != null ) { // eek! put it back! - IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc ); + final IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc ); if( fail != null ) { drops.add( fail.getItemStack() ); diff --git a/src/main/java/appeng/container/slot/SlotDisabled.java b/src/main/java/appeng/container/slot/SlotDisabled.java index a5121a16..f298e6e7 100644 --- a/src/main/java/appeng/container/slot/SlotDisabled.java +++ b/src/main/java/appeng/container/slot/SlotDisabled.java @@ -27,19 +27,19 @@ import net.minecraft.item.ItemStack; public class SlotDisabled extends AppEngSlot { - public SlotDisabled( IInventory par1iInventory, int slotIndex, int x, int y ) + public SlotDisabled( final IInventory par1iInventory, final int slotIndex, final int x, final int y ) { super( par1iInventory, slotIndex, x, y ); } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } diff --git a/src/main/java/appeng/container/slot/SlotFake.java b/src/main/java/appeng/container/slot/SlotFake.java index e4e3f53a..ee389b6a 100644 --- a/src/main/java/appeng/container/slot/SlotFake.java +++ b/src/main/java/appeng/container/slot/SlotFake.java @@ -29,25 +29,25 @@ public class SlotFake extends AppEngSlot final int invSlot; - public SlotFake( IInventory inv, int idx, int x, int y ) + public SlotFake( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); this.invSlot = idx; } @Override - public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack ) + public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack ) { } @Override - public ItemStack decrStackSize( int par1 ) + public ItemStack decrStackSize( final int par1 ) { return null; } @Override - public boolean isItemValid( ItemStack par1ItemStack ) + public boolean isItemValid( final ItemStack par1ItemStack ) { return false; } @@ -64,7 +64,7 @@ public class SlotFake extends AppEngSlot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } diff --git a/src/main/java/appeng/container/slot/SlotFakeBlacklist.java b/src/main/java/appeng/container/slot/SlotFakeBlacklist.java index fd4251df..b0d9ba51 100644 --- a/src/main/java/appeng/container/slot/SlotFakeBlacklist.java +++ b/src/main/java/appeng/container/slot/SlotFakeBlacklist.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotFakeBlacklist extends SlotFakeTypeOnly { - public SlotFakeBlacklist( IInventory inv, int idx, int x, int y ) + public SlotFakeBlacklist( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); } diff --git a/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java b/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java index 10691a1f..e1bf15b2 100644 --- a/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java +++ b/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotFakeCraftingMatrix extends SlotFake { - public SlotFakeCraftingMatrix( IInventory inv, int idx, int x, int y ) + public SlotFakeCraftingMatrix( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); } diff --git a/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java b/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java index 686c87a8..809da8ac 100644 --- a/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java +++ b/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java @@ -26,7 +26,7 @@ import net.minecraft.item.ItemStack; public class SlotFakeTypeOnly extends SlotFake { - public SlotFakeTypeOnly( IInventory inv, int idx, int x, int y ) + public SlotFakeTypeOnly( final IInventory inv, final int idx, final int x, final int y ) { super( inv, idx, x, y ); } diff --git a/src/main/java/appeng/container/slot/SlotInaccessible.java b/src/main/java/appeng/container/slot/SlotInaccessible.java index f7f8eedc..968e3171 100644 --- a/src/main/java/appeng/container/slot/SlotInaccessible.java +++ b/src/main/java/appeng/container/slot/SlotInaccessible.java @@ -29,13 +29,13 @@ public class SlotInaccessible extends AppEngSlot ItemStack dspStack = null; - public SlotInaccessible( IInventory i, int slotIdx, int x, int y ) + public SlotInaccessible( final IInventory i, final int slotIdx, final int x, final int y ) { super( i, slotIdx, x, y ); } @Override - public boolean isItemValid( ItemStack i ) + public boolean isItemValid( final ItemStack i ) { return false; } @@ -48,7 +48,7 @@ public class SlotInaccessible extends AppEngSlot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return false; } @@ -58,7 +58,7 @@ public class SlotInaccessible extends AppEngSlot { if( this.dspStack == null ) { - ItemStack dsp = super.getDisplayStack(); + final ItemStack dsp = super.getDisplayStack(); if( dsp != null ) { this.dspStack = dsp.copy(); diff --git a/src/main/java/appeng/container/slot/SlotInaccessibleHD.java b/src/main/java/appeng/container/slot/SlotInaccessibleHD.java index ff66547b..10d675d4 100644 --- a/src/main/java/appeng/container/slot/SlotInaccessibleHD.java +++ b/src/main/java/appeng/container/slot/SlotInaccessibleHD.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotInaccessibleHD extends SlotInaccessible { - public SlotInaccessibleHD( IInventory i, int slotIdx, int x, int y ) + public SlotInaccessibleHD( final IInventory i, final int slotIdx, final int x, final int y ) { super( i, slotIdx, x, y ); } diff --git a/src/main/java/appeng/container/slot/SlotMACPattern.java b/src/main/java/appeng/container/slot/SlotMACPattern.java index 268ff474..e6851828 100644 --- a/src/main/java/appeng/container/slot/SlotMACPattern.java +++ b/src/main/java/appeng/container/slot/SlotMACPattern.java @@ -29,14 +29,14 @@ public class SlotMACPattern extends AppEngSlot final ContainerMAC mac; - public SlotMACPattern( ContainerMAC mac, IInventory i, int slotIdx, int x, int y ) + public SlotMACPattern( final ContainerMAC mac, final IInventory i, final int slotIdx, final int x, final int y ) { super( i, slotIdx, x, y ); this.mac = mac; } @Override - public boolean isItemValid( ItemStack i ) + public boolean isItemValid( final ItemStack i ) { return this.mac.isValidItemForSlot( this.getSlotIndex(), i ); } diff --git a/src/main/java/appeng/container/slot/SlotNormal.java b/src/main/java/appeng/container/slot/SlotNormal.java index 02a26731..96e705b2 100644 --- a/src/main/java/appeng/container/slot/SlotNormal.java +++ b/src/main/java/appeng/container/slot/SlotNormal.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotNormal extends AppEngSlot { - public SlotNormal( IInventory inv, int slot, int xPos, int yPos ) + public SlotNormal( final IInventory inv, final int slot, final int xPos, final int yPos ) { super( inv, slot, xPos, yPos ); } diff --git a/src/main/java/appeng/container/slot/SlotOutput.java b/src/main/java/appeng/container/slot/SlotOutput.java index 30c0d4d1..191291f2 100644 --- a/src/main/java/appeng/container/slot/SlotOutput.java +++ b/src/main/java/appeng/container/slot/SlotOutput.java @@ -26,14 +26,14 @@ import net.minecraft.item.ItemStack; public class SlotOutput extends AppEngSlot { - public SlotOutput( IInventory a, int b, int c, int d, int i ) + public SlotOutput( final IInventory a, final int b, final int c, final int d, final int i ) { super( a, b, c, d ); this.IIcon = i; } @Override - public boolean isItemValid( ItemStack i ) + public boolean isItemValid( final ItemStack i ) { return false; } diff --git a/src/main/java/appeng/container/slot/SlotPatternOutputs.java b/src/main/java/appeng/container/slot/SlotPatternOutputs.java index 59eef686..49a85806 100644 --- a/src/main/java/appeng/container/slot/SlotPatternOutputs.java +++ b/src/main/java/appeng/container/slot/SlotPatternOutputs.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotPatternOutputs extends OptionalSlotFake { - public SlotPatternOutputs( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum ) + public SlotPatternOutputs( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum ) { super( inv, containerBus, idx, x, y, offX, offY, groupNum ); } diff --git a/src/main/java/appeng/container/slot/SlotPatternTerm.java b/src/main/java/appeng/container/slot/SlotPatternTerm.java index c85238dd..d1823eed 100644 --- a/src/main/java/appeng/container/slot/SlotPatternTerm.java +++ b/src/main/java/appeng/container/slot/SlotPatternTerm.java @@ -39,7 +39,7 @@ public class SlotPatternTerm extends SlotCraftingTerm final int groupNum; final IOptionalSlotHost host; - public SlotPatternTerm( EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix, IInventory secondMatrix, IInventory output, int x, int y, IOptionalSlotHost h, int groupNumber, IContainerCraftingPacket c ) + public SlotPatternTerm( final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, final IInventory output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber, final IContainerCraftingPacket c ) { super( player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y, c ); @@ -47,7 +47,7 @@ public class SlotPatternTerm extends SlotCraftingTerm this.groupNum = groupNumber; } - public AppEngPacket getRequest( boolean shift ) throws IOException + public AppEngPacket getRequest( final boolean shift ) throws IOException { return new PacketPatternSlot( this.pattern, AEApi.instance().storage().createItemStack( this.getStack() ), shift ); } diff --git a/src/main/java/appeng/container/slot/SlotPlayerHotBar.java b/src/main/java/appeng/container/slot/SlotPlayerHotBar.java index b56309d3..3ec5c234 100644 --- a/src/main/java/appeng/container/slot/SlotPlayerHotBar.java +++ b/src/main/java/appeng/container/slot/SlotPlayerHotBar.java @@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory; public class SlotPlayerHotBar extends AppEngSlot { - public SlotPlayerHotBar( IInventory par1iInventory, int par2, int par3, int par4 ) + public SlotPlayerHotBar( final IInventory par1iInventory, final int par2, final int par3, final int par4 ) { super( par1iInventory, par2, par3, par4 ); this.isPlayerSide = true; diff --git a/src/main/java/appeng/container/slot/SlotPlayerInv.java b/src/main/java/appeng/container/slot/SlotPlayerInv.java index 5fd36621..663fa5c1 100644 --- a/src/main/java/appeng/container/slot/SlotPlayerInv.java +++ b/src/main/java/appeng/container/slot/SlotPlayerInv.java @@ -27,7 +27,7 @@ import net.minecraft.inventory.IInventory; public class SlotPlayerInv extends AppEngSlot { - public SlotPlayerInv( IInventory par1iInventory, int par2, int par3, int par4 ) + public SlotPlayerInv( final IInventory par1iInventory, final int par2, final int par3, final int par4 ) { super( par1iInventory, par2, par3, par4 ); diff --git a/src/main/java/appeng/container/slot/SlotRestrictedInput.java b/src/main/java/appeng/container/slot/SlotRestrictedInput.java index de7308cc..ea0f3457 100644 --- a/src/main/java/appeng/container/slot/SlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/SlotRestrictedInput.java @@ -58,7 +58,7 @@ public class SlotRestrictedInput extends AppEngSlot public boolean allowEdit = true; public int stackLimit = -1; - public SlotRestrictedInput( PlacableItemType valid, IInventory i, int slotIndex, int x, int y, InventoryPlayer p ) + public SlotRestrictedInput( final PlacableItemType valid, final IInventory i, final int slotIndex, final int x, final int y, final InventoryPlayer p ) { super( i, slotIndex, x, y ); this.which = valid; @@ -76,24 +76,24 @@ public class SlotRestrictedInput extends AppEngSlot return super.getSlotStackLimit(); } - public boolean isValid( ItemStack is, World theWorld ) + public boolean isValid( final ItemStack is, final World theWorld ) { if( this.which == PlacableItemType.VALID_ENCODED_PATTERN_W_OUTPUT ) { - ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ( (ICraftingPatternItem) is.getItem() ).getPatternForItem( is, theWorld ) : null; + final ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ( (ICraftingPatternItem) is.getItem() ).getPatternForItem( is, theWorld ) : null; return ap != null; } return true; } - public Slot setStackLimit( int i ) + public Slot setStackLimit( final int i ) { this.stackLimit = i; return this; } @Override - public boolean isItemValid( ItemStack i ) + public boolean isItemValid( final ItemStack i ) { if( !this.myContainer.isValidForSlot( this, i ) ) { @@ -128,8 +128,8 @@ public class SlotRestrictedInput extends AppEngSlot case ENCODED_CRAFTING_PATTERN: if( i.getItem() instanceof ICraftingPatternItem ) { - ICraftingPatternItem b = (ICraftingPatternItem) i.getItem(); - ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj ); + final ICraftingPatternItem b = (ICraftingPatternItem) i.getItem(); + final ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj ); if( de != null ) { return de.isCraftable(); @@ -166,7 +166,7 @@ public class SlotRestrictedInput extends AppEngSlot return true; } - for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() ) + for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() ) { if( Platform.isSameItemPrecise( optional, i ) ) { @@ -230,7 +230,7 @@ public class SlotRestrictedInput extends AppEngSlot } @Override - public boolean canTakeStack( EntityPlayer par1EntityPlayer ) + public boolean canTakeStack( final EntityPlayer par1EntityPlayer ) { return this.allowEdit; } @@ -240,11 +240,11 @@ public class SlotRestrictedInput extends AppEngSlot { if( Platform.isClient() && ( this.which == PlacableItemType.ENCODED_PATTERN ) ) { - ItemStack is = super.getStack(); + final ItemStack is = super.getStack(); if( is != null && is.getItem() instanceof ItemEncodedPattern ) { - ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); - ItemStack out = iep.getOutput( is ); + final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); + final ItemStack out = iep.getOutput( is ); if( out != null ) { return out; @@ -254,16 +254,16 @@ public class SlotRestrictedInput extends AppEngSlot return super.getStack(); } - public static boolean isMetalIngot( ItemStack i ) + public static boolean isMetalIngot( final ItemStack i ) { if( Platform.isSameItemPrecise( i, new ItemStack( Items.iron_ingot ) ) ) { return true; } - for( String name : new String[] { "Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", "Nickel", "Aluminium" } ) + for( final String name : new String[] { "Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", "Nickel", "Aluminium" } ) { - for( ItemStack ingot : OreDictionary.getOres( "ingot" + name ) ) + for( final ItemStack ingot : OreDictionary.getOres( "ingot" + name ) ) { if( Platform.isSameItemPrecise( i, ingot ) ) { @@ -291,7 +291,7 @@ public class SlotRestrictedInput extends AppEngSlot public final int IIcon; - PlacableItemType( int o ) + PlacableItemType( final int o ) { this.IIcon = o; } diff --git a/src/main/java/appeng/core/AEConfig.java b/src/main/java/appeng/core/AEConfig.java index e3c6af1b..a504f762 100644 --- a/src/main/java/appeng/core/AEConfig.java +++ b/src/main/java/appeng/core/AEConfig.java @@ -106,7 +106,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject private double WirelessBoosterRangeMultiplier = 1; private double WirelessBoosterExp = 1.5; - public AEConfig( File configFile ) + public AEConfig( final File configFile ) { super( configFile ); this.configFile = configFile; @@ -123,7 +123,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject final double DEFAULT_RF_EXCHANGE = 0.5; PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE ); - double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 ); + final double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 ); PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective ); CondenserOutput.MATTER_BALLS.requiredPower = this.get( "Condenser", "MatterBalls", 256 ).getInt( 256 ); @@ -167,7 +167,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject this.clientSync(); - for( AEFeature feature : AEFeature.values() ) + for( final AEFeature feature : AEFeature.values() ) { if( feature.isVisible ) { @@ -182,10 +182,10 @@ public final class AEConfig extends Configuration implements IConfigurableObject } } - ModContainer imb = net.minecraftforge.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" ); + final ModContainer imb = net.minecraftforge.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" ); if( imb != null ) { - List version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" ); + final List version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" ); if( version.contains( imb.getVersion() ) ) { this.featureFlags.remove( AEFeature.AlphaPass ); @@ -196,12 +196,12 @@ public final class AEConfig extends Configuration implements IConfigurableObject { this.selectedPowerUnit = PowerUnits.valueOf( this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), this.getListComment( this.selectedPowerUnit ) ).getString() ); } - catch( Throwable t ) + catch( final Throwable t ) { this.selectedPowerUnit = PowerUnits.AE; } - for( TickRates tr : TickRates.values() ) + for( final TickRates tr : TickRates.values() ) { tr.Load( this ); } @@ -232,11 +232,11 @@ public final class AEConfig extends Configuration implements IConfigurableObject // load buttons.. for( int btnNum = 0; btnNum < 4; btnNum++ ) { - Property cmb = this.get( "Client", "craftAmtButton" + ( btnNum + 1 ), this.craftByStacks[btnNum] ); - Property pmb = this.get( "Client", "priorityAmtButton" + ( btnNum + 1 ), this.priorityByStacks[btnNum] ); - Property lmb = this.get( "Client", "levelAmtButton" + ( btnNum + 1 ), this.levelByStacks[btnNum] ); + final Property cmb = this.get( "Client", "craftAmtButton" + ( btnNum + 1 ), this.craftByStacks[btnNum] ); + final Property pmb = this.get( "Client", "priorityAmtButton" + ( btnNum + 1 ), this.priorityByStacks[btnNum] ); + final Property lmb = this.get( "Client", "levelAmtButton" + ( btnNum + 1 ), this.levelByStacks[btnNum] ); - int buttonCap = (int) ( Math.pow( 10, btnNum + 1 ) - 1 ); + final int buttonCap = (int) ( Math.pow( 10, btnNum + 1 ) - 1 ); this.craftByStacks[btnNum] = Math.abs( cmb.getInt( this.craftByStacks[btnNum] ) ); this.priorityByStacks[btnNum] = Math.abs( pmb.getInt( this.priorityByStacks[btnNum] ) ); @@ -251,18 +251,18 @@ public final class AEConfig extends Configuration implements IConfigurableObject this.levelByStacks[btnNum] = Math.min( this.levelByStacks[btnNum], buttonCap ); } - for( Settings e : this.settings.getSettings() ) + for( final Settings e : this.settings.getSettings() ) { - String Category = "Client"; // e.getClass().getSimpleName(); + final String Category = "Client"; // e.getClass().getSimpleName(); Enum value = this.settings.getSetting( e ); - Property p = this.get( Category, e.name(), value.name(), this.getListComment( value ) ); + final Property p = this.get( Category, e.name(), value.name(), this.getListComment( value ) ); try { value = Enum.valueOf( value.getClass(), p.getString() ); } - catch( IllegalArgumentException er ) + catch( final IllegalArgumentException er ) { AELog.info( "Invalid value '" + p.getString() + "' for " + e.name() + " using '" + value.name() + "' instead" ); } @@ -271,17 +271,17 @@ public final class AEConfig extends Configuration implements IConfigurableObject } } - private String getListComment( Enum value ) + private String getListComment( final Enum value ) { String comment = null; if( value != null ) { - EnumSet set = EnumSet.allOf( value.getClass() ); + final EnumSet set = EnumSet.allOf( value.getClass() ); - for( Object Oeg : set ) + for( final Object Oeg : set ) { - Enum eg = (Enum) Oeg; + final Enum eg = (Enum) Oeg; if( comment == null ) { comment = "Possible Values: " + eg.name(); @@ -296,30 +296,30 @@ public final class AEConfig extends Configuration implements IConfigurableObject return comment; } - public boolean isFeatureEnabled( AEFeature f ) + public boolean isFeatureEnabled( final AEFeature f ) { return this.featureFlags.contains( f ); } - public double wireless_getDrainRate( double range ) + public double wireless_getDrainRate( final double range ) { return this.WirelessTerminalDrainMultiplier * range; } - public double wireless_getMaxRange( int boosters ) + public double wireless_getMaxRange( final int boosters ) { return this.WirelessBaseRange + this.WirelessBoosterRangeMultiplier * Math.pow( boosters, this.WirelessBoosterExp ); } - public double wireless_getPowerDrain( int boosters ) + public double wireless_getPowerDrain( final int boosters ) { return this.WirelessBaseCost + this.WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / this.WirelessHighWirelessCount ); } @Override - public Property get( String category, String key, String defaultValue, String comment, Property.Type type ) + public Property get( final String category, final String key, final String defaultValue, final String comment, final Property.Type type ) { - Property prop = super.get( category, key, defaultValue, comment, type ); + final Property prop = super.get( category, key, defaultValue, comment, type ); if( prop != null ) { @@ -350,7 +350,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject } @SubscribeEvent - public void onConfigChanged( ConfigChangedEvent.OnConfigChangedEvent eventArgs ) + public void onConfigChanged( final ConfigChangedEvent.OnConfigChangedEvent eventArgs ) { if( eventArgs.modID.equals( AppEng.MOD_ID ) ) { @@ -368,7 +368,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject return this.configFile.toString(); } - public boolean useAEVersion( MaterialType mt ) + public boolean useAEVersion( final MaterialType mt ) { if( this.isFeatureEnabled( AEFeature.WebsiteRecipes ) ) { @@ -376,21 +376,21 @@ public final class AEConfig extends Configuration implements IConfigurableObject } this.setCategoryComment( "OreCamouflage", "AE2 Automatically uses alternative ores present in your instance of MC to blend better with its surroundings, if you prefer you can disable this selectively using these flags; Its important to note, that some if these items even if enabled may not be craftable in game because other items are overriding their recipes." ); - Property p = this.get( "OreCamouflage", mt.name(), true ); + final Property p = this.get( "OreCamouflage", mt.name(), true ); p.comment = "OreDictionary Names: " + mt.getOreName(); return !p.getBoolean( true ); } @Override - public void updateSetting( IConfigManager manager, Enum setting, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum setting, final Enum newValue ) { - for( Settings e : this.settings.getSettings() ) + for( final Settings e : this.settings.getSettings() ) { if( e == setting ) { - String Category = "Client"; - Property p = this.get( Category, e.name(), this.settings.getSetting( e ).name(), this.getListComment( newValue ) ); + final String Category = "Client"; + final Property p = this.get( Category, e.name(), this.settings.getSetting( e ).name(), this.getListComment( newValue ) ); p.set( newValue.name() ); } } @@ -401,19 +401,19 @@ public final class AEConfig extends Configuration implements IConfigurableObject } } - public int getFreeMaterial( int varID ) + public int getFreeMaterial( final int varID ) { return this.getFreeIDSLot( varID, "materials" ); } - public int getFreeIDSLot( int varID, String category ) + public int getFreeIDSLot( final int varID, final String category ) { boolean alreadyUsed = false; int min = 0; - for( Property p : this.getCategory( category ).getValues().values() ) + for( final Property p : this.getCategory( category ).getValues().values() ) { - int thisInt = p.getInt(); + final int thisInt = p.getInt(); if( varID == thisInt ) { @@ -436,7 +436,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject return varID; } - public int getFreePart( int varID ) + public int getFreePart( final int varID ) { return this.getFreeIDSLot( varID, "parts" ); } @@ -452,31 +452,31 @@ public final class AEConfig extends Configuration implements IConfigurableObject return this.useLargeFonts; } - public int craftItemsByStackAmounts( int i ) + public int craftItemsByStackAmounts( final int i ) { return this.craftByStacks[i]; } - public int priorityByStacksAmounts( int i ) + public int priorityByStacksAmounts( final int i ) { return this.priorityByStacks[i]; } - public int levelByStackAmounts( int i ) + public int levelByStackAmounts( final int i ) { return this.levelByStacks[i]; } - public Enum getSetting( String category, Class class1, Enum myDefault ) + public Enum getSetting( final String category, final Class class1, final Enum myDefault ) { - String name = class1.getSimpleName(); - Property p = this.get( category, name, myDefault.name() ); + final String name = class1.getSimpleName(); + final Property p = this.get( category, name, myDefault.name() ); try { return (Enum) class1.getField( p.toString() ).get( class1 ); } - catch( Throwable t ) + catch( final Throwable t ) { // :{ } @@ -484,9 +484,9 @@ public final class AEConfig extends Configuration implements IConfigurableObject return myDefault; } - public void setSetting( String category, Enum s ) + public void setSetting( final String category, final Enum s ) { - String name = s.getClass().getSimpleName(); + final String name = s.getClass().getSimpleName(); this.get( category, name, s.name() ).set( s.name() ); this.save(); } @@ -496,7 +496,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject return this.selectedPowerUnit; } - public void nextPowerUnit( boolean backwards ) + public void nextPowerUnit( final boolean backwards ) { this.selectedPowerUnit = Platform.rotateEnum( this.selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues() ); this.save(); diff --git a/src/main/java/appeng/core/AELog.java b/src/main/java/appeng/core/AELog.java index 887c8305..44d950c9 100644 --- a/src/main/java/appeng/core/AELog.java +++ b/src/main/java/appeng/core/AELog.java @@ -39,12 +39,12 @@ public final class AELog { } - public static void warning( String format, Object... data ) + public static void warning( final String format, final Object... data ) { log( Level.WARN, format, data ); } - private static void log( Level level, String format, Object... data ) + private static void log( final Level level, final String format, final Object... data ) { if( AEConfig.instance == null || AEConfig.instance.isFeatureEnabled( AEFeature.Logging ) ) { @@ -59,7 +59,7 @@ public final class AELog } } - public static void grinder( String o ) + public static void grinder( final String o ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.GrinderLogging ) ) { @@ -67,7 +67,7 @@ public final class AELog } } - public static void integration( Throwable exception ) + public static void integration( final Throwable exception ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.IntegrationLogging ) ) { @@ -75,7 +75,7 @@ public final class AELog } } - public static void error( Throwable e ) + public static void error( final Throwable e ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.Logging ) ) { @@ -84,12 +84,12 @@ public final class AELog } } - public static void severe( String format, Object... data ) + public static void severe( final String format, final Object... data ) { log( Level.ERROR, format, data ); } - public static void blockUpdate( BlockPos pos, AEBaseTile aeBaseTile ) + public static void blockUpdate( final BlockPos pos, final AEBaseTile aeBaseTile ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.UpdateLogging ) ) { @@ -97,12 +97,12 @@ public final class AELog } } - public static void info( String format, Object... data ) + public static void info( final String format, final Object... data ) { log( Level.INFO, format, data ); } - public static void crafting( String format, Object... data ) + public static void crafting( final String format, final Object... data ) { if( AEConfig.instance.isFeatureEnabled( AEFeature.CraftingLog ) ) { diff --git a/src/main/java/appeng/core/Api.java b/src/main/java/appeng/core/Api.java index 0d5bd4b5..73bbf77c 100644 --- a/src/main/java/appeng/core/Api.java +++ b/src/main/java/appeng/core/Api.java @@ -79,7 +79,7 @@ public final class Api implements IAppEngApi } @Override - public IGridNode createGridNode( IGridBlock blk ) + public IGridNode createGridNode( final IGridBlock blk ) { if ( Platform.isClient() ) { @@ -90,7 +90,7 @@ public final class Api implements IAppEngApi } @Override - public IGridConnection createGridConnection( IGridNode a, IGridNode b ) throws FailedConnection + public IGridConnection createGridConnection( final IGridNode a, final IGridNode b ) throws FailedConnection { return new GridConnection( a, b, AEPartLocation.INTERNAL ); } diff --git a/src/main/java/appeng/core/ApiDefinitions.java b/src/main/java/appeng/core/ApiDefinitions.java index eb2a937e..2a44fc33 100644 --- a/src/main/java/appeng/core/ApiDefinitions.java +++ b/src/main/java/appeng/core/ApiDefinitions.java @@ -40,7 +40,7 @@ public final class ApiDefinitions implements IDefinitions private final FeatureHandlerRegistry handlers; private final FeatureRegistry features; - public ApiDefinitions( IPartHelper partHelper ) + public ApiDefinitions( final IPartHelper partHelper ) { this.features = new FeatureRegistry(); this.handlers = new FeatureHandlerRegistry(); diff --git a/src/main/java/appeng/core/AppEng.java b/src/main/java/appeng/core/AppEng.java index 9dab97f0..6685793a 100644 --- a/src/main/java/appeng/core/AppEng.java +++ b/src/main/java/appeng/core/AppEng.java @@ -101,14 +101,14 @@ public final class AppEng } @EventHandler - private void preInit( FMLPreInitializationEvent event ) + private void preInit( final FMLPreInitializationEvent event ) { if( !Loader.isModLoaded( "appliedenergistics2-core" ) ) { CommonHelper.proxy.missingCoreMod(); } - Stopwatch watch = Stopwatch.createStarted(); + final Stopwatch watch = Stopwatch.createStarted(); this.configDirectory = new File( event.getModConfigurationDirectory().getPath(), "AppliedEnergistics2" ); final File configFile = new File( this.configDirectory, "AppliedEnergistics2.cfg" ); @@ -145,7 +145,7 @@ public final class AppEng AELog.info( "Pre Initialization ( ended after " + watch.elapsed( TimeUnit.MILLISECONDS ) + "ms )" ); } - private void startService( String serviceName, Thread thread ) + private void startService( final String serviceName, final Thread thread ) { thread.setName( serviceName ); thread.setPriority( Thread.MIN_PRIORITY ); @@ -155,9 +155,9 @@ public final class AppEng } @EventHandler - private void init( FMLInitializationEvent event ) + private void init( final FMLInitializationEvent event ) { - Stopwatch star = Stopwatch.createStarted(); + final Stopwatch star = Stopwatch.createStarted(); AELog.info( "Initialization ( started )" ); Registration.INSTANCE.initialize( event ); @@ -168,9 +168,9 @@ public final class AppEng } @EventHandler - private void postInit( FMLPostInitializationEvent event ) + private void postInit( final FMLPostInitializationEvent event ) { - Stopwatch star = Stopwatch.createStarted(); + final Stopwatch star = Stopwatch.createStarted(); AELog.info( "Post Initialization ( started )" ); Registration.INSTANCE.postInit( event ); @@ -193,26 +193,26 @@ public final class AppEng } @EventHandler - private void handleIMCEvent( FMLInterModComms.IMCEvent event ) + private void handleIMCEvent( final FMLInterModComms.IMCEvent event ) { this.imcHandler.handleIMCEvent( event ); } @EventHandler - private void serverAboutToStart( FMLServerAboutToStartEvent evt ) + private void serverAboutToStart( final FMLServerAboutToStartEvent evt ) { WorldData.onServerAboutToStart(); } @EventHandler - private void serverStopping( FMLServerStoppingEvent event ) + private void serverStopping( final FMLServerStoppingEvent event ) { WorldData.instance().onServerStopping(); TickHandler.INSTANCE.shutdown(); } @EventHandler - private void serverStarting( FMLServerStartingEvent evt ) + private void serverStarting( final FMLServerStartingEvent evt ) { evt.registerServerCommand( new AECommand( evt.getServer() ) ); } diff --git a/src/main/java/appeng/core/CreativeTab.java b/src/main/java/appeng/core/CreativeTab.java index 39ed53d9..c95affe2 100644 --- a/src/main/java/appeng/core/CreativeTab.java +++ b/src/main/java/appeng/core/CreativeTab.java @@ -62,11 +62,11 @@ public final class CreativeTab extends CreativeTabs return this.findFirst( blocks.controller(), blocks.chest(), blocks.cellWorkbench(), blocks.fluix(), items.cell1k(), items.networkTool(), materials.fluixCrystal(), materials.certusQuartzCrystal() ); } - private ItemStack findFirst( IItemDefinition... choices ) + private ItemStack findFirst( final IItemDefinition... choices ) { - for( IItemDefinition definition : choices ) + for( final IItemDefinition definition : choices ) { - for( ItemStack definitionStack : definition.maybeStack( 1 ).asSet() ) + for( final ItemStack definitionStack : definition.maybeStack( 1 ).asSet() ) { return definitionStack; } diff --git a/src/main/java/appeng/core/FacadeConfig.java b/src/main/java/appeng/core/FacadeConfig.java index 21a0ec73..94eecc4d 100644 --- a/src/main/java/appeng/core/FacadeConfig.java +++ b/src/main/java/appeng/core/FacadeConfig.java @@ -36,23 +36,23 @@ public class FacadeConfig extends Configuration public static FacadeConfig instance; final Pattern replacementPattern; - public FacadeConfig( File facadeFile ) + public FacadeConfig( final File facadeFile ) { super( facadeFile ); this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" ); } - public boolean checkEnabled( Block id, int metadata, boolean automatic ) + public boolean checkEnabled( final Block id, final int metadata, final boolean automatic ) { if( id == null ) { return false; } - UniqueIdentifier blk = GameRegistry.findUniqueIdentifierFor( id ); + final UniqueIdentifier blk = GameRegistry.findUniqueIdentifierFor( id ); if( blk == null ) { - for( Field f : Block.class.getFields() ) + for( final Field f : Block.class.getFields() ) { try { @@ -61,7 +61,7 @@ public class FacadeConfig extends Configuration return this.get( "minecraft", f.getName() + ( metadata == 0 ? "" : "." + metadata ), automatic ).getBoolean( automatic ); } } - catch( Throwable e ) + catch( final Throwable e ) { // :P } @@ -69,8 +69,8 @@ public class FacadeConfig extends Configuration } else { - Matcher mod = this.replacementPattern.matcher( blk.modId ); - Matcher name = this.replacementPattern.matcher( blk.name ); + final Matcher mod = this.replacementPattern.matcher( blk.modId ); + final Matcher name = this.replacementPattern.matcher( blk.name ); return this.get( mod.replaceAll( "" ), name.replaceAll( "" ) + ( metadata == 0 ? "" : "." + metadata ), automatic ).getBoolean( automatic ); } diff --git a/src/main/java/appeng/core/FeatureHandlerRegistry.java b/src/main/java/appeng/core/FeatureHandlerRegistry.java index 9bb5f191..2464b3b7 100644 --- a/src/main/java/appeng/core/FeatureHandlerRegistry.java +++ b/src/main/java/appeng/core/FeatureHandlerRegistry.java @@ -29,7 +29,7 @@ public final class FeatureHandlerRegistry { private final Set registry = new LinkedHashSet(); - public void addFeatureHandler( IFeatureHandler feature ) + public void addFeatureHandler( final IFeatureHandler feature ) { this.registry.add( feature ); } diff --git a/src/main/java/appeng/core/FeatureRegistry.java b/src/main/java/appeng/core/FeatureRegistry.java index 26fa3920..4991f1d7 100644 --- a/src/main/java/appeng/core/FeatureRegistry.java +++ b/src/main/java/appeng/core/FeatureRegistry.java @@ -29,7 +29,7 @@ public final class FeatureRegistry { private final Set registry = new LinkedHashSet(); - public void addFeature( IAEFeature feature ) + public void addFeature( final IAEFeature feature ) { this.registry.add( feature ); } diff --git a/src/main/java/appeng/core/IMCHandler.java b/src/main/java/appeng/core/IMCHandler.java index 7c6ad0a2..5ea8c6af 100644 --- a/src/main/java/appeng/core/IMCHandler.java +++ b/src/main/java/appeng/core/IMCHandler.java @@ -63,7 +63,7 @@ public class IMCHandler this.processors.put( "add-grindable", new IMCGrinder() ); this.processors.put( "add-mattercannon-ammo", new IMCMatterCannon() ); - for( TunnelType type : TunnelType.values() ) + for( final TunnelType type : TunnelType.values() ) { this.processors.put( "add-p2p-attunement-" + type.name().replace( '_', '-' ).toLowerCase( Locale.ENGLISH ), new IMCP2PAttunement() ); } @@ -74,9 +74,9 @@ public class IMCHandler * * @param event Event carrying the identifier and message for the handlers */ - public void handleIMCEvent( FMLInterModComms.IMCEvent event ) + public void handleIMCEvent( final FMLInterModComms.IMCEvent event ) { - for( FMLInterModComms.IMCMessage message : event.getMessages() ) + for( final FMLInterModComms.IMCMessage message : event.getMessages() ) { final String key = message.key; @@ -92,7 +92,7 @@ public class IMCHandler throw new IllegalStateException( "Invalid IMC Called: " + key ); } } - catch( Exception t ) + catch( final Exception t ) { AELog.warning( "Problem detected when processing IMC " + key + " from " + message.getSender() ); AELog.error( t ); diff --git a/src/main/java/appeng/core/RecipeLoader.java b/src/main/java/appeng/core/RecipeLoader.java index c7235cc5..0a0dc643 100644 --- a/src/main/java/appeng/core/RecipeLoader.java +++ b/src/main/java/appeng/core/RecipeLoader.java @@ -51,7 +51,7 @@ public class RecipeLoader implements Runnable * * @throws NullPointerException if handler is null */ - public RecipeLoader( @Nonnull IRecipeHandler handler ) + public RecipeLoader( @Nonnull final IRecipeHandler handler ) { Preconditions.checkNotNull( handler ); @@ -86,12 +86,12 @@ public class RecipeLoader implements Runnable this.handler.parseRecipes( new ConfigLoader( generatedRecipesDir, userRecipesDir ), "index.recipe" ); } // on failure use jar parsing - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); this.handler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" ); } - catch( URISyntaxException e ) + catch( final URISyntaxException e ) { AELog.error( e ); this.handler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" ); diff --git a/src/main/java/appeng/core/Registration.java b/src/main/java/appeng/core/Registration.java index 843df290..89e87dd4 100644 --- a/src/main/java/appeng/core/Registration.java +++ b/src/main/java/appeng/core/Registration.java @@ -119,12 +119,12 @@ public final class Registration this.recipeHandler = new RecipeHandler(); } - public void preInitialize( FMLPreInitializationEvent event ) + public void preInitialize( final FMLPreInitializationEvent event ) { this.registerSpatial( false ); final Api api = Api.INSTANCE; - IRecipeHandlerRegistry recipeRegistry = api.registries().recipes(); + final IRecipeHandlerRegistry recipeRegistry = api.registries().recipes(); this.registerCraftHandlers( recipeRegistry ); RecipeSorter.register( "AE2-Facade", FacadeRecipe.class, Category.SHAPED, "" ); @@ -136,25 +136,25 @@ public final class Registration final ApiDefinitions definitions = api.definitions(); // Register all detected handlers and features (items, blocks) in pre-init - for( IFeatureHandler handler : definitions.getFeatureHandlerRegistry().getRegisteredFeatureHandlers() ) + for( final IFeatureHandler handler : definitions.getFeatureHandlerRegistry().getRegisteredFeatureHandlers() ) { handler.register(event.getSide() ); } - for( IAEFeature feature : definitions.getFeatureRegistry().getRegisteredFeatures() ) + for( final IAEFeature feature : definitions.getFeatureRegistry().getRegisteredFeatures() ) { feature.postInit(); } } - private void registerSpatial( boolean force ) + private void registerSpatial( final boolean force ) { if( !AEConfig.instance.isFeatureEnabled( AEFeature.SpatialIO ) ) { return; } - AEConfig config = AEConfig.instance; + final AEConfig config = AEConfig.instance; if( this.storageBiome == null ) { @@ -194,7 +194,7 @@ public final class Registration } } - private void registerCraftHandlers( IRecipeHandlerRegistry registry ) + private void registerCraftHandlers( final IRecipeHandlerRegistry registry ) { registry.addNewSubItemResolver( new AEItemResolver() ); @@ -215,7 +215,7 @@ public final class Registration registry.addNewCraftHandler( "shapeless", Shapeless.class ); } - public void initialize( FMLInitializationEvent event ) + public void initialize( final FMLInitializationEvent event ) { final IAppEngApi api = AEApi.instance(); final IPartHelper partHelper = api.partHelper(); @@ -251,11 +251,11 @@ public final class Registration FMLCommonHandler.instance().bus().register( TickHandler.INSTANCE ); MinecraftForge.EVENT_BUS.register( TickHandler.INSTANCE ); - PartPlacement pp = new PartPlacement(); + final PartPlacement pp = new PartPlacement(); MinecraftForge.EVENT_BUS.register( pp ); FMLCommonHandler.instance().bus().register( pp ); - IGridCacheRegistry gcr = registries.gridCache(); + final IGridCacheRegistry gcr = registries.gridCache(); gcr.registerGridCache( ITickManager.class, TickManagerCache.class ); gcr.registerGridCache( IEnergyGrid.class, EnergyGridCache.class ); gcr.registerGridCache( IPathingGrid.class, PathGridCache.class ); @@ -270,7 +270,7 @@ public final class Registration registries.cell().addCellHandler( new BasicCellHandler() ); registries.cell().addCellHandler( new CreativeCellHandler() ); - for( ItemStack ammoStack : api.definitions().materials().matterBall().maybeStack( 1 ).asSet() ) + for( final ItemStack ammoStack : api.definitions().materials().matterBall().maybeStack( 1 ).asSet() ) { final double weight = 32; @@ -296,7 +296,7 @@ public final class Registration } } - public void postInit( FMLPostInitializationEvent event ) + public void postInit( final FMLPostInitializationEvent event ) { this.registerSpatial( true ); @@ -315,7 +315,7 @@ public final class Registration GuiText.values(); Api.INSTANCE.partHelper().initFMPSupport(); - for( Block block : blocks.multiPart().maybeBlock().asSet() ) + for( final Block block : blocks.multiPart().maybeBlock().asSet() ) { ( (BlockCableBus) block ).setupTile(); } @@ -385,22 +385,22 @@ public final class Registration // Inscriber Upgrades.SPEED.registerItem( blocks.inscriber(), 3 ); - for( Item wirelessTerminalItem : items.wirelessTerminal().maybeItem().asSet() ) + for( final Item wirelessTerminalItem : items.wirelessTerminal().maybeItem().asSet() ) { registries.wireless().registerWirelessHandler( (IWirelessTermHandler) wirelessTerminalItem ); } if( AEConfig.instance.isFeatureEnabled( AEFeature.ChestLoot ) ) { - ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR ); + final ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR ); final IMaterials materials = definitions.materials(); - for( ItemStack crystal : materials.certusQuartzCrystal().maybeStack( 1 ).asSet() ) + for( final ItemStack crystal : materials.certusQuartzCrystal().maybeStack( 1 ).asSet() ) { d.addItem( new WeightedRandomChestContent( crystal, 1, 4, 2 ) ); } - for( ItemStack dust : materials.certusQuartzDust().maybeStack( 1 ).asSet() ) + for( final ItemStack dust : materials.certusQuartzDust().maybeStack( 1 ).asSet() ) { d.addItem( new WeightedRandomChestContent( dust, 1, 4, 2 ) ); } @@ -423,7 +423,7 @@ public final class Registration GameRegistry.registerWorldGenerator( new MeteoriteWorldGen(), 0 ); } - IMovableRegistry mr = registries.movable(); + final IMovableRegistry mr = registries.movable(); /** * You can't move bed rock. @@ -461,7 +461,7 @@ public final class Registration /** * world gen */ - for( WorldGenType type : WorldGenType.values() ) + for( final WorldGenType type : WorldGenType.values() ) { registries.worldgen().disableWorldGenForProviderID( type, StorageWorldProvider.class ); @@ -473,7 +473,7 @@ public final class Registration } // whitelist from config - for( int dimension : AEConfig.instance.meteoriteDimensionWhitelist ) + for( final int dimension : AEConfig.instance.meteoriteDimensionWhitelist ) { registries.worldgen().enableWorldGenForDimension( WorldGenType.Meteorites, dimension ); } diff --git a/src/main/java/appeng/core/api/ApiPart.java b/src/main/java/appeng/core/api/ApiPart.java index 3f09e298..08787bb7 100644 --- a/src/main/java/appeng/core/api/ApiPart.java +++ b/src/main/java/appeng/core/api/ApiPart.java @@ -71,7 +71,7 @@ public class ApiPart implements IPartHelper public void initFMPSupport() { - for( Class layerInterface : this.interfaces2Layer.keySet() ) + for( final Class layerInterface : this.interfaces2Layer.keySet() ) { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) ) { @@ -80,7 +80,7 @@ public class ApiPart implements IPartHelper } } - public Class getCombinedInstance( String base ) + public Class getCombinedInstance( final String base ) { if( this.desc.isEmpty() ) { @@ -88,13 +88,13 @@ public class ApiPart implements IPartHelper { return Class.forName( base ); } - catch( ClassNotFoundException e ) + catch( final ClassNotFoundException e ) { throw new IllegalStateException( e ); } } - String description = base + ':' + Joiner.on( ";" ).skipNulls().join( this.desc.iterator() ); + final String description = base + ':' + Joiner.on( ";" ).skipNulls().join( this.desc.iterator() ); if( this.tileImplementations.get( description ) != null ) { @@ -107,7 +107,7 @@ public class ApiPart implements IPartHelper { Addendum = Class.forName( base ).getSimpleName(); } - catch( ClassNotFoundException e ) + catch( final ClassNotFoundException e ) { AELog.error( e ); } @@ -117,22 +117,22 @@ public class ApiPart implements IPartHelper { myCLass = Class.forName( f ); } - catch( ClassNotFoundException e ) + catch( final ClassNotFoundException e ) { throw new IllegalStateException( e ); } String path = f; - for( String name : this.desc ) + for( final String name : this.desc ) { try { - String newPath = path + ';' + name; + final String newPath = path + ';' + name; myCLass = this.getClassByDesc( Addendum, newPath, f, this.interfaces2Layer.get( Class.forName( name ) ) ); path = newPath; } - catch( Throwable t ) + catch( final Throwable t ) { AELog.warning( "Error loading " + name ); AELog.error( t ); @@ -146,51 +146,51 @@ public class ApiPart implements IPartHelper return myCLass; } - public Class getClassByDesc( String addendum, String fullPath, String root, String next ) + public Class getClassByDesc( final String addendum, final String fullPath, final String root, final String next ) { if( this.roots.get( fullPath ) != null ) { return this.roots.get( fullPath ); } - ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS ); - ClassNode n = this.getReader( next ); - String originalName = n.name; + final ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS ); + final ClassNode n = this.getReader( next ); + final String originalName = n.name; try { n.name = n.name + '_' + addendum; n.superName = Class.forName( root ).getName().replace( ".", "/" ); } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } - for( MethodNode mn : n.methods ) + for( final MethodNode mn : n.methods ) { - Iterator i = mn.instructions.iterator(); + final Iterator i = mn.instructions.iterator(); while( i.hasNext() ) { this.processNode( i.next(), n.superName ); } } - DefaultPackageClassNameRemapper remapper = new DefaultPackageClassNameRemapper(); + final DefaultPackageClassNameRemapper remapper = new DefaultPackageClassNameRemapper(); remapper.inputOutput.put( "appeng/api/parts/LayerBase", n.superName ); remapper.inputOutput.put( originalName, n.name ); n.accept( new RemappingClassAdapter( cw, remapper ) ); // n.accept( cw ); // n.accept( new TraceClassVisitor( new PrintWriter( System.out ) ) ); - byte[] byteArray = cw.toByteArray(); - int size = byteArray.length; - Class clazz = this.loadClass( n.name.replace( "/", "." ), byteArray ); + final byte[] byteArray = cw.toByteArray(); + final int size = byteArray.length; + final Class clazz = this.loadClass( n.name.replace( "/", "." ), byteArray ); try { - Object fish = clazz.newInstance(); - Class rootC = Class.forName( root ); + final Object fish = clazz.newInstance(); + final Class rootC = Class.forName( root ); boolean hasError = false; @@ -226,7 +226,7 @@ public class ApiPart implements IPartHelper AELog.info( "Layer: " + n.name + " loaded successfully - " + size + " bytes" ); } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.severe( "Layer: " + n.name + " Failed." ); AELog.error( t ); @@ -236,30 +236,30 @@ public class ApiPart implements IPartHelper return clazz; } - public ClassNode getReader( String name ) + public ClassNode getReader( final String name ) { - String path = '/' + name.replace( ".", "/" ) + ".class"; - InputStream is = this.getClass().getResourceAsStream( path ); + final String path = '/' + name.replace( ".", "/" ) + ".class"; + final InputStream is = this.getClass().getResourceAsStream( path ); try { - ClassReader cr = new ClassReader( is ); + final ClassReader cr = new ClassReader( is ); - ClassNode cn = new ClassNode(); + final ClassNode cn = new ClassNode(); cr.accept( cn, ClassReader.EXPAND_FRAMES ); return cn; } - catch( IOException e ) + catch( final IOException e ) { throw new IllegalStateException( "Error loading " + name, e ); } } - private void processNode( AbstractInsnNode next, String nePar ) + private void processNode( final AbstractInsnNode next, final String nePar ) { if( next instanceof MethodInsnNode ) { - MethodInsnNode min = (MethodInsnNode) next; + final MethodInsnNode min = (MethodInsnNode) next; if( min.owner.equals( "appeng/api/parts/LayerBase" ) ) { min.owner = nePar; @@ -267,26 +267,26 @@ public class ApiPart implements IPartHelper } } - private Class loadClass( String name, byte[] b ) + private Class loadClass( final String name, byte[] b ) { // override classDefine (as it is protected) and define the class. Class clazz = null; try { - ClassLoader loader = this.getClass().getClassLoader();// ClassLoader.getSystemClassLoader(); - Class root = ClassLoader.class; - Class cls = loader.getClass(); - Method defineClassMethod = root.getDeclaredMethod( "defineClass", String.class, byte[].class, int.class, int.class ); - Method runTransformersMethod = cls.getDeclaredMethod( "runTransformers", String.class, String.class, byte[].class ); + final ClassLoader loader = this.getClass().getClassLoader();// ClassLoader.getSystemClassLoader(); + final Class root = ClassLoader.class; + final Class cls = loader.getClass(); + final Method defineClassMethod = root.getDeclaredMethod( "defineClass", String.class, byte[].class, int.class, int.class ); + final Method runTransformersMethod = cls.getDeclaredMethod( "runTransformers", String.class, String.class, byte[].class ); runTransformersMethod.setAccessible( true ); defineClassMethod.setAccessible( true ); try { - Object[] argsA = { name, name, b }; + final Object[] argsA = { name, name, b }; b = (byte[]) runTransformersMethod.invoke( loader, argsA ); - Object[] args = { name, b, 0, b.length }; + final Object[] args = { name, b, 0, b.length }; clazz = (Class) defineClassMethod.invoke( loader, args ); } finally @@ -295,7 +295,7 @@ public class ApiPart implements IPartHelper defineClassMethod.setAccessible( false ); } } - catch( Exception e ) + catch( final Exception e ) { AELog.error( e ); throw new IllegalStateException( "Unable to manage part API.", e ); @@ -304,7 +304,7 @@ public class ApiPart implements IPartHelper } @Override - public boolean registerNewLayer( String layer, String layerInterface ) + public boolean registerNewLayer( final String layer, final String layerInterface ) { try { @@ -320,7 +320,7 @@ public class ApiPart implements IPartHelper AELog.info( "Layer " + layer + " not registered, " + layerInterface + " already has a layer." ); } } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } @@ -328,7 +328,7 @@ public class ApiPart implements IPartHelper } @Override - public void setItemBusRenderer( IPartItem i ) + public void setItemBusRenderer( final IPartItem i ) { if( Platform.isClient() && i instanceof Item ) { @@ -338,7 +338,7 @@ public class ApiPart implements IPartHelper } @Override - public boolean placeBus( ItemStack is, BlockPos pos, EnumFacing side, EntityPlayer player, World w ) + public boolean placeBus( final ItemStack is, final BlockPos pos, final EnumFacing side, final EntityPlayer player, final World w ) { return PartPlacement.place( is, pos, side, player, w, PartPlacement.PlaceType.PLACE_ITEM, 0 ); } @@ -355,9 +355,9 @@ public class ApiPart implements IPartHelper public final HashMap inputOutput = new HashMap(); @Override - public String map( String typeName ) + public String map( final String typeName ) { - String o = this.inputOutput.get( typeName ); + final String o = this.inputOutput.get( typeName ); if( o == null ) { return typeName; diff --git a/src/main/java/appeng/core/api/ApiStorage.java b/src/main/java/appeng/core/api/ApiStorage.java index 0bd0a255..33ee55c1 100644 --- a/src/main/java/appeng/core/api/ApiStorage.java +++ b/src/main/java/appeng/core/api/ApiStorage.java @@ -47,19 +47,19 @@ public class ApiStorage implements IStorageHelper { @Override - public ICraftingLink loadCraftingLink( NBTTagCompound data, ICraftingRequester req ) + public ICraftingLink loadCraftingLink( final NBTTagCompound data, final ICraftingRequester req ) { return new CraftingLink( data, req ); } @Override - public IAEItemStack createItemStack( ItemStack is ) + public IAEItemStack createItemStack( final ItemStack is ) { return AEItemStack.create( is ); } @Override - public IAEFluidStack createFluidStack( FluidStack is ) + public IAEFluidStack createFluidStack( final FluidStack is ) { return AEFluidStack.create( is ); } @@ -77,25 +77,25 @@ public class ApiStorage implements IStorageHelper } @Override - public IAEItemStack readItemFromPacket( ByteBuf input ) throws IOException + public IAEItemStack readItemFromPacket( final ByteBuf input ) throws IOException { return AEItemStack.loadItemStackFromPacket( input ); } @Override - public IAEFluidStack readFluidFromPacket( ByteBuf input ) throws IOException + public IAEFluidStack readFluidFromPacket( final ByteBuf input ) throws IOException { return AEFluidStack.loadFluidStackFromPacket( input ); } @Override - public IAEItemStack poweredExtraction( IEnergySource energy, IMEInventory cell, IAEItemStack request, BaseActionSource src ) + public IAEItemStack poweredExtraction( final IEnergySource energy, final IMEInventory cell, final IAEItemStack request, final BaseActionSource src ) { return Platform.poweredExtraction( energy, cell, request, src ); } @Override - public IAEItemStack poweredInsert( IEnergySource energy, IMEInventory cell, IAEItemStack input, BaseActionSource src ) + public IAEItemStack poweredInsert( final IEnergySource energy, final IMEInventory cell, final IAEItemStack input, final BaseActionSource src ) { return Platform.poweredInsert( energy, cell, input, src ); } diff --git a/src/main/java/appeng/core/api/definitions/ApiBlocks.java b/src/main/java/appeng/core/api/definitions/ApiBlocks.java index 16128b28..cc1a6c68 100644 --- a/src/main/java/appeng/core/api/definitions/ApiBlocks.java +++ b/src/main/java/appeng/core/api/definitions/ApiBlocks.java @@ -159,7 +159,7 @@ public final class ApiBlocks implements IBlocks private final IBlockDefinition phantomNode; private final IBlockDefinition cubeGenerator; - public ApiBlocks( DefinitionConstructor constructor ) + public ApiBlocks( final DefinitionConstructor constructor ) { // this.quartzOre = new BlockDefinition( "ore.quartz", new OreQuartz() ); this.quartzOre = constructor.registerBlockDefinition( new QuartzOreBlock() ); @@ -242,9 +242,9 @@ public final class ApiBlocks implements IBlocks this.cubeGenerator = constructor.registerBlockDefinition( new BlockCubeGenerator() ); } - private IBlockDefinition makeStairs( DefinitionConstructor constructor, IBlockDefinition definition, String name ) + private IBlockDefinition makeStairs( final DefinitionConstructor constructor, final IBlockDefinition definition, final String name ) { - for( Block block : definition.maybeBlock().asSet() ) + for( final Block block : definition.maybeBlock().asSet() ) { return constructor.registerBlockDefinition( new BlockStairCommon( block, name ) ); } diff --git a/src/main/java/appeng/core/api/definitions/ApiItems.java b/src/main/java/appeng/core/api/definitions/ApiItems.java index d98816c9..566fb3eb 100644 --- a/src/main/java/appeng/core/api/definitions/ApiItems.java +++ b/src/main/java/appeng/core/api/definitions/ApiItems.java @@ -113,7 +113,7 @@ public final class ApiItems implements IItems private final IItemDefinition toolDebugCard; private final IItemDefinition toolReplicatorCard; - public ApiItems( DefinitionConstructor constructor ) + public ApiItems( final DefinitionConstructor constructor ) { this.certusQuartzAxe = constructor.registerItemDefinition( new ToolQuartzAxe( AEFeature.CertusQuartzTools ) ); this.certusQuartzHoe = constructor.registerItemDefinition( new ToolQuartzHoe( AEFeature.CertusQuartzTools ) ); diff --git a/src/main/java/appeng/core/api/definitions/ApiMaterials.java b/src/main/java/appeng/core/api/definitions/ApiMaterials.java index 7d79508e..a5671075 100644 --- a/src/main/java/appeng/core/api/definitions/ApiMaterials.java +++ b/src/main/java/appeng/core/api/definitions/ApiMaterials.java @@ -103,7 +103,7 @@ public final class ApiMaterials implements IMaterials private final IItemDefinition qESingularity; private final IItemDefinition blankPattern; - public ApiMaterials( DefinitionConstructor constructor ) + public ApiMaterials( final DefinitionConstructor constructor ) { final MultiItem materials = new MultiItem(); constructor.registerItemDefinition( materials ); diff --git a/src/main/java/appeng/core/api/definitions/ApiParts.java b/src/main/java/appeng/core/api/definitions/ApiParts.java index 9c69e539..5548b77e 100644 --- a/src/main/java/appeng/core/api/definitions/ApiParts.java +++ b/src/main/java/appeng/core/api/definitions/ApiParts.java @@ -73,7 +73,7 @@ public final class ApiParts implements IParts private final IItemDefinition storageMonitor; private final IItemDefinition conversionMonitor; - public ApiParts( DefinitionConstructor constructor, IPartHelper partHelper ) + public ApiParts( final DefinitionConstructor constructor, final IPartHelper partHelper ) { final ItemMultiPart itemMultiPart = new ItemMultiPart( partHelper ); constructor.registerItemDefinition( itemMultiPart ); diff --git a/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java b/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java index 771c8ada..e9a7de28 100644 --- a/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java +++ b/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java @@ -41,13 +41,13 @@ public class DefinitionConstructor private final FeatureRegistry features; private final FeatureHandlerRegistry handlers; - public DefinitionConstructor( FeatureRegistry features, FeatureHandlerRegistry handlers ) + public DefinitionConstructor( final FeatureRegistry features, final FeatureHandlerRegistry handlers ) { this.features = features; this.handlers = handlers; } - public final ITileDefinition registerTileDefinition( IAEFeature feature ) + public final ITileDefinition registerTileDefinition( final IAEFeature feature ) { final IBlockDefinition definition = this.registerBlockDefinition( feature ); @@ -59,7 +59,7 @@ public class DefinitionConstructor throw new IllegalStateException( "No tile definition for " + feature ); } - public final IBlockDefinition registerBlockDefinition( IAEFeature feature ) + public final IBlockDefinition registerBlockDefinition( final IAEFeature feature ) { final IItemDefinition definition = this.registerItemDefinition( feature ); @@ -71,7 +71,7 @@ public class DefinitionConstructor throw new IllegalStateException( "No block definition for " + feature ); } - public final IItemDefinition registerItemDefinition( IAEFeature feature ) + public final IItemDefinition registerItemDefinition( final IAEFeature feature ) { final IFeatureHandler handler = feature.handler(); @@ -86,13 +86,13 @@ public class DefinitionConstructor return definition; } - public final AEColoredItemDefinition constructColoredDefinition( IItemDefinition target, int offset ) + public final AEColoredItemDefinition constructColoredDefinition( final IItemDefinition target, final int offset ) { final ColoredItemDefinition definition = new ColoredItemDefinition(); - for( Item targetItem : target.maybeItem().asSet() ) + for( final Item targetItem : target.maybeItem().asSet() ) { - for( AEColor color : AEColor.VALID_COLORS ) + for( final AEColor color : AEColor.VALID_COLORS ) { final ActivityState state = ActivityState.from( target.isEnabled() ); @@ -103,11 +103,11 @@ public class DefinitionConstructor return definition; } - public final AEColoredItemDefinition constructColoredDefinition( ItemMultiPart target, PartType type ) + public final AEColoredItemDefinition constructColoredDefinition( final ItemMultiPart target, final PartType type ) { final ColoredItemDefinition definition = new ColoredItemDefinition(); - for( AEColor color : AEColor.values() ) + for( final AEColor color : AEColor.values() ) { final ItemStackSrc multiPartSource = target.createPart( type, color ); diff --git a/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java b/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java index 131443d6..edd46ec3 100644 --- a/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java +++ b/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java @@ -31,13 +31,13 @@ public class IMCBlackListSpatial implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { - ItemStack is = m.getItemStackValue(); + final ItemStack is = m.getItemStackValue(); if( is != null ) { - Block blk = Block.getBlockFromItem( is.getItem() ); + final Block blk = Block.getBlockFromItem( is.getItem() ); if( blk != null ) { AEApi.instance().registries().movable().blacklistBlock( blk ); diff --git a/src/main/java/appeng/core/api/imc/IMCGrinder.java b/src/main/java/appeng/core/api/imc/IMCGrinder.java index 6e50050d..135f4ef3 100644 --- a/src/main/java/appeng/core/api/imc/IMCGrinder.java +++ b/src/main/java/appeng/core/api/imc/IMCGrinder.java @@ -63,16 +63,16 @@ import appeng.core.api.IIMCProcessor; public class IMCGrinder implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { - NBTTagCompound msg = m.getNBTValue(); - NBTTagCompound inTag = (NBTTagCompound) msg.getTag( "in" ); - NBTTagCompound outTag = (NBTTagCompound) msg.getTag( "out" ); + final NBTTagCompound msg = m.getNBTValue(); + final NBTTagCompound inTag = (NBTTagCompound) msg.getTag( "in" ); + final NBTTagCompound outTag = (NBTTagCompound) msg.getTag( "out" ); - ItemStack in = ItemStack.loadItemStackFromNBT( inTag ); - ItemStack out = ItemStack.loadItemStackFromNBT( outTag ); + final ItemStack in = ItemStack.loadItemStackFromNBT( inTag ); + final ItemStack out = ItemStack.loadItemStackFromNBT( outTag ); - int turns = msg.getInteger( "turns" ); + final int turns = msg.getInteger( "turns" ); if( in == null ) { @@ -86,15 +86,15 @@ public class IMCGrinder implements IIMCProcessor if( msg.hasKey( "optional" ) ) { - NBTTagCompound optionalTag = (NBTTagCompound) msg.getTag( "optional" ); - ItemStack optional = ItemStack.loadItemStackFromNBT( optionalTag ); + final NBTTagCompound optionalTag = (NBTTagCompound) msg.getTag( "optional" ); + final ItemStack optional = ItemStack.loadItemStackFromNBT( optionalTag ); if( optional == null ) { throw new IllegalStateException( "invalid optional" ); } - float chance = msg.getFloat( "chance" ); + final float chance = msg.getFloat( "chance" ); AEApi.instance().registries().grinder().addRecipe( in, out, optional, chance, turns ); } diff --git a/src/main/java/appeng/core/api/imc/IMCMatterCannon.java b/src/main/java/appeng/core/api/imc/IMCMatterCannon.java index 87126e7e..34d04b9e 100644 --- a/src/main/java/appeng/core/api/imc/IMCMatterCannon.java +++ b/src/main/java/appeng/core/api/imc/IMCMatterCannon.java @@ -43,13 +43,13 @@ public class IMCMatterCannon implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { - NBTTagCompound msg = m.getNBTValue(); - NBTTagCompound item = (NBTTagCompound) msg.getTag( "item" ); + final NBTTagCompound msg = m.getNBTValue(); + final NBTTagCompound item = (NBTTagCompound) msg.getTag( "item" ); - ItemStack ammo = ItemStack.loadItemStackFromNBT( item ); - double weight = msg.getDouble( "weight" ); + final ItemStack ammo = ItemStack.loadItemStackFromNBT( item ); + final double weight = msg.getDouble( "weight" ); if( ammo == null ) { diff --git a/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java b/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java index fb3bd3e4..8241b621 100644 --- a/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java +++ b/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java @@ -44,15 +44,15 @@ public class IMCP2PAttunement implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { - String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase( Locale.ENGLISH ); + final String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase( Locale.ENGLISH ); - TunnelType type = TunnelType.valueOf( key ); + final TunnelType type = TunnelType.valueOf( key ); if( type != null ) { - ItemStack is = m.getItemStackValue(); + final ItemStack is = m.getItemStackValue(); if( is != null ) { AEApi.instance().registries().p2pTunnel().addNewAttunement( is, type ); diff --git a/src/main/java/appeng/core/api/imc/IMCSpatial.java b/src/main/java/appeng/core/api/imc/IMCSpatial.java index 4c0ce5c0..24f9ec69 100644 --- a/src/main/java/appeng/core/api/imc/IMCSpatial.java +++ b/src/main/java/appeng/core/api/imc/IMCSpatial.java @@ -35,15 +35,15 @@ public class IMCSpatial implements IIMCProcessor { @Override - public void process( IMCMessage m ) + public void process( final IMCMessage m ) { try { - Class classInstance = Class.forName( m.getStringValue() ); + final Class classInstance = Class.forName( m.getStringValue() ); AEApi.instance().registries().movable().whiteListTileEntity( classInstance ); } - catch( ClassNotFoundException e ) + catch( final ClassNotFoundException e ) { AELog.info( "Bad Class Registered: " + m.getStringValue() + " by " + m.getSender() ); } diff --git a/src/main/java/appeng/core/crash/BaseCrashEnhancement.java b/src/main/java/appeng/core/crash/BaseCrashEnhancement.java index 94694763..07f899ce 100644 --- a/src/main/java/appeng/core/crash/BaseCrashEnhancement.java +++ b/src/main/java/appeng/core/crash/BaseCrashEnhancement.java @@ -27,7 +27,7 @@ abstract class BaseCrashEnhancement implements ICrashCallable private final String name; private final String value; - public BaseCrashEnhancement( String name, String value ) + public BaseCrashEnhancement( final String name, final String value ) { this.name = name; this.value = value; diff --git a/src/main/java/appeng/core/crash/ModCrashEnhancement.java b/src/main/java/appeng/core/crash/ModCrashEnhancement.java index 951d8ad2..43abe783 100644 --- a/src/main/java/appeng/core/crash/ModCrashEnhancement.java +++ b/src/main/java/appeng/core/crash/ModCrashEnhancement.java @@ -12,7 +12,7 @@ public class ModCrashEnhancement extends BaseCrashEnhancement + net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion + net.minecraftforge.common.ForgeVersion.buildVersion; - public ModCrashEnhancement( CrashInfo output ) + public ModCrashEnhancement( final CrashInfo output ) { super( "AE2 Version", MOD_VERSION ); } diff --git a/src/main/java/appeng/core/features/AEBlockFeatureHandler.java b/src/main/java/appeng/core/features/AEBlockFeatureHandler.java index bebf4ea3..e5417a52 100644 --- a/src/main/java/appeng/core/features/AEBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/AEBlockFeatureHandler.java @@ -40,7 +40,7 @@ public final class AEBlockFeatureHandler implements IFeatureHandler private final boolean enabled; private final BlockDefinition definition; - public AEBlockFeatureHandler( EnumSet features, AEBaseBlock featured, Optional subName ) + public AEBlockFeatureHandler( final EnumSet features, final AEBaseBlock featured, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); @@ -64,11 +64,11 @@ public final class AEBlockFeatureHandler implements IFeatureHandler } @Override - public void register( Side side ) + public void register( final Side side ) { if( this.enabled ) { - String name = this.extractor.get(); + final String name = this.extractor.get(); this.featured.setCreativeTab( CreativeTab.instance ); this.featured.setUnlocalizedName( "appliedenergistics2." + name ); this.featured.setBlockTextureName( name ); diff --git a/src/main/java/appeng/core/features/AECableBusFeatureHandler.java b/src/main/java/appeng/core/features/AECableBusFeatureHandler.java index 2fa30ab6..47644f35 100644 --- a/src/main/java/appeng/core/features/AECableBusFeatureHandler.java +++ b/src/main/java/appeng/core/features/AECableBusFeatureHandler.java @@ -43,7 +43,7 @@ public final class AECableBusFeatureHandler implements IFeatureHandler private final boolean enabled; private final TileDefinition definition; - public AECableBusFeatureHandler( EnumSet features, BlockCableBus featured, Optional subName ) + public AECableBusFeatureHandler( final EnumSet features, final BlockCableBus featured, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); @@ -69,11 +69,11 @@ public final class AECableBusFeatureHandler implements IFeatureHandler * Registration of the {@link TileEntity} will actually be handled by {@link BlockCableBus#setupTile()}. */ @Override - public void register(Side side) + public void register( final Side side) { if( this.enabled ) { - String name = this.extractor.get(); + final String name = this.extractor.get(); this.featured.setCreativeTab( CreativeTab.instance ); this.featured.setUnlocalizedName( /* "tile." */"appliedenergistics2." + name ); this.featured.setBlockTextureName( name ); diff --git a/src/main/java/appeng/core/features/AEFeature.java b/src/main/java/appeng/core/features/AEFeature.java index 2df7006c..0857b12d 100644 --- a/src/main/java/appeng/core/features/AEFeature.java +++ b/src/main/java/appeng/core/features/AEFeature.java @@ -136,12 +136,12 @@ public enum AEFeature public final boolean isVisible; public final boolean defaultValue; - AEFeature( String cat ) + AEFeature( final String cat ) { this( cat, true ); } - AEFeature( String cat, boolean defaultValue ) + AEFeature( final String cat, final boolean defaultValue ) { this.category = cat; this.isVisible = !this.name().equals( "Core" ); diff --git a/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java b/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java index d4ceef1b..4168be8c 100644 --- a/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java @@ -42,7 +42,7 @@ public final class AETileBlockFeatureHandler implements IFeatureHandler private final boolean enabled; private final TileDefinition definition; - public AETileBlockFeatureHandler( EnumSet features, AEBaseTileBlock featured, Optional subName ) + public AETileBlockFeatureHandler( final EnumSet features, final AEBaseTileBlock featured, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); @@ -65,11 +65,11 @@ public final class AETileBlockFeatureHandler implements IFeatureHandler } @Override - public void register( Side side ) + public void register( final Side side ) { if( this.enabled ) { - String name = this.extractor.get(); + final String name = this.extractor.get(); this.featured.setCreativeTab( CreativeTab.instance ); this.featured.setUnlocalizedName( /* "tile." */"appliedenergistics2." + name ); this.featured.setBlockTextureName( name ); diff --git a/src/main/java/appeng/core/features/ActivityState.java b/src/main/java/appeng/core/features/ActivityState.java index a4702fbe..1c4f71d1 100644 --- a/src/main/java/appeng/core/features/ActivityState.java +++ b/src/main/java/appeng/core/features/ActivityState.java @@ -24,7 +24,7 @@ public enum ActivityState Enabled, Disabled; - public static ActivityState from( boolean enabled ) + public static ActivityState from( final boolean enabled ) { if( enabled ) { diff --git a/src/main/java/appeng/core/features/BlockDefinition.java b/src/main/java/appeng/core/features/BlockDefinition.java index d5d8fc5b..3034de90 100644 --- a/src/main/java/appeng/core/features/BlockDefinition.java +++ b/src/main/java/appeng/core/features/BlockDefinition.java @@ -42,7 +42,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition private static final ItemBlockTransformer ITEMBLOCK_TRANSFORMER = new ItemBlockTransformer(); private final Optional block; - public BlockDefinition( final String identifier, Block block, ActivityState state ) + public BlockDefinition( final String identifier, final Block block, final ActivityState state ) { super( identifier, constructItemFromBlock( block ), state ); @@ -66,7 +66,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition * * @return item from block */ - private static Item constructItemFromBlock( Block block ) + private static Item constructItemFromBlock( final Block block ) { final Class itemclass = getItemBlockConstructor( block ); return constructItemBlock( block, itemclass ); @@ -82,7 +82,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition * * @return a {@link Class} extending ItemBlock */ - private static Class getItemBlockConstructor( Block block ) + private static Class getItemBlockConstructor( final Block block ) { if( block instanceof AEBaseBlock ) { @@ -105,22 +105,22 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition * * @return an {@link Item} for the block. Actually always a sub type of {@link ItemBlock} */ - private static Item constructItemBlock( Block block, Class itemclass ) + private static Item constructItemBlock( final Block block, final Class itemclass ) { try { - Object[] itemCtorArgs = {}; - Class[] ctorArgClasses = new Class[itemCtorArgs.length + 1]; + final Object[] itemCtorArgs = {}; + final Class[] ctorArgClasses = new Class[itemCtorArgs.length + 1]; ctorArgClasses[0] = Block.class; for( int idx = 1; idx < ctorArgClasses.length; idx++ ) { ctorArgClasses[idx] = itemCtorArgs[idx - 1].getClass(); } - Constructor itemCtor = itemclass.getConstructor( ctorArgClasses ); + final Constructor itemCtor = itemclass.getConstructor( ctorArgClasses ); return itemCtor.newInstance( ObjectArrays.concat( block, itemCtorArgs ) ); } - catch( Throwable t ) + catch( final Throwable t ) { return null; } @@ -139,13 +139,13 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition } @Override - public final Optional maybeStack( int stackSize ) + public final Optional maybeStack( final int stackSize ) { return this.block.transform( new ItemStackTransformer( stackSize ) ); } @Override - public final boolean isSameAs( IBlockAccess world, BlockPos pos ) + public final boolean isSameAs( final IBlockAccess world, final BlockPos pos ) { return this.isEnabled() && world.getBlockState( pos ).getBlock() == this.block.get(); } @@ -153,7 +153,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition private static class ItemBlockTransformer implements Function { @Override - public ItemBlock apply( Block input ) + public ItemBlock apply( final Block input ) { return new ItemBlock( input ); } @@ -163,7 +163,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition { private final int stackSize; - public ItemStackTransformer( int stackSize ) + public ItemStackTransformer( final int stackSize ) { Preconditions.checkArgument( stackSize > 0 ); @@ -171,7 +171,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition } @Override - public ItemStack apply( Block input ) + public ItemStack apply( final Block input ) { return new ItemStack( input, this.stackSize ); } diff --git a/src/main/java/appeng/core/features/BlockStackSrc.java b/src/main/java/appeng/core/features/BlockStackSrc.java index 8030107d..1f6f18a1 100644 --- a/src/main/java/appeng/core/features/BlockStackSrc.java +++ b/src/main/java/appeng/core/features/BlockStackSrc.java @@ -35,7 +35,7 @@ public class BlockStackSrc implements IStackSrc public final int damage; private final boolean enabled; - public BlockStackSrc( Block block, int damage, ActivityState state ) + public BlockStackSrc( final Block block, final int damage, final ActivityState state ) { Preconditions.checkNotNull( block ); Preconditions.checkArgument( damage >= 0 ); @@ -49,7 +49,7 @@ public class BlockStackSrc implements IStackSrc @Nullable @Override - public ItemStack stack( int i ) + public ItemStack stack( final int i ) { return new ItemStack( this.block, i, this.damage ); } diff --git a/src/main/java/appeng/core/features/ColoredItemDefinition.java b/src/main/java/appeng/core/features/ColoredItemDefinition.java index 4f6cd870..cedde71c 100644 --- a/src/main/java/appeng/core/features/ColoredItemDefinition.java +++ b/src/main/java/appeng/core/features/ColoredItemDefinition.java @@ -32,21 +32,21 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition final ItemStackSrc[] colors = new ItemStackSrc[17]; - public void add( AEColor v, ItemStackSrc is ) + public void add( final AEColor v, final ItemStackSrc is ) { this.colors[v.ordinal()] = is; } @Override - public Block block( AEColor color ) + public Block block( final AEColor color ) { return null; } @Override - public Item item( AEColor color ) + public Item item( final AEColor color ) { - ItemStackSrc is = this.colors[color.ordinal()]; + final ItemStackSrc is = this.colors[color.ordinal()]; if( is == null ) { @@ -57,15 +57,15 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition } @Override - public Class entity( AEColor color ) + public Class entity( final AEColor color ) { return null; } @Override - public ItemStack stack( AEColor color, int stackSize ) + public ItemStack stack( final AEColor color, final int stackSize ) { - ItemStackSrc is = this.colors[color.ordinal()]; + final ItemStackSrc is = this.colors[color.ordinal()]; if( is == null ) { @@ -76,9 +76,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition } @Override - public ItemStack[] allStacks( int stackSize ) + public ItemStack[] allStacks( final int stackSize ) { - ItemStack[] is = new ItemStack[this.colors.length]; + final ItemStack[] is = new ItemStack[this.colors.length]; for( int x = 0; x < is.length; x++ ) { is[x] = this.colors[x].stack( 1 ); @@ -87,9 +87,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition } @Override - public boolean sameAs( AEColor color, ItemStack comparableItem ) + public boolean sameAs( final AEColor color, final ItemStack comparableItem ) { - ItemStackSrc is = this.colors[color.ordinal()]; + final ItemStackSrc is = this.colors[color.ordinal()]; if( comparableItem == null || is == null ) { diff --git a/src/main/java/appeng/core/features/DamagedItemDefinition.java b/src/main/java/appeng/core/features/DamagedItemDefinition.java index 706d68b5..775b032e 100644 --- a/src/main/java/appeng/core/features/DamagedItemDefinition.java +++ b/src/main/java/appeng/core/features/DamagedItemDefinition.java @@ -37,7 +37,7 @@ public final class DamagedItemDefinition implements IItemDefinition private static final ItemTransformer ITEM_TRANSFORMER = new ItemTransformer(); private final Optional source; - public DamagedItemDefinition( @Nonnull String identifier, @Nonnull IStackSrc source ) + public DamagedItemDefinition( @Nonnull final String identifier, @Nonnull final IStackSrc source ) { this.identifier = Preconditions.checkNotNull( identifier ); Preconditions.checkNotNull( source ); @@ -66,7 +66,7 @@ public final class DamagedItemDefinition implements IItemDefinition } @Override - public Optional maybeStack( int stackSize ) + public Optional maybeStack( final int stackSize ) { return this.source.transform( new ItemStackTransformer( stackSize ) ); } @@ -78,7 +78,7 @@ public final class DamagedItemDefinition implements IItemDefinition } @Override - public boolean isSameAs( ItemStack comparableStack ) + public boolean isSameAs( final ItemStack comparableStack ) { if( comparableStack == null ) { @@ -91,7 +91,7 @@ public final class DamagedItemDefinition implements IItemDefinition private static class ItemTransformer implements Function { @Override - public Item apply( IStackSrc input ) + public Item apply( final IStackSrc input ) { return input.getItem(); } @@ -101,7 +101,7 @@ public final class DamagedItemDefinition implements IItemDefinition { private final int stackSize; - public ItemStackTransformer( int stackSize ) + public ItemStackTransformer( final int stackSize ) { Preconditions.checkArgument( stackSize > 0 ); @@ -109,7 +109,7 @@ public final class DamagedItemDefinition implements IItemDefinition } @Override - public ItemStack apply( IStackSrc input ) + public ItemStack apply( final IStackSrc input ) { return input.stack( this.stackSize ); } diff --git a/src/main/java/appeng/core/features/FeatureNameExtractor.java b/src/main/java/appeng/core/features/FeatureNameExtractor.java index e00aaba1..ebe22db6 100644 --- a/src/main/java/appeng/core/features/FeatureNameExtractor.java +++ b/src/main/java/appeng/core/features/FeatureNameExtractor.java @@ -33,7 +33,7 @@ public class FeatureNameExtractor private final Class clazz; private final Optional subName; - public FeatureNameExtractor( Class clazz, Optional subName ) + public FeatureNameExtractor( final Class clazz, final Optional subName ) { this.clazz = clazz; this.subName = subName; diff --git a/src/main/java/appeng/core/features/FeaturedActiveChecker.java b/src/main/java/appeng/core/features/FeaturedActiveChecker.java index 6f0de24a..49b5b885 100644 --- a/src/main/java/appeng/core/features/FeaturedActiveChecker.java +++ b/src/main/java/appeng/core/features/FeaturedActiveChecker.java @@ -28,14 +28,14 @@ public final class FeaturedActiveChecker { private final Set features; - public FeaturedActiveChecker( Set features ) + public FeaturedActiveChecker( final Set features ) { this.features = features; } public ActivityState getActivityState() { - for( AEFeature f : this.features ) + for( final AEFeature f : this.features ) { if( !AEConfig.instance.isFeatureEnabled( f ) ) { diff --git a/src/main/java/appeng/core/features/ItemDefinition.java b/src/main/java/appeng/core/features/ItemDefinition.java index 82634c83..d1f7f15b 100644 --- a/src/main/java/appeng/core/features/ItemDefinition.java +++ b/src/main/java/appeng/core/features/ItemDefinition.java @@ -37,7 +37,7 @@ public class ItemDefinition implements IItemDefinition private final String identifier; private final Optional item; - public ItemDefinition( String identifier, Item item, ActivityState state ) + public ItemDefinition( final String identifier, final Item item, final ActivityState state ) { this.identifier = Preconditions.checkNotNull( identifier ); Preconditions.checkArgument( !identifier.isEmpty() ); @@ -68,7 +68,7 @@ public class ItemDefinition implements IItemDefinition } @Override - public Optional maybeStack( int stackSize ) + public Optional maybeStack( final int stackSize ) { return this.item.transform( new ItemStackTransformer( stackSize ) ); } @@ -80,7 +80,7 @@ public class ItemDefinition implements IItemDefinition } @Override - public final boolean isSameAs( ItemStack comparableStack ) + public final boolean isSameAs( final ItemStack comparableStack ) { return this.isEnabled() && Platform.isSameItemType( comparableStack, this.maybeStack( 1 ).get() ); } @@ -89,7 +89,7 @@ public class ItemDefinition implements IItemDefinition { private final int stackSize; - public ItemStackTransformer( int stackSize ) + public ItemStackTransformer( final int stackSize ) { Preconditions.checkArgument( stackSize > 0 ); @@ -97,7 +97,7 @@ public class ItemDefinition implements IItemDefinition } @Override - public ItemStack apply( Item input ) + public ItemStack apply( final Item input ) { return new ItemStack( input, this.stackSize ); } diff --git a/src/main/java/appeng/core/features/ItemFeatureHandler.java b/src/main/java/appeng/core/features/ItemFeatureHandler.java index c5bca801..3c0e3965 100644 --- a/src/main/java/appeng/core/features/ItemFeatureHandler.java +++ b/src/main/java/appeng/core/features/ItemFeatureHandler.java @@ -41,7 +41,7 @@ public final class ItemFeatureHandler implements IFeatureHandler private final boolean enabled; private final ItemDefinition definition; - public ItemFeatureHandler( EnumSet features, Item item, IAEFeature featured, Optional subName ) + public ItemFeatureHandler( final EnumSet features, final Item item, final IAEFeature featured, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); @@ -64,12 +64,12 @@ public final class ItemFeatureHandler implements IFeatureHandler } @Override - public void register( Side side ) + public void register( final Side side ) { if( this.enabled ) { String name = this.extractor.get(); - String itemPhysicalName = name; + final String itemPhysicalName = name; //this.item.setTextureName( "appliedenergistics2:" + name ); this.item.setUnlocalizedName( "appliedenergistics2." + name ); @@ -102,7 +102,7 @@ public final class ItemFeatureHandler implements IFeatureHandler } } - private void configureIcon( Item item, int meta, String name ) + private void configureIcon( final Item item, final int meta, final String name ) { } } diff --git a/src/main/java/appeng/core/features/ItemStackSrc.java b/src/main/java/appeng/core/features/ItemStackSrc.java index fc4b6f0e..ae7ee32a 100644 --- a/src/main/java/appeng/core/features/ItemStackSrc.java +++ b/src/main/java/appeng/core/features/ItemStackSrc.java @@ -34,7 +34,7 @@ public class ItemStackSrc implements IStackSrc public final int damage; private final boolean enabled; - public ItemStackSrc( Item item, int damage, ActivityState state ) + public ItemStackSrc( final Item item, final int damage, final ActivityState state ) { Preconditions.checkNotNull( item ); Preconditions.checkArgument( damage >= 0 ); @@ -48,7 +48,7 @@ public class ItemStackSrc implements IStackSrc @Nullable @Override - public ItemStack stack( int i ) + public ItemStack stack( final int i ) { return new ItemStack( this.item, i, this.damage ); } diff --git a/src/main/java/appeng/core/features/MaterialStackSrc.java b/src/main/java/appeng/core/features/MaterialStackSrc.java index 5f4bb248..8201f9b7 100644 --- a/src/main/java/appeng/core/features/MaterialStackSrc.java +++ b/src/main/java/appeng/core/features/MaterialStackSrc.java @@ -30,7 +30,7 @@ public class MaterialStackSrc implements IStackSrc { private final MaterialType src; - public MaterialStackSrc( MaterialType src ) + public MaterialStackSrc( final MaterialType src ) { Preconditions.checkNotNull( src ); @@ -38,7 +38,7 @@ public class MaterialStackSrc implements IStackSrc } @Override - public ItemStack stack( int stackSize ) + public ItemStack stack( final int stackSize ) { return this.src.stack( stackSize ); } diff --git a/src/main/java/appeng/core/features/StairBlockFeatureHandler.java b/src/main/java/appeng/core/features/StairBlockFeatureHandler.java index d2b3fee6..d4ed874b 100644 --- a/src/main/java/appeng/core/features/StairBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/StairBlockFeatureHandler.java @@ -41,7 +41,7 @@ public class StairBlockFeatureHandler implements IFeatureHandler private final boolean enabled; private final BlockDefinition definition; - public StairBlockFeatureHandler( EnumSet features, BlockStairs stairs, Optional subName ) + public StairBlockFeatureHandler( final EnumSet features, final BlockStairs stairs, final Optional subName ) { final ActivityState state = new FeaturedActiveChecker( features ).getActivityState(); @@ -64,11 +64,11 @@ public class StairBlockFeatureHandler implements IFeatureHandler } @Override - public final void register( Side side ) + public final void register( final Side side ) { if( this.enabled ) { - String name = this.extractor.get(); + final String name = this.extractor.get(); this.stairs.setCreativeTab( CreativeTab.instance ); this.stairs.setUnlocalizedName( "appliedenergistics2." + name ); diff --git a/src/main/java/appeng/core/features/TileDefinition.java b/src/main/java/appeng/core/features/TileDefinition.java index edf47a5e..23c15169 100644 --- a/src/main/java/appeng/core/features/TileDefinition.java +++ b/src/main/java/appeng/core/features/TileDefinition.java @@ -36,7 +36,7 @@ public final class TileDefinition extends BlockDefinition implements ITileDefini private static final TileEntityTransformer TILEENTITY_TRANSFORMER = new TileEntityTransformer(); private final Optional block; - public TileDefinition( @Nonnull final String identifier, AEBaseTileBlock block, ActivityState state ) + public TileDefinition( @Nonnull final String identifier, final AEBaseTileBlock block, final ActivityState state ) { super( identifier, block, state ); @@ -61,7 +61,7 @@ public final class TileDefinition extends BlockDefinition implements ITileDefini private static class TileEntityTransformer implements Function> { @Override - public Class apply( AEBaseTileBlock input ) + public Class apply( final AEBaseTileBlock input ) { final Class entity = input.getTileEntityClass(); diff --git a/src/main/java/appeng/core/features/registries/CellRegistry.java b/src/main/java/appeng/core/features/registries/CellRegistry.java index 9886e9b2..450487af 100644 --- a/src/main/java/appeng/core/features/registries/CellRegistry.java +++ b/src/main/java/appeng/core/features/registries/CellRegistry.java @@ -41,7 +41,7 @@ public class CellRegistry implements ICellRegistry } @Override - public void addCellHandler( ICellHandler h ) + public void addCellHandler( final ICellHandler h ) { if( h != null ) { @@ -50,13 +50,13 @@ public class CellRegistry implements ICellRegistry } @Override - public boolean isCellHandled( ItemStack is ) + public boolean isCellHandled( final ItemStack is ) { if( is == null ) { return false; } - for( ICellHandler ch : this.handlers ) + for( final ICellHandler ch : this.handlers ) { if( ch.isCell( is ) ) { @@ -67,13 +67,13 @@ public class CellRegistry implements ICellRegistry } @Override - public ICellHandler getHandler( ItemStack is ) + public ICellHandler getHandler( final ItemStack is ) { if( is == null ) { return null; } - for( ICellHandler ch : this.handlers ) + for( final ICellHandler ch : this.handlers ) { if( ch.isCell( is ) ) { @@ -84,13 +84,13 @@ public class CellRegistry implements ICellRegistry } @Override - public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel chan ) + public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel chan ) { if( is == null ) { return null; } - for( ICellHandler ch : this.handlers ) + for( final ICellHandler ch : this.handlers ) { if( ch.isCell( is ) ) { diff --git a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java index 5780608c..888dedc7 100644 --- a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java +++ b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java @@ -43,15 +43,15 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry } @Override - public void addExternalStorageInterface( IExternalStorageHandler ei ) + public void addExternalStorageInterface( final IExternalStorageHandler ei ) { this.Handlers.add( ei ); } @Override - public IExternalStorageHandler getHandler( TileEntity te, EnumFacing d, StorageChannel chan, BaseActionSource mySrc ) + public IExternalStorageHandler getHandler( final TileEntity te, final EnumFacing d, final StorageChannel chan, final BaseActionSource mySrc ) { - for( IExternalStorageHandler x : this.Handlers ) + for( final IExternalStorageHandler x : this.Handlers ) { if( x.canHandle( te, d, chan, mySrc ) ) { diff --git a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java index 78e1ef1c..ea777e36 100644 --- a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java +++ b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java @@ -35,7 +35,7 @@ public final class GridCacheRegistry implements IGridCacheRegistry private final Map, Class> caches = new HashMap, Class>(); @Override - public void registerGridCache( Class iface, Class implementation ) + public void registerGridCache( final Class iface, final Class implementation ) { if( iface.isAssignableFrom( implementation ) ) { @@ -48,33 +48,33 @@ public final class GridCacheRegistry implements IGridCacheRegistry } @Override - public HashMap, IGridCache> createCacheInstance( IGrid g ) + public HashMap, IGridCache> createCacheInstance( final IGrid g ) { - HashMap, IGridCache> map = new HashMap, IGridCache>(); + final HashMap, IGridCache> map = new HashMap, IGridCache>(); - for( Class iface : this.caches.keySet() ) + for( final Class iface : this.caches.keySet() ) { try { - Constructor c = this.caches.get( iface ).getConstructor( IGrid.class ); + final Constructor c = this.caches.get( iface ).getConstructor( IGrid.class ); map.put( iface, c.newInstance( g ) ); } - catch( NoSuchMethodException e ) + catch( final NoSuchMethodException e ) { AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." ); throw new IllegalArgumentException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." ); throw new IllegalStateException( e ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." ); throw new IllegalStateException( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." ); throw new IllegalStateException( e ); diff --git a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java index addb24ba..eb57e2d0 100644 --- a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java +++ b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java @@ -82,7 +82,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public void addRecipe( ItemStack in, ItemStack out, int cost ) + public void addRecipe( final ItemStack in, final ItemStack out, final int cost ) { if( in == null || out == null ) { @@ -95,7 +95,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int cost ) + public void addRecipe( final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, final int cost ) { if( in == null || ( optional == null && out == null ) ) { @@ -108,7 +108,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int cost ) + public void addRecipe( final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, final ItemStack optional2, final float chance2, final int cost ) { if( in == null || ( optional == null && out == null && optional2 == null ) ) { @@ -120,9 +120,9 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), this.copy( optional2 ), chance, chance2, cost ) ); } - private void injectRecipe( AppEngGrinderRecipe appEngGrinderRecipe ) + private void injectRecipe( final AppEngGrinderRecipe appEngGrinderRecipe ) { - for( IGrinderEntry gr : this.recipes ) + for( final IGrinderEntry gr : this.recipes ) { if( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) ) { @@ -133,7 +133,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene this.recipes.add( appEngGrinderRecipe ); } - private ItemStack copy( ItemStack is ) + private ItemStack copy( final ItemStack is ) { if( is != null ) { @@ -143,12 +143,12 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public IGrinderEntry getRecipeForInput( ItemStack input ) + public IGrinderEntry getRecipeForInput( final ItemStack input ) { this.log( "Looking up recipe for " + Platform.getItemDisplayName( input ) ); if( input != null ) { - for( IGrinderEntry r : this.recipes ) + for( final IGrinderEntry r : this.recipes ) { if( Platform.isSameItem( input, r.getInput() ) ) { @@ -163,12 +163,12 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene return null; } - public void log( String o ) + public void log( final String o ) { AELog.grinder( o ); } - private int getDustToOreRatio( String name ) + private int getDustToOreRatio( final String name ) { if( name.equals( "Obsidian" ) ) { @@ -185,7 +185,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene return 2; } - private void addOre( String name, ItemStack item ) + private void addOre( final String name, final ItemStack item ) { if( item == null ) { @@ -197,11 +197,11 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene if( this.dusts.containsKey( name ) ) { - ItemStack is = this.dusts.get( name ).copy(); - int ratio = this.getDustToOreRatio( name ); + final ItemStack is = this.dusts.get( name ).copy(); + final int ratio = this.getDustToOreRatio( name ); if( ratio > 1 ) { - ItemStack extra = is.copy(); + final ItemStack extra = is.copy(); extra.stackSize = ratio - 1; this.addRecipe( item, is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 ); } @@ -212,7 +212,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } } - private void addIngot( String name, ItemStack item ) + private void addIngot( final String name, final ItemStack item ) { if( item == null ) { @@ -228,7 +228,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } } - private void addDust( String name, ItemStack item ) + private void addDust( final String name, final ItemStack item ) { if( item == null ) { @@ -244,16 +244,16 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene this.dusts.put( name, item ); - for( Entry d : this.ores.entrySet() ) + for( final Entry d : this.ores.entrySet() ) { if( name.equals( d.getValue() ) ) { - ItemStack is = item.copy(); + final ItemStack is = item.copy(); is.stackSize = 1; - int ratio = this.getDustToOreRatio( name ); + final int ratio = this.getDustToOreRatio( name ); if( ratio > 1 ) { - ItemStack extra = is.copy(); + final ItemStack extra = is.copy(); extra.stackSize = ratio - 1; this.addRecipe( d.getKey(), is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 ); } @@ -264,7 +264,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } } - for( Entry d : this.ingots.entrySet() ) + for( final Entry d : this.ingots.entrySet() ) { if( name.equals( d.getValue() ) ) { @@ -274,11 +274,11 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene } @Override - public void oreRegistered( String name, ItemStack item ) + public void oreRegistered( final String name, final ItemStack item ) { if( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name.startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) ) { - for( String ore : AEConfig.instance.grinderOres ) + for( final String ore : AEConfig.instance.grinderOres ) { if( name.equals( "ore" + ore ) ) { diff --git a/src/main/java/appeng/core/features/registries/InscriberRegistry.java b/src/main/java/appeng/core/features/registries/InscriberRegistry.java index 0b788fad..f98afc6a 100644 --- a/src/main/java/appeng/core/features/registries/InscriberRegistry.java +++ b/src/main/java/appeng/core/features/registries/InscriberRegistry.java @@ -84,7 +84,7 @@ public final class InscriberRegistry implements IInscriberRegistry } @Override - public void addRecipe( IInscriberRecipe recipe ) + public void addRecipe( final IInscriberRecipe recipe ) { if( recipe == null ) { @@ -100,7 +100,7 @@ public final class InscriberRegistry implements IInscriberRegistry } @Override - public void removeRecipe( IInscriberRecipe toBeRemovedRecipe ) + public void removeRecipe( final IInscriberRecipe toBeRemovedRecipe ) { for( final Iterator iterator = this.recipes.iterator(); iterator.hasNext(); ) { @@ -126,7 +126,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withInputs( @Nonnull Collection inputs ) + public Builder withInputs( @Nonnull final Collection inputs ) { this.inputs = new ArrayList( inputs.size() ); this.inputs.addAll( inputs ); @@ -136,7 +136,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withOutput( @Nonnull ItemStack output ) + public Builder withOutput( @Nonnull final ItemStack output ) { this.output = output; @@ -145,7 +145,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withTopOptional( @Nonnull ItemStack topOptional ) + public Builder withTopOptional( @Nonnull final ItemStack topOptional ) { this.topOptional = topOptional; @@ -154,7 +154,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withBottomOptional( @Nonnull ItemStack bottomOptional ) + public Builder withBottomOptional( @Nonnull final ItemStack bottomOptional ) { this.bottomOptional = bottomOptional; @@ -163,7 +163,7 @@ public final class InscriberRegistry implements IInscriberRegistry @Nonnull @Override - public Builder withProcessType( @Nonnull InscriberProcessType type ) + public Builder withProcessType( @Nonnull final InscriberProcessType type ) { this.type = type; diff --git a/src/main/java/appeng/core/features/registries/LocatableRegistry.java b/src/main/java/appeng/core/features/registries/LocatableRegistry.java index 872cab47..e9df61cb 100644 --- a/src/main/java/appeng/core/features/registries/LocatableRegistry.java +++ b/src/main/java/appeng/core/features/registries/LocatableRegistry.java @@ -42,7 +42,7 @@ public final class LocatableRegistry implements ILocatableRegistry } @SubscribeEvent - public void updateLocatable( LocatableEventAnnounce e ) + public void updateLocatable( final LocatableEventAnnounce e ) { if( Platform.isClient() ) { @@ -64,13 +64,13 @@ public final class LocatableRegistry implements ILocatableRegistry */ @Override @Deprecated - public Object findLocatableBySerial( long ser ) + public Object findLocatableBySerial( final long ser ) { return this.set.get( ser ); } @Override - public ILocatable getLocatableBy( long serial ) + public ILocatable getLocatableBy( final long serial ) { return this.set.get( serial ); } diff --git a/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java b/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java index 73782e26..77f974ff 100644 --- a/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java +++ b/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java @@ -41,15 +41,15 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo } @Override - public void registerAmmo( ItemStack ammo, double weight ) + public void registerAmmo( final ItemStack ammo, final double weight ) { this.DamageModifiers.put( ammo, weight ); } @Override - public float getPenetration( ItemStack is ) + public float getPenetration( final ItemStack is ) { - for( ItemStack o : this.DamageModifiers.keySet() ) + for( final ItemStack o : this.DamageModifiers.keySet() ) { if( Platform.isSameItem( o, is ) ) { @@ -60,7 +60,7 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo } @Override - public void oreRegistered( String name, ItemStack item ) + public void oreRegistered( final String name, final ItemStack item ) { if( !( name.startsWith( "berry" ) || name.startsWith( "nugget" ) ) ) { @@ -140,7 +140,7 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo this.considerItem( name, item, "Electrum", ( 107.8682 + 196.96655 ) / 2.0 ); } - private void considerItem( String ore, ItemStack item, String name, double weight ) + private void considerItem( final String ore, final ItemStack item, final String name, final double weight ) { if( ore.equals( "berry" + name ) || ore.equals( "nugget" + name ) ) { diff --git a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java index 46314ce7..f53c90b1 100644 --- a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java +++ b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java @@ -45,13 +45,13 @@ public class MovableTileRegistry implements IMovableRegistry private final IMovableHandler nullHandler = new DefaultSpatialHandler(); @Override - public void blacklistBlock( Block blk ) + public void blacklistBlock( final Block blk ) { this.blacklisted.add( blk ); } @Override - public void whiteListTileEntity( Class c ) + public void whiteListTileEntity( final Class c ) { if( c.getName().equals( TileEntity.class.getName() ) ) { @@ -62,9 +62,9 @@ public class MovableTileRegistry implements IMovableRegistry } @Override - public boolean askToMove( TileEntity te ) + public boolean askToMove( final TileEntity te ) { - Class myClass = te.getClass(); + final Class myClass = te.getClass(); IMovableHandler canMove = this.Valid.get( myClass ); if( canMove == null ) @@ -86,12 +86,12 @@ public class MovableTileRegistry implements IMovableRegistry return false; } - private IMovableHandler testClass( Class myClass, TileEntity te ) + private IMovableHandler testClass( final Class myClass, final TileEntity te ) { IMovableHandler handler = null; // ask handlers... - for( IMovableHandler han : this.handlers ) + for( final IMovableHandler han : this.handlers ) { if( han.canHandle( myClass, te ) ) { @@ -115,7 +115,7 @@ public class MovableTileRegistry implements IMovableRegistry } // if you are on the white list your opted in. - for( Class testClass : this.test ) + for( final Class testClass : this.test ) { if( testClass.isAssignableFrom( myClass ) ) { @@ -129,26 +129,26 @@ public class MovableTileRegistry implements IMovableRegistry } @Override - public void doneMoving( TileEntity te ) + public void doneMoving( final TileEntity te ) { if( te instanceof IMovableTile ) { - IMovableTile mt = (IMovableTile) te; + final IMovableTile mt = (IMovableTile) te; mt.doneMoving(); } } @Override - public void addHandler( IMovableHandler han ) + public void addHandler( final IMovableHandler han ) { this.handlers.add( han ); } @Override - public IMovableHandler getHandler( TileEntity te ) + public IMovableHandler getHandler( final TileEntity te ) { - Class myClass = te.getClass(); - IMovableHandler h = this.Valid.get( myClass ); + final Class myClass = te.getClass(); + final IMovableHandler h = this.Valid.get( myClass ); return h == null ? this.dsh : h; } @@ -159,7 +159,7 @@ public class MovableTileRegistry implements IMovableRegistry } @Override - public boolean isBlacklisted( Block blk ) + public boolean isBlacklisted( final Block blk ) { return this.blacklisted.contains( blk ); } diff --git a/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java b/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java index dbbda85f..be7a7f7d 100644 --- a/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java +++ b/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java @@ -107,7 +107,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry this.addNewAttunement( this.getModItem( "EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID ); this.addNewAttunement( this.getModItem( "ThermalDynamics", "ThermalDynamics_16", 0 ), TunnelType.FLUID ); - for( AEColor c : AEColor.values() ) + for( final AEColor c : AEColor.values() ) { this.addNewAttunement( parts.cableGlass().stack( c, 1 ), TunnelType.ME ); this.addNewAttunement( parts.cableCovered().stack( c, 1 ), TunnelType.ME ); @@ -117,7 +117,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry } @Override - public void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type ) + public void addNewAttunement( @Nullable final ItemStack trigger, @Nullable final TunnelType type ) { if( type == null || trigger == null ) { @@ -129,7 +129,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry @Nullable @Override - public TunnelType getTunnelTypeByItem( ItemStack trigger ) + public TunnelType getTunnelTypeByItem( final ItemStack trigger ) { if( trigger != null ) { @@ -138,7 +138,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry return TunnelType.FLUID; } - for( ItemStack is : this.tunnels.keySet() ) + for( final ItemStack is : this.tunnels.keySet() ) { if( is.getItem() == trigger.getItem() && is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) { @@ -156,22 +156,22 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry } @Nullable - private ItemStack getModItem( String modID, String name, int meta ) + private ItemStack getModItem( final String modID, final String name, final int meta ) { - Item item = GameRegistry.findItem( modID, name ); + final Item item = GameRegistry.findItem( modID, name ); if( item == null ) { return null; } - ItemStack myItemStack = new ItemStack( item, 1, meta ); + final ItemStack myItemStack = new ItemStack( item, 1, meta ); return myItemStack; } - private void addNewAttunement( IItemDefinition definition, TunnelType type ) + private void addNewAttunement( final IItemDefinition definition, final TunnelType type ) { - for( ItemStack definitionStack : definition.maybeStack( 1 ).asSet() ) + for( final ItemStack definitionStack : definition.maybeStack( 1 ).asSet() ) { this.addNewAttunement( definitionStack, type ); } diff --git a/src/main/java/appeng/core/features/registries/PlayerRegistry.java b/src/main/java/appeng/core/features/registries/PlayerRegistry.java index 0661b1e3..5fdcdeb9 100644 --- a/src/main/java/appeng/core/features/registries/PlayerRegistry.java +++ b/src/main/java/appeng/core/features/registries/PlayerRegistry.java @@ -32,7 +32,7 @@ public class PlayerRegistry implements IPlayerRegistry { @Override - public int getID( GameProfile username ) + public int getID( final GameProfile username ) { if( username == null || !username.isComplete() ) { @@ -43,14 +43,14 @@ public class PlayerRegistry implements IPlayerRegistry } @Override - public int getID( EntityPlayer player ) + public int getID( final EntityPlayer player ) { return this.getID( player.getGameProfile() ); } @Nullable @Override - public EntityPlayer findPlayer( int playerID ) + public EntityPlayer findPlayer( final int playerID ) { return WorldData.instance().playerData().getPlayerFromID( playerID ); } diff --git a/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java b/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java index 24d0f961..da5a6169 100644 --- a/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java +++ b/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java @@ -46,22 +46,22 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry private final Collection resolvers = new LinkedList(); @Override - public void addNewCraftHandler( String name, Class handler ) + public void addNewCraftHandler( final String name, final Class handler ) { this.handlers.put( name.toLowerCase( Locale.ENGLISH ), handler ); } @Override - public void addNewSubItemResolver( ISubItemResolver sir ) + public void addNewSubItemResolver( final ISubItemResolver sir ) { this.resolvers.add( sir ); } @Nullable @Override - public ICraftHandler getCraftHandlerFor( String name ) + public ICraftHandler getCraftHandlerFor( final String name ) { - Class clz = this.handlers.get( name ); + final Class clz = this.handlers.get( name ); if( clz == null ) { return null; @@ -70,7 +70,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry { return clz.newInstance(); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.severe( "Error Caused when trying to construct " + clz.getName() ); AELog.error( e ); @@ -89,9 +89,9 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry @Nullable @Override - public Object resolveItem( String nameSpace, String itemName ) + public Object resolveItem( final String nameSpace, final String itemName ) { - for( ISubItemResolver sir : this.resolvers ) + for( final ISubItemResolver sir : this.resolvers ) { Object rr = null; @@ -99,7 +99,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry { rr = sir.resolveItemByName( nameSpace, itemName ); } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } diff --git a/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java b/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java index 3c43c21e..e8808a27 100644 --- a/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java +++ b/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java @@ -39,11 +39,11 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry } @Override - public IItemComparison getSpecialComparison( ItemStack stack ) + public IItemComparison getSpecialComparison( final ItemStack stack ) { - for( IItemComparisonProvider i : this.CompRegistry ) + for( final IItemComparisonProvider i : this.CompRegistry ) { - IItemComparison comp = i.getComparison( stack ); + final IItemComparison comp = i.getComparison( stack ); if( comp != null ) { return comp; @@ -54,7 +54,7 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry } @Override - public void addComparisonProvider( IItemComparisonProvider prov ) + public void addComparisonProvider( final IItemComparisonProvider prov ) { this.CompRegistry.add( prov ); } diff --git a/src/main/java/appeng/core/features/registries/WirelessRangeResult.java b/src/main/java/appeng/core/features/registries/WirelessRangeResult.java index 2895c47d..baf16b59 100644 --- a/src/main/java/appeng/core/features/registries/WirelessRangeResult.java +++ b/src/main/java/appeng/core/features/registries/WirelessRangeResult.java @@ -28,7 +28,7 @@ public class WirelessRangeResult public final float dist; public final TileEntity te; - public WirelessRangeResult( TileEntity t, float d ) + public WirelessRangeResult( final TileEntity t, final float d ) { this.dist = d; this.te = t; diff --git a/src/main/java/appeng/core/features/registries/WirelessRegistry.java b/src/main/java/appeng/core/features/registries/WirelessRegistry.java index 28a922c5..0dc83004 100644 --- a/src/main/java/appeng/core/features/registries/WirelessRegistry.java +++ b/src/main/java/appeng/core/features/registries/WirelessRegistry.java @@ -44,7 +44,7 @@ public final class WirelessRegistry implements IWirelessTermRegistry } @Override - public void registerWirelessHandler( IWirelessTermHandler handler ) + public void registerWirelessHandler( final IWirelessTermHandler handler ) { if( handler != null ) { @@ -53,9 +53,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry } @Override - public boolean isWirelessTerminal( ItemStack is ) + public boolean isWirelessTerminal( final ItemStack is ) { - for( IWirelessTermHandler h : this.handlers ) + for( final IWirelessTermHandler h : this.handlers ) { if( h.canHandle( is ) ) { @@ -66,9 +66,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry } @Override - public IWirelessTermHandler getWirelessTerminalHandler( ItemStack is ) + public IWirelessTermHandler getWirelessTerminalHandler( final ItemStack is ) { - for( IWirelessTermHandler h : this.handlers ) + for( final IWirelessTermHandler h : this.handlers ) { if( h.canHandle( is ) ) { @@ -79,7 +79,7 @@ public final class WirelessRegistry implements IWirelessTermRegistry } @Override - public void openWirelessTerminalGui( ItemStack item, World w, EntityPlayer player ) + public void openWirelessTerminalGui( final ItemStack item, final World w, final EntityPlayer player ) { if( Platform.isClient() ) { diff --git a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java index 9ccdec56..e9d18769 100644 --- a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java +++ b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java @@ -37,14 +37,14 @@ public final class WorldGenRegistry implements IWorldGen this.types = new TypeSet[WorldGenType.values().length]; - for( WorldGenType type : WorldGenType.values() ) + for( final WorldGenType type : WorldGenType.values() ) { this.types[type.ordinal()] = new TypeSet(); } } @Override - public void disableWorldGenForProviderID( WorldGenType type, Class provider ) + public void disableWorldGenForProviderID( final WorldGenType type, final Class provider ) { if( type == null ) { @@ -60,7 +60,7 @@ public final class WorldGenRegistry implements IWorldGen } @Override - public void enableWorldGenForDimension( WorldGenType type, int dimensionID ) + public void enableWorldGenForDimension( final WorldGenType type, final int dimensionID ) { if( type == null ) { @@ -71,7 +71,7 @@ public final class WorldGenRegistry implements IWorldGen } @Override - public void disableWorldGenForDimension( WorldGenType type, int dimensionID ) + public void disableWorldGenForDimension( final WorldGenType type, final int dimensionID ) { if( type == null ) { @@ -82,7 +82,7 @@ public final class WorldGenRegistry implements IWorldGen } @Override - public boolean isWorldGenEnabled( WorldGenType type, World w ) + public boolean isWorldGenEnabled( final WorldGenType type, final World w ) { if( type == null ) { @@ -94,9 +94,9 @@ public final class WorldGenRegistry implements IWorldGen throw new IllegalArgumentException( "Bad Provider Passed" ); } - boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() ); - boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.getDimensionId() ); - boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.getDimensionId() ); + final boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() ); + final boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.getDimensionId() ); + final boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.getDimensionId() ); if( isBadProvider || isBadDimension ) { diff --git a/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java b/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java index 1e56482f..6dc53099 100644 --- a/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java @@ -37,14 +37,14 @@ public class AppEngGrinderRecipe implements IGrinderEntry private int energy; - public AppEngGrinderRecipe( ItemStack a, ItemStack b, int cost ) + public AppEngGrinderRecipe( final ItemStack a, final ItemStack b, final int cost ) { this.in = a; this.out = b; this.energy = cost; } - public AppEngGrinderRecipe( ItemStack a, ItemStack b, ItemStack c, float chance, int cost ) + public AppEngGrinderRecipe( final ItemStack a, final ItemStack b, final ItemStack c, final float chance, final int cost ) { this.in = a; this.out = b; @@ -55,7 +55,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry this.energy = cost; } - public AppEngGrinderRecipe( ItemStack a, ItemStack b, ItemStack c, ItemStack d, float chance, float chance2, int cost ) + public AppEngGrinderRecipe( final ItemStack a, final ItemStack b, final ItemStack c, final ItemStack d, final float chance, final float chance2, final int cost ) { this.in = a; this.out = b; @@ -76,7 +76,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setInput( ItemStack i ) + public void setInput( final ItemStack i ) { this.in = i.copy(); } @@ -88,7 +88,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setOutput( ItemStack o ) + public void setOutput( final ItemStack o ) { this.out = o.copy(); } @@ -106,7 +106,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setOptionalOutput( ItemStack output, float chance ) + public void setOptionalOutput( final ItemStack output, final float chance ) { this.optionalOutput = output.copy(); this.optionalChance = chance; @@ -119,7 +119,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setSecondOptionalOutput( ItemStack output, float chance ) + public void setSecondOptionalOutput( final ItemStack output, final float chance ) { this.optionalChance2 = chance; this.optionalOutput2 = output.copy(); @@ -138,7 +138,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry } @Override - public void setEnergyCost( int c ) + public void setEnergyCost( final int c ) { this.energy = c; } diff --git a/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java b/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java index 40944ac1..825703b9 100644 --- a/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java +++ b/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java @@ -43,13 +43,13 @@ public class BasicCellHandler implements ICellHandler { @Override - public boolean isCell( ItemStack is ) + public boolean isCell( final ItemStack is ) { return CellInventory.isCell( is ); } @Override - public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel channel ) + public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel channel ) { if( channel == StorageChannel.ITEMS ) { @@ -77,26 +77,26 @@ public class BasicCellHandler implements ICellHandler } @Override - public void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan ) + public void openChestGui( final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler, final IMEInventoryHandler inv, final ItemStack is, final StorageChannel chan ) { Platform.openGUI( player, (TileEntity) chest, AEPartLocation.fromFacing( chest.getUp() ), GuiBridge.GUI_ME ); } @Override - public int getStatusForCell( ItemStack is, IMEInventory handler ) + public int getStatusForCell( final ItemStack is, final IMEInventory handler ) { if( handler instanceof CellInventoryHandler ) { - CellInventoryHandler ci = (CellInventoryHandler) handler; + final CellInventoryHandler ci = (CellInventoryHandler) handler; return ci.getStatusForCell(); } return 0; } @Override - public double cellIdleDrain( ItemStack is, IMEInventory handler ) + public double cellIdleDrain( final ItemStack is, final IMEInventory handler ) { - ICellInventory inv = ( (ICellInventoryHandler) handler ).getCellInv(); + final ICellInventory inv = ( (ICellInventoryHandler) handler ).getCellInv(); return inv.getIdleDrain(); } } diff --git a/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java b/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java index 1876fd81..fb372c04 100644 --- a/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java +++ b/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java @@ -41,13 +41,13 @@ public class CreativeCellHandler implements ICellHandler { @Override - public boolean isCell( ItemStack is ) + public boolean isCell( final ItemStack is ) { return is != null && is.getItem() instanceof ItemCreativeStorageCell; } @Override - public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel channel ) + public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel channel ) { if( channel == StorageChannel.ITEMS && is != null && is.getItem() instanceof ItemCreativeStorageCell ) { @@ -75,19 +75,19 @@ public class CreativeCellHandler implements ICellHandler } @Override - public void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan ) + public void openChestGui( final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler, final IMEInventoryHandler inv, final ItemStack is, final StorageChannel chan ) { Platform.openGUI( player, (TileEntity) chest, AEPartLocation.fromFacing( chest.getUp() ), GuiBridge.GUI_ME ); } @Override - public int getStatusForCell( ItemStack is, IMEInventory handler ) + public int getStatusForCell( final ItemStack is, final IMEInventory handler ) { return 2; } @Override - public double cellIdleDrain( ItemStack is, IMEInventory handler ) + public double cellIdleDrain( final ItemStack is, final IMEInventory handler ) { return 0; } diff --git a/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java b/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java index 068df26c..c23b09f9 100644 --- a/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java +++ b/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java @@ -34,15 +34,15 @@ public class ExternalIInv implements IExternalStorageHandler { @Override - public boolean canHandle( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource mySrc ) + public boolean canHandle( final TileEntity te, final EnumFacing d, final StorageChannel channel, final BaseActionSource mySrc ) { return channel == StorageChannel.ITEMS && te instanceof IInventory; } @Override - public IMEInventory getInventory( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource src ) + public IMEInventory getInventory( final TileEntity te, final EnumFacing d, final StorageChannel channel, final BaseActionSource src ) { - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, d ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, d ); if( channel == StorageChannel.ITEMS && ad != null ) { diff --git a/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java b/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java index d6f12d5a..265f018e 100644 --- a/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java @@ -19,7 +19,7 @@ import appeng.api.features.InscriberProcessType; */ public class InscriberInscribeRecipe extends InscriberRecipe { - public InscriberInscribeRecipe( @Nonnull Collection inputs, @Nonnull ItemStack output, @Nullable ItemStack top, @Nullable ItemStack bot ) + public InscriberInscribeRecipe( @Nonnull final Collection inputs, @Nonnull final ItemStack output, @Nullable final ItemStack top, @Nullable final ItemStack bot ) { super( inputs, output, top, bot, InscriberProcessType.Inscribe ); } diff --git a/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java b/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java index 2456445f..b9db8a64 100644 --- a/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java @@ -39,7 +39,7 @@ public class InscriberRecipe implements IInscriberRecipe @Nonnull private final InscriberProcessType type; - public InscriberRecipe( @Nonnull Collection inputs, @Nonnull ItemStack output, @Nullable ItemStack top, @Nullable ItemStack bot, @Nonnull InscriberProcessType type ) + public InscriberRecipe( @Nonnull final Collection inputs, @Nonnull final ItemStack output, @Nullable final ItemStack top, @Nullable final ItemStack bot, @Nonnull final InscriberProcessType type ) { this.inputs = new ArrayList( inputs.size() ); this.inputs.addAll( inputs ); @@ -87,7 +87,7 @@ public class InscriberRecipe implements IInscriberRecipe } @Override - public boolean equals( Object o ) + public boolean equals( final Object o ) { if( this == o ) { @@ -98,7 +98,7 @@ public class InscriberRecipe implements IInscriberRecipe return false; } - IInscriberRecipe that = (IInscriberRecipe) o; + final IInscriberRecipe that = (IInscriberRecipe) o; if( !this.inputs.equals( that.getInputs() ) ) { diff --git a/src/main/java/appeng/core/localization/ButtonToolTips.java b/src/main/java/appeng/core/localization/ButtonToolTips.java index 86a58836..b740b969 100644 --- a/src/main/java/appeng/core/localization/ButtonToolTips.java +++ b/src/main/java/appeng/core/localization/ButtonToolTips.java @@ -72,7 +72,7 @@ public enum ButtonToolTips this.root = "gui.tooltips.appliedenergistics2"; } - ButtonToolTips( String r ) + ButtonToolTips( final String r ) { this.root = r; } diff --git a/src/main/java/appeng/core/localization/GuiText.java b/src/main/java/appeng/core/localization/GuiText.java index 6000d8ad..4d251ed7 100644 --- a/src/main/java/appeng/core/localization/GuiText.java +++ b/src/main/java/appeng/core/localization/GuiText.java @@ -90,7 +90,7 @@ public enum GuiText this.root = "gui.appliedenergistics2"; } - GuiText( String r ) + GuiText( final String r ) { this.root = r; } diff --git a/src/main/java/appeng/core/localization/WailaText.java b/src/main/java/appeng/core/localization/WailaText.java index bfcc5f04..b41cbcb0 100644 --- a/src/main/java/appeng/core/localization/WailaText.java +++ b/src/main/java/appeng/core/localization/WailaText.java @@ -39,7 +39,7 @@ public enum WailaText this.root = "waila.appliedenergistics2"; } - WailaText( String r ) + WailaText( final String r ) { this.root = r; } diff --git a/src/main/java/appeng/core/settings/TickRates.java b/src/main/java/appeng/core/settings/TickRates.java index cf19a87a..35b2930e 100644 --- a/src/main/java/appeng/core/settings/TickRates.java +++ b/src/main/java/appeng/core/settings/TickRates.java @@ -54,13 +54,13 @@ public enum TickRates public int min; public int max; - TickRates( int min, int max ) + TickRates( final int min, final int max ) { this.min = min; this.max = max; } - public void Load( AEConfig config ) + public void Load( final AEConfig config ) { config.addCustomCategoryComment( "TickRates", " Min / Max Tickrates for dynamic ticking, most of these components also use sleeping, to prevent constant ticking, adjust with care, non standard rates are not supported or tested." ); this.min = config.get( "TickRates", this.name() + ".min", this.min ).getInt( this.min ); diff --git a/src/main/java/appeng/core/stats/AchievementCraftingHandler.java b/src/main/java/appeng/core/stats/AchievementCraftingHandler.java index b9362116..2e235ea9 100644 --- a/src/main/java/appeng/core/stats/AchievementCraftingHandler.java +++ b/src/main/java/appeng/core/stats/AchievementCraftingHandler.java @@ -35,20 +35,20 @@ public class AchievementCraftingHandler { private final PlayerDifferentiator differentiator; - public AchievementCraftingHandler( PlayerDifferentiator differentiator ) + public AchievementCraftingHandler( final PlayerDifferentiator differentiator ) { this.differentiator = differentiator; } @SubscribeEvent - public void onPlayerCraftingEvent( PlayerEvent.ItemCraftedEvent event ) + public void onPlayerCraftingEvent( final PlayerEvent.ItemCraftedEvent event ) { if( this.differentiator.isNoPlayer( event.player ) || event.crafting == null ) { return; } - for( Achievements achievement : Achievements.values() ) + for( final Achievements achievement : Achievements.values() ) { switch( achievement.type ) { diff --git a/src/main/java/appeng/core/stats/AchievementPickupHandler.java b/src/main/java/appeng/core/stats/AchievementPickupHandler.java index 2f5dfb13..1447aed0 100644 --- a/src/main/java/appeng/core/stats/AchievementPickupHandler.java +++ b/src/main/java/appeng/core/stats/AchievementPickupHandler.java @@ -36,22 +36,22 @@ public class AchievementPickupHandler { private final PlayerDifferentiator differentiator; - public AchievementPickupHandler( PlayerDifferentiator differentiator ) + public AchievementPickupHandler( final PlayerDifferentiator differentiator ) { this.differentiator = differentiator; } @SubscribeEvent - public void onItemPickUp( PlayerEvent.ItemPickupEvent event ) + public void onItemPickUp( final PlayerEvent.ItemPickupEvent event ) { if( this.differentiator.isNoPlayer( event.player ) || event.pickedUp == null || event.pickedUp.getEntityItem() == null ) { return; } - ItemStack is = event.pickedUp.getEntityItem(); + final ItemStack is = event.pickedUp.getEntityItem(); - for( Achievements achievement : Achievements.values() ) + for( final Achievements achievement : Achievements.values() ) { if( achievement.type == AchievementType.Pickup && Platform.isSameItemPrecise( achievement.stack, is ) ) { diff --git a/src/main/java/appeng/core/stats/Achievements.java b/src/main/java/appeng/core/stats/Achievements.java index 8aab0ba7..51a0ab2c 100644 --- a/src/main/java/appeng/core/stats/Achievements.java +++ b/src/main/java/appeng/core/stats/Achievements.java @@ -113,7 +113,7 @@ public enum Achievements private Achievement parent; private Achievement stat; - Achievements( int x, int y, AEColoredItemDefinition which, AchievementType type ) + Achievements( final int x, final int y, final AEColoredItemDefinition which, final AchievementType type ) { this.stack = ( which != null ) ? which.stack( AEColor.Transparent, 1 ) : null; this.type = type; @@ -121,7 +121,7 @@ public enum Achievements this.y = y; } - Achievements( int x, int y, IItemDefinition which, AchievementType type ) + Achievements( final int x, final int y, final IItemDefinition which, final AchievementType type ) { this.stack = which.maybeStack( 1 ).orNull(); this.type = type; @@ -129,7 +129,7 @@ public enum Achievements this.y = y; } - Achievements( int x, int y, ItemStack which, AchievementType type ) + Achievements( final int x, final int y, final ItemStack which, final AchievementType type ) { this.stack = which; this.type = type; @@ -137,7 +137,7 @@ public enum Achievements this.y = y; } - public void setParent( Achievements parent ) + public void setParent( final Achievements parent ) { this.parent = parent.getAchievement(); } @@ -153,7 +153,7 @@ public enum Achievements return this.stat; } - public void addToPlayer( EntityPlayer player ) + public void addToPlayer( final EntityPlayer player ) { player.addStat( this.getAchievement(), 1 ); } diff --git a/src/main/java/appeng/core/stats/PlayerDifferentiator.java b/src/main/java/appeng/core/stats/PlayerDifferentiator.java index 04a58323..d4efda36 100644 --- a/src/main/java/appeng/core/stats/PlayerDifferentiator.java +++ b/src/main/java/appeng/core/stats/PlayerDifferentiator.java @@ -42,7 +42,7 @@ public class PlayerDifferentiator * * @return true if {@param player} is not a real player */ - public boolean isNoPlayer( EntityPlayer player ) + public boolean isNoPlayer( final EntityPlayer player ) { return player == null || player.isDead || player instanceof FakePlayer; } diff --git a/src/main/java/appeng/core/stats/PlayerStatsRegistration.java b/src/main/java/appeng/core/stats/PlayerStatsRegistration.java index ece33d0c..bce10f27 100644 --- a/src/main/java/appeng/core/stats/PlayerStatsRegistration.java +++ b/src/main/java/appeng/core/stats/PlayerStatsRegistration.java @@ -51,7 +51,7 @@ public class PlayerStatsRegistration * @param bus {@see #bus} * @param config {@link appeng.core.AEConfig} which is used to determine if the {@link appeng.core.features.AEFeature#Achievements} is enabled */ - public PlayerStatsRegistration( EventBus bus, AEConfig config ) + public PlayerStatsRegistration( final EventBus bus, final AEConfig config ) { this.bus = bus; this.isAchievementFeatureEnabled = config.isFeatureEnabled( AEFeature.Achievements ); @@ -83,7 +83,7 @@ public class PlayerStatsRegistration final AchievementHierarchy hierarchy = new AchievementHierarchy(); hierarchy.registerAchievementHierarchy(); - for( Stats s : Stats.values() ) + for( final Stats s : Stats.values() ) { s.getStat(); } @@ -91,18 +91,18 @@ public class PlayerStatsRegistration /** * register */ - ArrayList list = new ArrayList(); + final ArrayList list = new ArrayList(); - for( Achievements a : Achievements.values() ) + for( final Achievements a : Achievements.values() ) { - Achievement ach = a.getAchievement(); + final Achievement ach = a.getAchievement(); if( ach != null ) { list.add( ach ); } } - AchievementPage ae2AchievementPage = new AchievementPage( "Applied Energistics 2", list.toArray( new Achievement[list.size()] ) ); + final AchievementPage ae2AchievementPage = new AchievementPage( "Applied Energistics 2", list.toArray( new Achievement[list.size()] ) ); AchievementPage.registerAchievementPage( ae2AchievementPage ); } } diff --git a/src/main/java/appeng/core/stats/Stats.java b/src/main/java/appeng/core/stats/Stats.java index ab076ba6..1a7144e7 100644 --- a/src/main/java/appeng/core/stats/Stats.java +++ b/src/main/java/appeng/core/stats/Stats.java @@ -42,7 +42,7 @@ public enum Stats { } - public void addToPlayer( EntityPlayer player, int howMany ) + public void addToPlayer( final EntityPlayer player, final int howMany ) { player.addStat( this.getStat(), howMany ); } diff --git a/src/main/java/appeng/core/sync/AppEngPacket.java b/src/main/java/appeng/core/sync/AppEngPacket.java index 9dfa9ad4..065cdb14 100644 --- a/src/main/java/appeng/core/sync/AppEngPacket.java +++ b/src/main/java/appeng/core/sync/AppEngPacket.java @@ -41,7 +41,7 @@ public abstract class AppEngPacket implements Packet AppEngPacketHandlerBase.PacketTypes id; private PacketBuffer p; - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a server side handler." ); } @@ -51,12 +51,12 @@ public abstract class AppEngPacket implements Packet return AppEngPacketHandlerBase.PacketTypes.getID( this.getClass() ).ordinal(); } - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a client side handler." ); } - protected void configureWrite( ByteBuf data ) + protected void configureWrite( final ByteBuf data ) { data.capacity( data.readableBytes() ); this.p = new PacketBuffer(data); @@ -69,7 +69,7 @@ public abstract class AppEngPacket implements Packet throw new IllegalArgumentException( "Sorry AE2 made a " + this.p.array().length + " byte packet by accident!" ); } - FMLProxyPacket pp = new FMLProxyPacket( this.p, NetworkHandler.instance.getChannel() ); + final FMLProxyPacket pp = new FMLProxyPacket( this.p, NetworkHandler.instance.getChannel() ); if( AEConfig.instance.isFeatureEnabled( AEFeature.PacketLogging ) ) { @@ -80,23 +80,23 @@ public abstract class AppEngPacket implements Packet } @Override - public void readPacketData(PacketBuffer buf) throws IOException + public void readPacketData( final PacketBuffer buf) throws IOException { throw new RuntimeException( "Not Implemented" ); } @Override - public void writePacketData(PacketBuffer buf) throws IOException + public void writePacketData( final PacketBuffer buf) throws IOException { throw new RuntimeException( "Not Implemented" ); } PacketCallState caller; - public void setCallParam( PacketCallState call ){caller = call;} + public void setCallParam( final PacketCallState call ){caller = call;} @Override - public void processPacket(INetHandler handler) + public void processPacket( final INetHandler handler) { caller.call(this); } diff --git a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java index 185c89e3..de47487e 100644 --- a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java +++ b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java @@ -110,7 +110,7 @@ public class AppEngPacketHandlerBase private final Class packetClass; private final Constructor packetConstructor; - PacketTypes( Class c ) + PacketTypes( final Class c ) { this.packetClass = c; @@ -119,10 +119,10 @@ public class AppEngPacketHandlerBase { x = this.packetClass.getConstructor( ByteBuf.class ); } - catch( NoSuchMethodException ignored ) + catch( final NoSuchMethodException ignored ) { } - catch( SecurityException ignored ) + catch( final SecurityException ignored ) { } @@ -135,17 +135,17 @@ public class AppEngPacketHandlerBase } } - public static PacketTypes getPacket( int id ) + public static PacketTypes getPacket( final int id ) { return ( values() )[id]; } - public static PacketTypes getID( Class c ) + public static PacketTypes getID( final Class c ) { return REVERSE_LOOKUP.get( c ); } - public AppEngPacket parsePacket( ByteBuf in ) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException + public AppEngPacket parsePacket( final ByteBuf in ) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { return this.packetConstructor.newInstance( in ); } diff --git a/src/main/java/appeng/core/sync/GuiBridge.java b/src/main/java/appeng/core/sync/GuiBridge.java index a33eef24..3465804d 100644 --- a/src/main/java/appeng/core/sync/GuiBridge.java +++ b/src/main/java/appeng/core/sync/GuiBridge.java @@ -203,7 +203,7 @@ public enum GuiBridge implements IGuiHandler this.containerClass = null; } - GuiBridge( Class containerClass, SecurityPermissions requiredPermission ) + GuiBridge( final Class containerClass, final SecurityPermissions requiredPermission ) { this.requiredPermission = requiredPermission; this.containerClass = containerClass; @@ -220,7 +220,7 @@ public enum GuiBridge implements IGuiHandler if( Platform.isClient() ) { final String start = this.containerClass.getName(); - String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" ); + final String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" ); if( start.equals( guiClass ) ) { @@ -234,7 +234,7 @@ public enum GuiBridge implements IGuiHandler } } - GuiBridge( Class containerClass, Class tileClass, GuiHostType type, SecurityPermissions requiredPermission ) + GuiBridge( final Class containerClass, final Class tileClass, final GuiHostType type, final SecurityPermissions requiredPermission ) { this.requiredPermission = requiredPermission; this.containerClass = containerClass; @@ -244,11 +244,11 @@ public enum GuiBridge implements IGuiHandler } @Override - public Object getServerGuiElement( int ordinal, EntityPlayer player, World w, int x, int y, int z ) + public Object getServerGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z ) { - AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 ); - GuiBridge ID = values()[ordinal >> 4]; - boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1; + final AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 ); + final GuiBridge ID = values()[ordinal >> 4]; + final boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1; if( ID.type.isItem() ) { ItemStack it = null; @@ -260,7 +260,7 @@ public enum GuiBridge implements IGuiHandler { it = player.inventory.getStackInSlot( x ); } - Object myItem = this.getGuiObject( it, player, w, x, y, z ); + final Object myItem = this.getGuiObject( it, player, w, x, y, z ); if( myItem != null && ID.CorrectTileOrPart( myItem ) ) { return this.updateGui( ID.ConstructContainer( player.inventory, side, myItem ), w, x, y, z, side, myItem ); @@ -268,11 +268,11 @@ public enum GuiBridge implements IGuiHandler } if( ID.type.isTile() ) { - TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) ); + final TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) ); if( TE instanceof IPartHost ) { ( (IPartHost) TE ).getPart( side ); - IPart part = ( (IPartHost) TE ).getPart( side ); + final IPart part = ( (IPartHost) TE ).getPart( side ); if( ID.CorrectTileOrPart( part ) ) { return this.updateGui( ID.ConstructContainer( player.inventory, side, part ), w, x, y, z, side, part ); @@ -289,7 +289,7 @@ public enum GuiBridge implements IGuiHandler return new ContainerNull(); } - private Object getGuiObject( ItemStack it, EntityPlayer player, World w, int x, int y, int z ) + private Object getGuiObject( final ItemStack it, final EntityPlayer player, final World w, final int x, final int y, final int z ) { if( it != null ) { @@ -298,7 +298,7 @@ public enum GuiBridge implements IGuiHandler return ( (IGuiItem) it.getItem() ).getGuiObject( it, w, new BlockPos(x,y,z) ); } - IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler( it ); + final IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler( it ); if( wh != null ) { return new WirelessTerminalGuiObject( wh, it, player, w, x, y, z ); @@ -308,7 +308,7 @@ public enum GuiBridge implements IGuiHandler return null; } - public boolean CorrectTileOrPart( Object tE ) + public boolean CorrectTileOrPart( final Object tE ) { if( this.tileClass == null ) { @@ -318,11 +318,11 @@ public enum GuiBridge implements IGuiHandler return this.tileClass.isInstance( tE ); } - private Object updateGui( Object newContainer, World w, int x, int y, int z, AEPartLocation side, Object myItem ) + private Object updateGui( final Object newContainer, final World w, final int x, final int y, final int z, final AEPartLocation side, final Object myItem ) { if( newContainer instanceof AEBaseContainer ) { - AEBaseContainer bc = (AEBaseContainer) newContainer; + final AEBaseContainer bc = (AEBaseContainer) newContainer; bc.openContext = new ContainerOpenContext( myItem ); bc.openContext.w = w; bc.openContext.x = x; @@ -334,36 +334,36 @@ public enum GuiBridge implements IGuiHandler return newContainer; } - public Object ConstructContainer( InventoryPlayer inventory, AEPartLocation side, Object tE ) + public Object ConstructContainer( final InventoryPlayer inventory, final AEPartLocation side, final Object tE ) { try { - Constructor[] c = this.containerClass.getConstructors(); + final Constructor[] c = this.containerClass.getConstructors(); if( c.length == 0 ) { throw new AppEngException( "Invalid Gui Class" ); } - Constructor target = this.findConstructor( c, inventory, tE ); + final Constructor target = this.findConstructor( c, inventory, tE ); if( target == null ) { throw new IllegalStateException( "Cannot find " + this.containerClass.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" ); } - Object o = target.newInstance( inventory, tE ); + final Object o = target.newInstance( inventory, tE ); /** * triggers achievement when the player sees presses. */ if( o instanceof AEBaseContainer ) { - AEBaseContainer bc = (AEBaseContainer) o; - for( Object so : bc.inventorySlots ) + final AEBaseContainer bc = (AEBaseContainer) o; + for( final Object so : bc.inventorySlots ) { if( so instanceof Slot ) { - ItemStack is = ( (Slot) so ).getStack(); + final ItemStack is = ( (Slot) so ).getStack(); final IMaterials materials = AEApi.instance().definitions().materials(); this.addPressAchievementToPlayer( is, materials, inventory.player ); @@ -373,17 +373,17 @@ public enum GuiBridge implements IGuiHandler return o; } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( t ); } } - private Constructor findConstructor( Constructor[] c, InventoryPlayer inventory, Object tE ) + private Constructor findConstructor( final Constructor[] c, final InventoryPlayer inventory, final Object tE ) { - for( Constructor con : c ) + for( final Constructor con : c ) { - Class[] types = con.getParameterTypes(); + final Class[] types = con.getParameterTypes(); if( types.length == 2 ) { if( types[0].isAssignableFrom( inventory.getClass() ) && types[1].isAssignableFrom( tE.getClass() ) ) @@ -395,7 +395,7 @@ public enum GuiBridge implements IGuiHandler return null; } - private String typeName( Object inventory ) + private String typeName( final Object inventory ) { if( inventory == null ) { @@ -405,7 +405,7 @@ public enum GuiBridge implements IGuiHandler return inventory.getClass().getName(); } - private void addPressAchievementToPlayer( ItemStack newItem, IMaterials possibleMaterials, EntityPlayer player ) + private void addPressAchievementToPlayer( final ItemStack newItem, final IMaterials possibleMaterials, final EntityPlayer player ) { final IComparableDefinition logic = possibleMaterials.logicProcessorPress(); final IComparableDefinition eng = possibleMaterials.engProcessorPress(); @@ -414,7 +414,7 @@ public enum GuiBridge implements IGuiHandler final List presses = Lists.newArrayList( logic, eng, calc, silicon ); - for( IComparableDefinition press : presses ) + for( final IComparableDefinition press : presses ) { if( press.isSameAs( newItem ) ) { @@ -426,11 +426,11 @@ public enum GuiBridge implements IGuiHandler } @Override - public Object getClientGuiElement( int ordinal, EntityPlayer player, World w, int x, int y, int z ) + public Object getClientGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z ) { - AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 ); - GuiBridge ID = values()[ordinal >> 4]; - boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1; + final AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 ); + final GuiBridge ID = values()[ordinal >> 4]; + final boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1; if( ID.type.isItem() ) { ItemStack it = null; @@ -442,7 +442,7 @@ public enum GuiBridge implements IGuiHandler { it = player.inventory.getStackInSlot( x ); } - Object myItem = this.getGuiObject( it, player, w, x, y, z ); + final Object myItem = this.getGuiObject( it, player, w, x, y, z ); if( myItem != null && ID.CorrectTileOrPart( myItem ) ) { return ID.ConstructGui( player.inventory, side, myItem ); @@ -450,11 +450,11 @@ public enum GuiBridge implements IGuiHandler } if( ID.type.isTile() ) { - TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) ); + final TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) ); if( TE instanceof IPartHost ) { ( (IPartHost) TE ).getPart( side ); - IPart part = ( (IPartHost) TE ).getPart( side ); + final IPart part = ( (IPartHost) TE ).getPart( side ); if( ID.CorrectTileOrPart( part ) ) { return ID.ConstructGui( player.inventory, side, part ); @@ -471,17 +471,17 @@ public enum GuiBridge implements IGuiHandler return new GuiNull( new ContainerNull() ); } - public Object ConstructGui( InventoryPlayer inventory, AEPartLocation side, Object tE ) + public Object ConstructGui( final InventoryPlayer inventory, final AEPartLocation side, final Object tE ) { try { - Constructor[] c = this.guiClass.getConstructors(); + final Constructor[] c = this.guiClass.getConstructors(); if( c.length == 0 ) { throw new AppEngException( "Invalid Gui Class" ); } - Constructor target = this.findConstructor( c, inventory, tE ); + final Constructor target = this.findConstructor( c, inventory, tE ); if( target == null ) { @@ -490,25 +490,25 @@ public enum GuiBridge implements IGuiHandler return target.newInstance( inventory, tE ); } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( t ); } } - public boolean hasPermissions( TileEntity te, int x, int y, int z, AEPartLocation side, EntityPlayer player ) + public boolean hasPermissions( final TileEntity te, final int x, final int y, final int z, final AEPartLocation side, final EntityPlayer player ) { - World w = player.getEntityWorld(); - BlockPos pos = new BlockPos(x,y,z); + final World w = player.getEntityWorld(); + final BlockPos pos = new BlockPos(x,y,z); if( Platform.hasPermissions( te != null ? new DimensionalCoord( te ) : new DimensionalCoord( player.worldObj, pos ), player ) ) { if( this.type.isItem() ) { - ItemStack it = player.inventory.getCurrentItem(); + final ItemStack it = player.inventory.getCurrentItem(); if( it != null && it.getItem() instanceof IGuiItem ) { - Object myItem = ( (IGuiItem) it.getItem() ).getGuiObject( it, w, pos ); + final Object myItem = ( (IGuiItem) it.getItem() ).getGuiObject( it, w, pos ); if( this.CorrectTileOrPart( myItem ) ) { return true; @@ -518,11 +518,11 @@ public enum GuiBridge implements IGuiHandler if( this.type.isTile() ) { - TileEntity TE = w.getTileEntity( pos ); + final TileEntity TE = w.getTileEntity( pos ); if( TE instanceof IPartHost ) { ( (IPartHost) TE ).getPart( side ); - IPart part = ( (IPartHost) TE ).getPart( side ); + final IPart part = ( (IPartHost) TE ).getPart( side ); if( this.CorrectTileOrPart( part ) ) { return this.securityCheck( part, player ); @@ -540,28 +540,28 @@ public enum GuiBridge implements IGuiHandler return false; } - private boolean securityCheck( Object te, EntityPlayer player ) + private boolean securityCheck( final Object te, final EntityPlayer player ) { if( te instanceof IActionHost && this.requiredPermission != null ) { - IGridNode gn = ( (IActionHost) te ).getActionableNode(); + final IGridNode gn = ( (IActionHost) te ).getActionableNode(); if( gn != null ) { - IGrid g = gn.getGrid(); + final IGrid g = gn.getGrid(); if( g != null ) { - boolean requirePower = false; + final boolean requirePower = false; if( requirePower ) { - IEnergyGrid eg = g.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = g.getCache( IEnergyGrid.class ); if( !eg.isNetworkPowered() ) { return false; } } - ISecurityGrid sg = g.getCache( ISecurityGrid.class ); + final ISecurityGrid sg = g.getCache( ISecurityGrid.class ); if( sg.hasPermission( player, this.requiredPermission ) ) { return true; diff --git a/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java b/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java index 421f8d13..be9c3345 100644 --- a/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java +++ b/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java @@ -40,23 +40,23 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement @Override public void onPacketData( final INetworkInfo manager, - INetHandler handler, - FMLProxyPacket packet, + final INetHandler handler, + final FMLProxyPacket packet, final EntityPlayer player ) { - ByteBuf stream = packet.payload(); + final ByteBuf stream = packet.payload(); try { - int packetType = stream.readInt(); - AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream ); + final int packetType = stream.readInt(); + final AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream ); - PacketCallState callState = + final PacketCallState callState = new PacketCallState(){ @Override public void call( - AppEngPacket appEngPacket ) + final AppEngPacket appEngPacket ) { appEngPacket.clientPacketData( manager, appEngPacket, Minecraft.getMinecraft().thePlayer ); } @@ -66,19 +66,19 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement PacketThreadUtil.checkThreadAndEnqueue( pack, handler, Minecraft.getMinecraft() ); callState.call( pack ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java b/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java index dd08316d..a76f03ae 100644 --- a/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java +++ b/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java @@ -38,22 +38,21 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp { @Override - public void onPacketData( final INetworkInfo manager, INetHandler handler, FMLProxyPacket packet, final EntityPlayer player ) + public void onPacketData( final INetworkInfo manager, final INetHandler handler, final FMLProxyPacket packet, final EntityPlayer player ) { - ByteBuf stream = packet.payload(); - int packetType = -1; + final ByteBuf stream = packet.payload(); try { - packetType = stream.readInt(); - AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream ); + final int packetType = stream.readInt(); + final AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream ); - PacketCallState callState = + final PacketCallState callState = new PacketCallState(){ @Override public void call( - AppEngPacket appEngPacket ) + final AppEngPacket appEngPacket ) { appEngPacket.serverPacketData( manager, appEngPacket, player); } @@ -63,19 +62,19 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp PacketThreadUtil.checkThreadAndEnqueue( pack, handler, ((EntityPlayerMP)player).getServerForPlayer() ); callState.call( pack ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { AELog.error( e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { AELog.error( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/core/sync/network/NetworkHandler.java b/src/main/java/appeng/core/sync/network/NetworkHandler.java index 0174fd66..dc676b79 100644 --- a/src/main/java/appeng/core/sync/network/NetworkHandler.java +++ b/src/main/java/appeng/core/sync/network/NetworkHandler.java @@ -44,7 +44,7 @@ public class NetworkHandler final IPacketHandler clientHandler; final IPacketHandler serveHandler; - public NetworkHandler( String channelName ) + public NetworkHandler( final String channelName ) { FMLCommonHandler.instance().bus().register( this ); this.ec = NetworkRegistry.INSTANCE.newEventDrivenChannel( this.myChannelName = channelName ); @@ -60,7 +60,7 @@ public class NetworkHandler { return new AppEngClientPacketHandler(); } - catch( Throwable t ) + catch( final Throwable t ) { return null; } @@ -72,20 +72,20 @@ public class NetworkHandler { return new AppEngServerPacketHandler(); } - catch( Throwable t ) + catch( final Throwable t ) { return null; } } @SubscribeEvent - public void newConnection( ServerConnectionFromClientEvent ev ) + public void newConnection( final ServerConnectionFromClientEvent ev ) { WorldData.instance().dimensionData().sendToPlayer( ev.manager ); } @SubscribeEvent - public void newConnection( PlayerLoggedInEvent loginEvent ) + public void newConnection( final PlayerLoggedInEvent loginEvent ) { if( loginEvent.player instanceof EntityPlayerMP ) { @@ -94,9 +94,9 @@ public class NetworkHandler } @SubscribeEvent - public void serverPacket( ServerCustomPacketEvent ev ) + public void serverPacket( final ServerCustomPacketEvent ev ) { - NetHandlerPlayServer srv = (NetHandlerPlayServer) ev.packet.handler(); + final NetHandlerPlayServer srv = (NetHandlerPlayServer) ev.packet.handler(); if( this.serveHandler != null ) { try @@ -111,7 +111,7 @@ public class NetworkHandler } @SubscribeEvent - public void clientPacket( ClientCustomPacketEvent ev ) + public void clientPacket( final ClientCustomPacketEvent ev ) { if( this.clientHandler != null ) { @@ -131,27 +131,27 @@ public class NetworkHandler return this.myChannelName; } - public void sendToAll( AppEngPacket message ) + public void sendToAll( final AppEngPacket message ) { this.ec.sendToAll( message.getProxy() ); } - public void sendTo( AppEngPacket message, EntityPlayerMP player ) + public void sendTo( final AppEngPacket message, final EntityPlayerMP player ) { this.ec.sendTo( message.getProxy(), player ); } - public void sendToAllAround( AppEngPacket message, NetworkRegistry.TargetPoint point ) + public void sendToAllAround( final AppEngPacket message, final NetworkRegistry.TargetPoint point ) { this.ec.sendToAllAround( message.getProxy(), point ); } - public void sendToDimension( AppEngPacket message, int dimensionId ) + public void sendToDimension( final AppEngPacket message, final int dimensionId ) { this.ec.sendToDimension( message.getProxy(), dimensionId ); } - public void sendToServer( AppEngPacket message ) + public void sendToServer( final AppEngPacket message ) { this.ec.sendToServer( message.getProxy() ); } diff --git a/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java b/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java index 231cb710..b8d568ad 100644 --- a/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java +++ b/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java @@ -46,7 +46,7 @@ public class PacketAssemblerAnimation extends AppEngPacket public final IAEItemStack is; // automatic. - public PacketAssemblerAnimation( ByteBuf stream ) throws IOException + public PacketAssemblerAnimation( final ByteBuf stream ) throws IOException { this.x = stream.readInt(); this.y = stream.readInt(); @@ -56,10 +56,10 @@ public class PacketAssemblerAnimation extends AppEngPacket } // api - public PacketAssemblerAnimation( BlockPos pos, byte rate, IAEItemStack is ) throws IOException + public PacketAssemblerAnimation( final BlockPos pos, final byte rate, final IAEItemStack is ) throws IOException { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( this.x = pos.getX() ); @@ -74,11 +74,11 @@ public class PacketAssemblerAnimation extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - double d0 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); - double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); - double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); + final double d0 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); + final double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); + final double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); CommonHelper.proxy.spawnEffect( EffectType.Assembler, player.getEntityWorld(), this.x + d0, this.y + d1, this.z + d2, this ); } diff --git a/src/main/java/appeng/core/sync/packets/PacketClick.java b/src/main/java/appeng/core/sync/packets/PacketClick.java index 2e9de91d..d67585b2 100644 --- a/src/main/java/appeng/core/sync/packets/PacketClick.java +++ b/src/main/java/appeng/core/sync/packets/PacketClick.java @@ -48,7 +48,7 @@ public class PacketClick extends AppEngPacket final float hitZ; // automatic. - public PacketClick( ByteBuf stream ) + public PacketClick( final ByteBuf stream ) { this.x = stream.readInt(); this.y = stream.readInt(); @@ -60,10 +60,10 @@ public class PacketClick extends AppEngPacket } // api - public PacketClick( BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ ) + public PacketClick( final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( this.x = pos.getX() ); @@ -78,9 +78,9 @@ public class PacketClick extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - ItemStack is = player.inventory.getCurrentItem(); + final ItemStack is = player.inventory.getCurrentItem(); final IItems items = AEApi.instance().definitions().items(); final IComparableDefinition maybeMemoryCard = items.memoryCard(); final IComparableDefinition maybeColorApplicator = items.colorApplicator(); @@ -89,20 +89,20 @@ public class PacketClick extends AppEngPacket { if( is.getItem() instanceof ToolNetworkTool ) { - ToolNetworkTool tnt = (ToolNetworkTool) is.getItem(); + final ToolNetworkTool tnt = (ToolNetworkTool) is.getItem(); tnt.serverSideToolLogic( is, player, player.worldObj, new BlockPos( this.x, this.y, this.z), EnumFacing.VALUES[ this.side ], this.hitX, this.hitY, this.hitZ ); } else if( maybeMemoryCard.isSameAs( is ) ) { - IMemoryCard mem = (IMemoryCard) is.getItem(); + final IMemoryCard mem = (IMemoryCard) is.getItem(); mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED ); is.setTagCompound( null ); } else if( maybeColorApplicator.isSameAs( is ) ) { - ToolColorApplicator mem = (ToolColorApplicator) is.getItem(); + final ToolColorApplicator mem = (ToolColorApplicator) is.getItem(); mem.cycleColors( is, mem.getColor( is ), 1 ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java b/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java index 3ed8d979..4f8ba563 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java @@ -42,7 +42,7 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba EntityPlayer talkBackTo; // automatic. - public PacketCompassRequest( ByteBuf stream ) + public PacketCompassRequest( final ByteBuf stream ) { this.attunement = stream.readLong(); this.cx = stream.readInt(); @@ -51,10 +51,10 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba } // api - public PacketCompassRequest( long attunement, int cx, int cz, int cdy ) + public PacketCompassRequest( final long attunement, final int cx, final int cz, final int cdy ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeLong( this.attunement = attunement ); @@ -66,17 +66,17 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba } @Override - public void calculatedDirection( boolean hasResult, boolean spin, double radians, double dist ) + public void calculatedDirection( final boolean hasResult, final boolean spin, final double radians, final double dist ) { NetworkHandler.instance.sendTo( new PacketCompassResponse( this, hasResult, spin, radians ), (EntityPlayerMP) this.talkBackTo ); } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { this.talkBackTo = player; - DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 ); + final DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 ); WorldData.instance().compassData().service().getCompassDirection( loc, 174, this ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java b/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java index c5fa2a92..20ca0147 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java @@ -39,7 +39,7 @@ public class PacketCompassResponse extends AppEngPacket public CompassResult cr; // automatic. - public PacketCompassResponse( ByteBuf stream ) + public PacketCompassResponse( final ByteBuf stream ) { this.attunement = stream.readLong(); this.cx = stream.readInt(); @@ -50,10 +50,10 @@ public class PacketCompassResponse extends AppEngPacket } // api - public PacketCompassResponse( PacketCompassRequest req, boolean hasResult, boolean spin, double radians ) + public PacketCompassResponse( final PacketCompassRequest req, final boolean hasResult, final boolean spin, final double radians ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeLong( this.attunement = req.attunement ); @@ -69,7 +69,7 @@ public class PacketCompassResponse extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { CompassManager.INSTANCE.postResult( this.attunement, this.cx << 4, this.cdy << 5, this.cz << 4, this.cr ); } diff --git a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java index 70ccc71a..e7aa3929 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java @@ -59,7 +59,7 @@ public class PacketCompressedNBT extends AppEngPacket this.data = null; this.compressFrame = null; - GZIPInputStream gzReader = new GZIPInputStream( new InputStream() + final GZIPInputStream gzReader = new GZIPInputStream( new InputStream() { @Override @@ -74,13 +74,13 @@ public class PacketCompressedNBT extends AppEngPacket } } ); - DataInputStream inStream = new DataInputStream( gzReader ); + final DataInputStream inStream = new DataInputStream( gzReader ); this.in = CompressedStreamTools.read( inStream ); inStream.close(); } // api - public PacketCompressedNBT( NBTTagCompound din ) throws IOException + public PacketCompressedNBT( final NBTTagCompound din ) throws IOException { this.data = Unpooled.buffer( 2048 ); @@ -92,7 +92,7 @@ public class PacketCompressedNBT extends AppEngPacket { @Override - public void write( int value ) throws IOException + public void write( final int value ) throws IOException { PacketCompressedNBT.this.data.writeByte( value ); } @@ -106,9 +106,9 @@ public class PacketCompressedNBT extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - GuiScreen gs = Minecraft.getMinecraft().currentScreen; + final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiInterfaceTerminal ) { diff --git a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java index f90239e4..ec2a5eb1 100644 --- a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java +++ b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java @@ -40,19 +40,19 @@ public final class PacketConfigButton extends AppEngPacket // automatic. @Reflected - public PacketConfigButton( ByteBuf stream ) + public PacketConfigButton( final ByteBuf stream ) { this.option = Settings.values()[stream.readInt()]; this.rotationDirection = stream.readBoolean(); } // api - public PacketConfigButton( Settings option, boolean rotationDirection ) + public PacketConfigButton( final Settings option, final boolean rotationDirection ) { this.option = option; this.rotationDirection = rotationDirection; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( option.ordinal() ); @@ -62,16 +62,16 @@ public final class PacketConfigButton extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; if ( sender.openContainer instanceof AEBaseContainer ) { final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; if( baseContainer.getTarget() instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) baseContainer.getTarget() ).getConfigManager(); - Enum newState = Platform.rotateEnum( cm.getSetting( this.option ), this.rotationDirection, this.option.getPossibleValues() ); + final IConfigManager cm = ( (IConfigurableObject) baseContainer.getTarget() ).getConfigManager(); + final Enum newState = Platform.rotateEnum( cm.getSetting( this.option ), this.rotationDirection, this.option.getPossibleValues() ); cm.putSetting( this.option, newState ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java b/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java index b4d9035f..f14de6ed 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java +++ b/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java @@ -49,18 +49,18 @@ public class PacketCraftRequest extends AppEngPacket public final boolean heldShift; // automatic. - public PacketCraftRequest( ByteBuf stream ) + public PacketCraftRequest( final ByteBuf stream ) { this.heldShift = stream.readBoolean(); this.amount = stream.readLong(); } - public PacketCraftRequest( int craftAmt, boolean shift ) + public PacketCraftRequest( final int craftAmt, final boolean shift ) { this.amount = craftAmt; this.heldShift = shift; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeBoolean( shift ); @@ -70,22 +70,22 @@ public class PacketCraftRequest extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { if( player.openContainer instanceof ContainerCraftAmount ) { - ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer; - Object target = cca.getTarget(); + final ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer; + final Object target = cca.getTarget(); if( target instanceof IGridHost ) { - IGridHost gh = (IGridHost) target; - IGridNode gn = gh.getGridNode( AEPartLocation.INTERNAL ); + final IGridHost gh = (IGridHost) target; + final IGridNode gn = gh.getGridNode( AEPartLocation.INTERNAL ); if( gn == null ) { return; } - IGrid g = gn.getGrid(); + final IGrid g = gn.getGrid(); if( g == null || cca.whatToMake == null ) { return; @@ -96,25 +96,25 @@ public class PacketCraftRequest extends AppEngPacket Future futureJob = null; try { - ICraftingGrid cg = g.getCache( ICraftingGrid.class ); + final ICraftingGrid cg = g.getCache( ICraftingGrid.class ); futureJob = cg.beginCraftingJob( cca.getWorld(), cca.getGrid(), cca.getActionSrc(), cca.whatToMake, null ); - ContainerOpenContext context = cca.openContext; + final ContainerOpenContext context = cca.openContext; if( context != null ) { - TileEntity te = context.getTile(); + final TileEntity te = context.getTile(); Platform.openGUI( player, te, cca.openContext.side, GuiBridge.GUI_CRAFTING_CONFIRM ); if( player.openContainer instanceof ContainerCraftConfirm ) { - ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer; + final ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer; ccc.autoStart = this.heldShift; ccc.job = futureJob; cca.detectAndSendChanges(); } } } - catch( Throwable e ) + catch( final Throwable e ) { if( futureJob != null ) { diff --git a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java index efc03bc3..416eca1d 100644 --- a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java +++ b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java @@ -49,12 +49,12 @@ public class PacketInventoryAction extends AppEngPacket public final IAEItemStack slotItem; // automatic. - public PacketInventoryAction( ByteBuf stream ) throws IOException + public PacketInventoryAction( final ByteBuf stream ) throws IOException { this.action = InventoryAction.values()[stream.readInt()]; this.slot = stream.readInt(); this.id = stream.readLong(); - boolean hasItem = stream.readBoolean(); + final boolean hasItem = stream.readBoolean(); if( hasItem ) { this.slotItem = AEItemStack.loadItemStackFromPacket( stream ); @@ -66,7 +66,7 @@ public class PacketInventoryAction extends AppEngPacket } // api - public PacketInventoryAction( InventoryAction action, int slot, IAEItemStack slotItem ) throws IOException + public PacketInventoryAction( final InventoryAction action, final int slot, final IAEItemStack slotItem ) throws IOException { if( Platform.isClient() ) @@ -79,7 +79,7 @@ public class PacketInventoryAction extends AppEngPacket this.id = 0; this.slotItem = slotItem; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( action.ordinal() ); @@ -100,14 +100,14 @@ public class PacketInventoryAction extends AppEngPacket } // api - public PacketInventoryAction( InventoryAction action, int slot, long id ) + public PacketInventoryAction( final InventoryAction action, final int slot, final long id ) { this.action = action; this.slot = slot; this.id = id; this.slotItem = null; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( action.ordinal() ); @@ -119,23 +119,23 @@ public class PacketInventoryAction extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; if( sender.openContainer instanceof AEBaseContainer ) { - AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; + final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; if( this.action == InventoryAction.AUTO_CRAFT ) { - ContainerOpenContext context = baseContainer.openContext; + final ContainerOpenContext context = baseContainer.openContext; if( context != null ) { - TileEntity te = context.getTile(); + final TileEntity te = context.getTile(); Platform.openGUI( sender, te, baseContainer.openContext.side, GuiBridge.GUI_CRAFTING_AMOUNT ); if( sender.openContainer instanceof ContainerCraftAmount ) { - ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer; + final ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer; if( baseContainer.getTargetStack() != null ) { @@ -155,7 +155,7 @@ public class PacketInventoryAction extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { if( this.action == InventoryAction.UPDATE_HAND ) { diff --git a/src/main/java/appeng/core/sync/packets/PacketLightning.java b/src/main/java/appeng/core/sync/packets/PacketLightning.java index 834c46fb..44d3d50e 100644 --- a/src/main/java/appeng/core/sync/packets/PacketLightning.java +++ b/src/main/java/appeng/core/sync/packets/PacketLightning.java @@ -41,7 +41,7 @@ public class PacketLightning extends AppEngPacket final double z; // automatic. - public PacketLightning( ByteBuf stream ) + public PacketLightning( final ByteBuf stream ) { this.x = stream.readFloat(); this.y = stream.readFloat(); @@ -49,13 +49,13 @@ public class PacketLightning extends AppEngPacket } // api - public PacketLightning( double x, double y, double z ) + public PacketLightning( final double x, final double y, final double z ) { this.x = x; this.y = y; this.z = z; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeFloat( (float) x ); @@ -67,17 +67,17 @@ public class PacketLightning extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { try { if( Platform.isClient() && AEConfig.instance.enableEffects ) { - LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f ); + final LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } - catch( Exception ignored ) + catch( final Exception ignored ) { } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java index 23efb308..1508d526 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java +++ b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java @@ -81,7 +81,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket // int originalBytes = stream.readableBytes(); - GZIPInputStream gzReader = new GZIPInputStream( new InputStream() + final GZIPInputStream gzReader = new GZIPInputStream( new InputStream() { @Override public int read() throws IOException @@ -95,11 +95,11 @@ public class PacketMEInventoryUpdate extends AppEngPacket } } ); - ByteBuf uncompressed = Unpooled.buffer( stream.readableBytes() ); - byte[] tmp = new byte[TEMP_BUFFER_SIZE]; + final ByteBuf uncompressed = Unpooled.buffer( stream.readableBytes() ); + final byte[] tmp = new byte[TEMP_BUFFER_SIZE]; while( gzReader.available() != 0 ) { - int bytes = gzReader.read( tmp ); + final int bytes = gzReader.read( tmp ); if( bytes > 0 ) { uncompressed.writeBytes( tmp, 0, bytes ); @@ -125,7 +125,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket } // api - public PacketMEInventoryUpdate( byte ref ) throws IOException + public PacketMEInventoryUpdate( final byte ref ) throws IOException { this.ref = ref; this.data = Unpooled.buffer( OPERATION_BYTE_LIMIT ); @@ -135,7 +135,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket this.compressFrame = new GZIPOutputStream( new OutputStream() { @Override - public void write( int value ) throws IOException + public void write( final int value ) throws IOException { PacketMEInventoryUpdate.this.data.writeByte( value ); } @@ -146,9 +146,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - GuiScreen gs = Minecraft.getMinecraft().currentScreen; + final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiCraftConfirm ) { @@ -182,7 +182,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket this.configureWrite( this.data ); return super.getProxy(); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -190,9 +190,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket return null; } - public void appendItem( IAEItemStack is ) throws IOException, BufferOverflowException + public void appendItem( final IAEItemStack is ) throws IOException, BufferOverflowException { - ByteBuf tmp = Unpooled.buffer( OPERATION_BYTE_LIMIT ); + final ByteBuf tmp = Unpooled.buffer( OPERATION_BYTE_LIMIT ); is.writeToPacket( tmp ); this.compressFrame.flush(); diff --git a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java index 93681c40..d332d328 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java +++ b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java @@ -45,7 +45,7 @@ public class PacketMatterCannon extends AppEngPacket final byte len; // automatic. - public PacketMatterCannon( ByteBuf stream ) + public PacketMatterCannon( final ByteBuf stream ) { this.x = stream.readFloat(); this.y = stream.readFloat(); @@ -57,10 +57,10 @@ public class PacketMatterCannon extends AppEngPacket } // api - public PacketMatterCannon( double x, double y, double z, float dx, float dy, float dz, byte len ) + public PacketMatterCannon( final double x, final double y, final double z, final float dx, final float dy, final float dz, final byte len ) { - float dl = dx * dx + dy * dy + dz * dz; - float dlz = (float) Math.sqrt( dl ); + final float dl = dx * dx + dy * dy + dz * dz; + final float dlz = (float) Math.sqrt( dl ); this.x = x; this.y = y; @@ -70,7 +70,7 @@ public class PacketMatterCannon extends AppEngPacket this.dz = dz / dlz; this.len = len; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeFloat( (float) x ); @@ -86,20 +86,20 @@ public class PacketMatterCannon extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { try { - World world = FMLClientHandler.instance().getClient().theWorld; + final World world = FMLClientHandler.instance().getClient().theWorld; for( int a = 1; a < this.len; a++ ) { - MatterCannonFX fx = new MatterCannonFX( world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.diamond ); + final MatterCannonFX fx = new MatterCannonFX( world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.diamond ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } - catch( Exception ignored ) + catch( final Exception ignored ) { } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java b/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java index 2a9d6ef3..24ba9170 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java +++ b/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java @@ -39,7 +39,7 @@ public class PacketMockExplosion extends AppEngPacket public final double z; // automatic. - public PacketMockExplosion( ByteBuf stream ) + public PacketMockExplosion( final ByteBuf stream ) { this.x = stream.readDouble(); this.y = stream.readDouble(); @@ -47,13 +47,13 @@ public class PacketMockExplosion extends AppEngPacket } // api - public PacketMockExplosion( double x, double y, double z ) + public PacketMockExplosion( final double x, final double y, final double z ) { this.x = x; this.y = y; this.z = z; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeDouble( x ); @@ -65,9 +65,9 @@ public class PacketMockExplosion extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - World world = CommonHelper.proxy.getWorld(); + final World world = CommonHelper.proxy.getWorld(); world.spawnParticle( EnumParticleTypes.EXPLOSION_LARGE, this.x, this.y, this.z, 1.0D, 0.0D, 0.0D, new int[0] ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMultiPart.java b/src/main/java/appeng/core/sync/packets/PacketMultiPart.java index 14785b1d..2c22711c 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMultiPart.java +++ b/src/main/java/appeng/core/sync/packets/PacketMultiPart.java @@ -35,14 +35,14 @@ public class PacketMultiPart extends AppEngPacket { // automatic. - public PacketMultiPart( ByteBuf stream ) + public PacketMultiPart( final ByteBuf stream ) { } // api public PacketMultiPart() { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); @@ -50,12 +50,12 @@ public class PacketMultiPart extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - IFMP fmp = (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ); + final IFMP fmp = (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ); if( fmp != null ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; MinecraftForge.EVENT_BUS.post( fmp.newFMPPacketEvent( sender ) ); // when received it just posts this event. } } diff --git a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java index c3c73245..a679f8bf 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java +++ b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java @@ -67,17 +67,17 @@ public class PacketNEIRecipe extends AppEngPacket ItemStack[][] recipe; // automatic. - public PacketNEIRecipe( ByteBuf stream ) throws IOException + public PacketNEIRecipe( final ByteBuf stream ) throws IOException { - ByteArrayInputStream bytes = new ByteArrayInputStream( stream.array() ); + final ByteArrayInputStream bytes = new ByteArrayInputStream( stream.array() ); bytes.skip( stream.readerIndex() ); - NBTTagCompound comp = CompressedStreamTools.readCompressed( bytes ); + final NBTTagCompound comp = CompressedStreamTools.readCompressed( bytes ); if( comp != null ) { this.recipe = new ItemStack[9][]; for( int x = 0; x < this.recipe.length; x++ ) { - NBTTagList list = comp.getTagList( "#" + x, 10 ); + final NBTTagList list = comp.getTagList( "#" + x, 10 ); if( list.tagCount() > 0 ) { this.recipe[x] = new ItemStack[list.tagCount()]; @@ -91,12 +91,12 @@ public class PacketNEIRecipe extends AppEngPacket } // api - public PacketNEIRecipe( NBTTagCompound recipe ) throws IOException + public PacketNEIRecipe( final NBTTagCompound recipe ) throws IOException { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream outputStream = new DataOutputStream( bytes ); + final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + final DataOutputStream outputStream = new DataOutputStream( bytes ); data.writeInt( this.getPacketID() ); @@ -107,34 +107,34 @@ public class PacketNEIRecipe extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP pmp = (EntityPlayerMP) player; - Container con = pmp.openContainer; + final EntityPlayerMP pmp = (EntityPlayerMP) player; + final Container con = pmp.openContainer; if( con instanceof IContainerCraftingPacket ) { - IContainerCraftingPacket cct = (IContainerCraftingPacket) con; - IGridNode node = cct.getNetworkNode(); + final IContainerCraftingPacket cct = (IContainerCraftingPacket) con; + final IGridNode node = cct.getNetworkNode(); if( node != null ) { - IGrid grid = node.getGrid(); + final IGrid grid = node.getGrid(); if( grid == null ) { return; } - IStorageGrid inv = grid.getCache( IStorageGrid.class ); - IEnergyGrid energy = grid.getCache( IEnergyGrid.class ); - ISecurityGrid security = grid.getCache( ISecurityGrid.class ); - IInventory craftMatrix = cct.getInventoryByName( "crafting" ); - IInventory playerInventory = cct.getInventoryByName( "player" ); + final IStorageGrid inv = grid.getCache( IStorageGrid.class ); + final IEnergyGrid energy = grid.getCache( IEnergyGrid.class ); + final ISecurityGrid security = grid.getCache( ISecurityGrid.class ); + final IInventory craftMatrix = cct.getInventoryByName( "crafting" ); + final IInventory playerInventory = cct.getInventoryByName( "player" ); - Actionable realForFake = cct.useRealItems() ? Actionable.MODULATE : Actionable.SIMULATE; + final Actionable realForFake = cct.useRealItems() ? Actionable.MODULATE : Actionable.SIMULATE; if( inv != null && this.recipe != null && security != null ) { - InventoryCrafting testInv = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting testInv = new InventoryCrafting( new ContainerNull(), 3, 3 ); for( int x = 0; x < 9; x++ ) { if( this.recipe[x] != null && this.recipe[x].length > 0 ) @@ -143,35 +143,35 @@ public class PacketNEIRecipe extends AppEngPacket } } - IRecipe r = Platform.findMatchingRecipe( testInv, pmp.worldObj ); + final IRecipe r = Platform.findMatchingRecipe( testInv, pmp.worldObj ); if( r != null && security.hasPermission( player, SecurityPermissions.EXTRACT ) ) { - ItemStack is = r.getCraftingResult( testInv ); + final ItemStack is = r.getCraftingResult( testInv ); if( is != null ) { - IMEMonitor storage = inv.getItemInventory(); - IItemList all = storage.getStorageList(); - IPartitionList filter = ItemViewCell.createFilter( cct.getViewCells() ); + final IMEMonitor storage = inv.getItemInventory(); + final IItemList all = storage.getStorageList(); + final IPartitionList filter = ItemViewCell.createFilter( cct.getViewCells() ); for( int x = 0; x < craftMatrix.getSizeInventory(); x++ ) { - ItemStack patternItem = testInv.getStackInSlot( x ); + final ItemStack patternItem = testInv.getStackInSlot( x ); ItemStack currentItem = craftMatrix.getStackInSlot( x ); if( currentItem != null ) { testInv.setInventorySlotContents( x, currentItem ); - ItemStack newItemStack = r.matches( testInv, pmp.worldObj ) ? r.getCraftingResult( testInv ) : null; + final ItemStack newItemStack = r.matches( testInv, pmp.worldObj ) ? r.getCraftingResult( testInv ) : null; testInv.setInventorySlotContents( x, patternItem ); if( newItemStack == null || !Platform.isSameItemPrecise( newItemStack, is ) ) { - IAEItemStack in = AEItemStack.create( currentItem ); + final IAEItemStack in = AEItemStack.create( currentItem ); if( in != null ) { - IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, storage, in, cct.getSource() ); + final IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, storage, in, cct.getSource() ); if( out != null ) { craftMatrix.setInventorySlotContents( x, out.getItemStack() ); @@ -198,13 +198,13 @@ public class PacketNEIRecipe extends AppEngPacket { for( int y = 0; y < this.recipe[x].length; y++ ) { - IAEItemStack request = AEItemStack.create( this.recipe[x][y] ); + final IAEItemStack request = AEItemStack.create( this.recipe[x][y] ); if( request != null ) { if( filter == null || filter.isListed( request ) ) { request.setStackSize( 1 ); - IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getSource() ); + final IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getSource() ); if( out != null ) { whichItem = out.getItemStack(); @@ -240,7 +240,7 @@ public class PacketNEIRecipe extends AppEngPacket * @param patternItem which {@link ItemStack} to extract * @return null or a found {@link ItemStack} */ - private ItemStack extractItemFromPlayerInventory( EntityPlayer player, Actionable mode, ItemStack patternItem ) + private ItemStack extractItemFromPlayerInventory( final EntityPlayer player, final Actionable mode, final ItemStack patternItem ) { final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); final AEItemStack request = AEItemStack.create( patternItem ); diff --git a/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java b/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java index 4d38b323..156cfdc0 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java +++ b/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java @@ -36,17 +36,17 @@ public class PacketNewStorageDimension extends AppEngPacket final int newDim; // automatic. - public PacketNewStorageDimension( ByteBuf stream ) + public PacketNewStorageDimension( final ByteBuf stream ) { this.newDim = stream.readInt(); } // api - public PacketNewStorageDimension( int newDim ) + public PacketNewStorageDimension( final int newDim ) { this.newDim = newDim; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( newDim ); @@ -56,13 +56,13 @@ public class PacketNewStorageDimension extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { try { DimensionManager.registerDimension( this.newDim, AEConfig.instance.storageProviderID ); } - catch( IllegalArgumentException iae ) + catch( final IllegalArgumentException iae ) { // ok! } diff --git a/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java b/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java index 4df4c764..72d2353c 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java +++ b/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java @@ -37,7 +37,7 @@ public class PacketPaintedEntity extends AppEngPacket private int ticks; // automatic. - public PacketPaintedEntity( ByteBuf stream ) + public PacketPaintedEntity( final ByteBuf stream ) { this.entityId = stream.readInt(); this.myColor = AEColor.values()[stream.readByte()]; @@ -45,10 +45,10 @@ public class PacketPaintedEntity extends AppEngPacket } // api - public PacketPaintedEntity( int myEntity, AEColor myColor, int ticksLeft ) + public PacketPaintedEntity( final int myEntity, final AEColor myColor, final int ticksLeft ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( this.entityId = myEntity ); @@ -59,9 +59,9 @@ public class PacketPaintedEntity extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - PlayerColor pc = new PlayerColor( this.entityId, this.myColor, this.ticks ); + final PlayerColor pc = new PlayerColor( this.entityId, this.myColor, this.ticks ); TickHandler.INSTANCE.getPlayerColors().put( this.entityId, pc ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java index e4d9c945..655007f2 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java +++ b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java @@ -41,7 +41,7 @@ public class PacketPartPlacement extends AppEngPacket float eyeHeight; // automatic. - public PacketPartPlacement( ByteBuf stream ) + public PacketPartPlacement( final ByteBuf stream ) { this.x = stream.readInt(); this.y = stream.readInt(); @@ -51,9 +51,9 @@ public class PacketPartPlacement extends AppEngPacket } // api - public PacketPartPlacement( BlockPos pos, EnumFacing face, float eyeHeight ) + public PacketPartPlacement( final BlockPos pos, final EnumFacing face, final float eyeHeight ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( pos.getX() ); @@ -66,9 +66,9 @@ public class PacketPartPlacement extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; CommonHelper.proxy.updateRenderMode( sender ); PartPlacement.eyeHeight = this.eyeHeight; PartPlacement.place( sender.getHeldItem(), new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[ this.face ], sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 ); diff --git a/src/main/java/appeng/core/sync/packets/PacketPartialItem.java b/src/main/java/appeng/core/sync/packets/PacketPartialItem.java index a8c2a37b..7c7298e2 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPartialItem.java +++ b/src/main/java/appeng/core/sync/packets/PacketPartialItem.java @@ -34,17 +34,17 @@ public class PacketPartialItem extends AppEngPacket final byte[] data; // automatic. - public PacketPartialItem( ByteBuf stream ) + public PacketPartialItem( final ByteBuf stream ) { this.pageNum = stream.readShort(); stream.readBytes( this.data = new byte[stream.readableBytes()] ); } // api - public PacketPartialItem( int page, int maxPages, byte[] buf ) + public PacketPartialItem( final int page, final int maxPages, final byte[] buf ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); this.pageNum = (short) ( page | ( maxPages << 8 ) ); this.data = buf; @@ -56,7 +56,7 @@ public class PacketPartialItem extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { if( player.openContainer instanceof AEBaseContainer ) { @@ -74,7 +74,7 @@ public class PacketPartialItem extends AppEngPacket return this.data.length; } - public int write( byte[] buffer, int cursor ) + public int write( final byte[] buffer, final int cursor ) { System.arraycopy( this.data, 0, buffer, cursor, this.data.length ); return cursor + this.data.length; diff --git a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java index 8baeda3a..18491f09 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java +++ b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java @@ -45,7 +45,7 @@ public class PacketPatternSlot extends AppEngPacket public final boolean shift; // automatic. - public PacketPatternSlot( ByteBuf stream ) throws IOException + public PacketPatternSlot( final ByteBuf stream ) throws IOException { this.shift = stream.readBoolean(); @@ -58,9 +58,9 @@ public class PacketPatternSlot extends AppEngPacket } } - public IAEItemStack readItem( ByteBuf stream ) throws IOException + public IAEItemStack readItem( final ByteBuf stream ) throws IOException { - boolean hasItem = stream.readBoolean(); + final boolean hasItem = stream.readBoolean(); if( hasItem ) { @@ -71,13 +71,13 @@ public class PacketPatternSlot extends AppEngPacket } // api - public PacketPatternSlot( IInventory pat, IAEItemStack slotItem, boolean shift ) throws IOException + public PacketPatternSlot( final IInventory pat, final IAEItemStack slotItem, final boolean shift ) throws IOException { this.slotItem = slotItem; this.shift = shift; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); @@ -93,7 +93,7 @@ public class PacketPatternSlot extends AppEngPacket this.configureWrite( data ); } - private void writeItem( IAEItemStack slotItem, ByteBuf data ) throws IOException + private void writeItem( final IAEItemStack slotItem, final ByteBuf data ) throws IOException { if( slotItem == null ) { @@ -107,12 +107,12 @@ public class PacketPatternSlot extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - EntityPlayerMP sender = (EntityPlayerMP) player; + final EntityPlayerMP sender = (EntityPlayerMP) player; if( sender.openContainer instanceof ContainerPatternTerm ) { - ContainerPatternTerm patternTerminal = (ContainerPatternTerm) sender.openContainer; + final ContainerPatternTerm patternTerminal = (ContainerPatternTerm) sender.openContainer; patternTerminal.craftOrGetItem( this ); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketProgressBar.java b/src/main/java/appeng/core/sync/packets/PacketProgressBar.java index 1a39b9d3..3f35a976 100644 --- a/src/main/java/appeng/core/sync/packets/PacketProgressBar.java +++ b/src/main/java/appeng/core/sync/packets/PacketProgressBar.java @@ -35,19 +35,19 @@ public class PacketProgressBar extends AppEngPacket final long value; // automatic. - public PacketProgressBar( ByteBuf stream ) + public PacketProgressBar( final ByteBuf stream ) { this.id = stream.readShort(); this.value = stream.readLong(); } // api - public PacketProgressBar( int shortID, long value ) + public PacketProgressBar( final int shortID, final long value ) { this.id = (short) shortID; this.value = value; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeShort( shortID ); @@ -57,9 +57,9 @@ public class PacketProgressBar extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( c instanceof AEBaseContainer ) { ( (AEBaseContainer) c ).updateFullProgressBar( this.id, this.value ); @@ -67,9 +67,9 @@ public class PacketProgressBar extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( c instanceof AEBaseContainer ) { ( (AEBaseContainer) c ).updateFullProgressBar( this.id, this.value ); diff --git a/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java b/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java index d917539f..448cd709 100644 --- a/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java +++ b/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java @@ -34,16 +34,16 @@ public class PacketSwapSlots extends AppEngPacket final int slotB; // automatic. - public PacketSwapSlots( ByteBuf stream ) + public PacketSwapSlots( final ByteBuf stream ) { this.slotA = stream.readInt(); this.slotB = stream.readInt(); } // api - public PacketSwapSlots( int slotA, int slotB ) + public PacketSwapSlots( final int slotA, final int slotB ) { - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( this.slotA = slotA ); @@ -53,7 +53,7 @@ public class PacketSwapSlots extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { if( player != null && player.openContainer instanceof AEBaseContainer ) { diff --git a/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java b/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java index 7b48d28f..fdb5a039 100644 --- a/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java +++ b/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java @@ -39,13 +39,13 @@ public class PacketSwitchGuis extends AppEngPacket final GuiBridge newGui; // automatic. - public PacketSwitchGuis( ByteBuf stream ) + public PacketSwitchGuis( final ByteBuf stream ) { this.newGui = GuiBridge.values()[stream.readInt()]; } // api - public PacketSwitchGuis( GuiBridge newGui ) + public PacketSwitchGuis( final GuiBridge newGui ) { this.newGui = newGui; @@ -54,7 +54,7 @@ public class PacketSwitchGuis extends AppEngPacket AEBaseGui.switchingGuis = true; } - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeInt( newGui.ordinal() ); @@ -63,23 +63,23 @@ public class PacketSwitchGuis extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( c instanceof AEBaseContainer ) { - AEBaseContainer bc = (AEBaseContainer) c; - ContainerOpenContext context = bc.openContext; + final AEBaseContainer bc = (AEBaseContainer) c; + final ContainerOpenContext context = bc.openContext; if( context != null ) { - TileEntity te = context.getTile(); + final TileEntity te = context.getTile(); Platform.openGUI( player, te, context.side, this.newGui ); } } } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { AEBaseGui.switchingGuis = true; } diff --git a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java index b33b207a..b8b90bac 100644 --- a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java +++ b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java @@ -50,7 +50,7 @@ public class PacketTransitionEffect extends AppEngPacket final AEPartLocation d; // automatic. - public PacketTransitionEffect( ByteBuf stream ) + public PacketTransitionEffect( final ByteBuf stream ) { this.x = stream.readFloat(); this.y = stream.readFloat(); @@ -60,7 +60,7 @@ public class PacketTransitionEffect extends AppEngPacket } // api - public PacketTransitionEffect( double x, double y, double z, AEPartLocation dir, boolean wasBlock ) + public PacketTransitionEffect( final double x, final double y, final double z, final AEPartLocation dir, final boolean wasBlock ) { this.x = x; this.y = y; @@ -68,7 +68,7 @@ public class PacketTransitionEffect extends AppEngPacket this.d = dir; this.mode = wasBlock; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); data.writeFloat( (float) x ); @@ -82,15 +82,15 @@ public class PacketTransitionEffect extends AppEngPacket @Override @SideOnly( Side.CLIENT ) - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - World world = ClientHelper.proxy.getWorld(); + final World world = ClientHelper.proxy.getWorld(); for( int zz = 0; zz < ( this.mode ? 32 : 8 ); zz++ ) { if( CommonHelper.proxy.shouldAddParticles( Platform.getRandom() ) ) { - EnergyFx fx = new EnergyFx( world, this.x + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.y + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.z + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), Items.diamond ); + final EnergyFx fx = new EnergyFx( world, this.x + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.y + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.z + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), Items.diamond ); if( !this.mode ) { @@ -107,7 +107,7 @@ public class PacketTransitionEffect extends AppEngPacket if( this.mode ) { - Block block = world.getBlockState( new BlockPos( (int) this.x, (int) this.y, (int) this.z ) ).getBlock(); + final Block block = world.getBlockState( new BlockPos( (int) this.x, (int) this.y, (int) this.z ) ).getBlock(); Minecraft.getMinecraft().getSoundHandler().playSound( new PositionedSoundRecord( new ResourceLocation( block.stepSound.getBreakSound() ), ( block.stepSound.getVolume() + 1.0F ) / 2.0F, block.stepSound.getFrequency() * 0.8F, (float) this.x + 0.5F, (float) this.y + 0.5F, (float) this.z + 0.5F ) ); } diff --git a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java index 0ae48118..23ffab1d 100644 --- a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java +++ b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java @@ -62,26 +62,26 @@ public class PacketValueConfig extends AppEngPacket public final String Value; // automatic. - public PacketValueConfig( ByteBuf stream ) throws IOException + public PacketValueConfig( final ByteBuf stream ) throws IOException { - DataInputStream dis = new DataInputStream( new ByteArrayInputStream( stream.array(), stream.readerIndex(), stream.readableBytes() ) ); + final DataInputStream dis = new DataInputStream( new ByteArrayInputStream( stream.array(), stream.readerIndex(), stream.readableBytes() ) ); this.Name = dis.readUTF(); this.Value = dis.readUTF(); // dis.close(); } // api - public PacketValueConfig( String name, String value ) throws IOException + public PacketValueConfig( final String name, final String value ) throws IOException { this.Name = name; this.Value = value; - ByteBuf data = Unpooled.buffer(); + final ByteBuf data = Unpooled.buffer(); data.writeInt( this.getPacketID() ); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream dos = new DataOutputStream( bos ); + final ByteArrayOutputStream bos = new ByteArrayOutputStream(); + final DataOutputStream dos = new DataOutputStream( bos ); dos.writeUTF( name ); dos.writeUTF( value ); // dos.close(); @@ -92,59 +92,59 @@ public class PacketValueConfig extends AppEngPacket } @Override - public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player ) + public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( this.Name.equals( "Item" ) && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IMouseWheelItem ) { - ItemStack is = player.getHeldItem(); - IMouseWheelItem si = (IMouseWheelItem) is.getItem(); + final ItemStack is = player.getHeldItem(); + final IMouseWheelItem si = (IMouseWheelItem) is.getItem(); si.onWheel( is, this.Value.equals( "WheelUp" ) ); } else if( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftingStatus ) { - ContainerCraftingStatus qk = (ContainerCraftingStatus) c; + final ContainerCraftingStatus qk = (ContainerCraftingStatus) c; qk.cycleCpu( this.Value.equals( "Next" ) ); } else if( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftConfirm ) { - ContainerCraftConfirm qk = (ContainerCraftConfirm) c; + final ContainerCraftConfirm qk = (ContainerCraftConfirm) c; qk.cycleCpu( this.Value.equals( "Next" ) ); } else if( this.Name.equals( "Terminal.Start" ) && c instanceof ContainerCraftConfirm ) { - ContainerCraftConfirm qk = (ContainerCraftConfirm) c; + final ContainerCraftConfirm qk = (ContainerCraftConfirm) c; qk.startJob(); } else if( this.Name.equals( "TileCrafting.Cancel" ) && c instanceof ContainerCraftingCPU ) { - ContainerCraftingCPU qk = (ContainerCraftingCPU) c; + final ContainerCraftingCPU qk = (ContainerCraftingCPU) c; qk.cancelCrafting(); } else if( this.Name.equals( "QuartzKnife.Name" ) && c instanceof ContainerQuartzKnife ) { - ContainerQuartzKnife qk = (ContainerQuartzKnife) c; + final ContainerQuartzKnife qk = (ContainerQuartzKnife) c; qk.setName( this.Value ); } else if( this.Name.equals( "TileSecurity.ToggleOption" ) && c instanceof ContainerSecurity ) { - ContainerSecurity sc = (ContainerSecurity) c; + final ContainerSecurity sc = (ContainerSecurity) c; sc.toggleSetting( this.Value, player ); } else if( this.Name.equals( "PriorityHost.Priority" ) && c instanceof ContainerPriority ) { - ContainerPriority pc = (ContainerPriority) c; + final ContainerPriority pc = (ContainerPriority) c; pc.setPriority( Integer.parseInt( this.Value ), player ); } else if( this.Name.equals( "LevelEmitter.Value" ) && c instanceof ContainerLevelEmitter ) { - ContainerLevelEmitter lvc = (ContainerLevelEmitter) c; + final ContainerLevelEmitter lvc = (ContainerLevelEmitter) c; lvc.setLevel( Long.parseLong( this.Value ), player ); } else if( this.Name.startsWith( "PatternTerminal." ) && c instanceof ContainerPatternTerm ) { - ContainerPatternTerm cpt = (ContainerPatternTerm) c; + final ContainerPatternTerm cpt = (ContainerPatternTerm) c; if( this.Name.equals( "PatternTerminal.CraftMode" ) ) { cpt.ct.setCraftingRecipe( this.Value.equals( "1" ) ); @@ -160,7 +160,7 @@ public class PacketValueConfig extends AppEngPacket } else if( this.Name.startsWith( "StorageBus." ) && c instanceof ContainerStorageBus ) { - ContainerStorageBus ccw = (ContainerStorageBus) c; + final ContainerStorageBus ccw = (ContainerStorageBus) c; if( this.Name.equals( "StorageBus.Action" ) ) { if( this.Value.equals( "Partition" ) ) @@ -175,7 +175,7 @@ public class PacketValueConfig extends AppEngPacket } else if( this.Name.startsWith( "CellWorkbench." ) && c instanceof ContainerCellWorkbench ) { - ContainerCellWorkbench ccw = (ContainerCellWorkbench) c; + final ContainerCellWorkbench ccw = (ContainerCellWorkbench) c; if( this.Name.equals( "CellWorkbench.Action" ) ) { if( this.Value.equals( "CopyMode" ) ) @@ -205,19 +205,19 @@ public class PacketValueConfig extends AppEngPacket } else if( c instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); + final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); - for( Settings e : cm.getSettings() ) + for( final Settings e : cm.getSettings() ) { if( e.name().equals( this.Name ) ) { - Enum def = cm.getSetting( e ); + final Enum def = cm.getSetting( e ); try { cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) ); } - catch( IllegalArgumentException err ) + catch( final IllegalArgumentException err ) { // :P } @@ -229,9 +229,9 @@ public class PacketValueConfig extends AppEngPacket } @Override - public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player ) + public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { - Container c = player.openContainer; + final Container c = player.openContainer; if( this.Name.equals( "CustomName" ) && c instanceof AEBaseContainer ) { @@ -243,7 +243,7 @@ public class PacketValueConfig extends AppEngPacket } else if( this.Name.equals( "CraftingStatus" ) && this.Value.equals( "Clear" ) ) { - GuiScreen gs = Minecraft.getMinecraft().currentScreen; + final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiCraftingCPU ) { ( (GuiCraftingCPU) gs ).clearItems(); @@ -251,19 +251,19 @@ public class PacketValueConfig extends AppEngPacket } else if( c instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); + final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); - for( Settings e : cm.getSettings() ) + for( final Settings e : cm.getSettings() ) { if( e.name().equals( this.Name ) ) { - Enum def = cm.getSetting( e ); + final Enum def = cm.getSetting( e ); try { cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) ); } - catch( IllegalArgumentException err ) + catch( final IllegalArgumentException err ) { // :P } diff --git a/src/main/java/appeng/core/worlddata/DimensionData.java b/src/main/java/appeng/core/worlddata/DimensionData.java index 426160e6..187481f4 100644 --- a/src/main/java/appeng/core/worlddata/DimensionData.java +++ b/src/main/java/appeng/core/worlddata/DimensionData.java @@ -72,7 +72,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn final int[] storageCellIDs = this.storageCellIDsProperty().getIntList(); this.storageCellDimensionIDs = Lists.newArrayList(); - for( int storageCellID : storageCellIDs ) + for( final int storageCellID : storageCellIDs ) { this.storageCellDimensionIDs.add( storageCellID ); } @@ -86,7 +86,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn @Override public void onWorldStart() { - for( Integer storageCellDimID : this.storageCellDimensionIDs ) + for( final Integer storageCellDimID : this.storageCellDimensionIDs ) { DimensionManager.registerDimension( storageCellDimID, AEConfig.instance.storageProviderID ); } @@ -99,7 +99,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn { this.config.save(); - for( Integer storageCellDimID : this.storageCellDimensionIDs ) + for( final Integer storageCellDimID : this.storageCellDimensionIDs ) { DimensionManager.unregisterDimension( storageCellDimID ); } @@ -108,14 +108,14 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn } @Override - public void addStorageCell( int newStorageCellID ) + public void addStorageCell( final int newStorageCellID ) { this.storageCellDimensionIDs.add( newStorageCellID ); DimensionManager.registerDimension( newStorageCellID, AEConfig.instance.storageProviderID ); NetworkHandler.instance.sendToAll( new PacketNewStorageDimension( newStorageCellID ) ); - String[] values = new String[this.storageCellDimensionIDs.size()]; + final String[] values = new String[this.storageCellDimensionIDs.size()]; for( int x = 0; x < values.length; x++ ) { @@ -127,7 +127,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn } @Override - public WorldCoord getStoredSize( int dim ) + public WorldCoord getStoredSize( final int dim ) { final String category = STORAGE_CELL_CATEGORY + dim; @@ -139,7 +139,7 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn } @Override - public void setStoredSize( int dim, int targetX, int targetY, int targetZ ) + public void setStoredSize( final int dim, final int targetX, final int targetY, final int targetZ ) { final String category = STORAGE_CELL_CATEGORY + dim; @@ -155,14 +155,14 @@ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOn { if( manager != null ) { - for( int newDim : this.config.get( PACKAGE_DEST_CATEGORY, PACKAGE_KEY_CATEGORY, PACKAGE_DEF_CATEGORY ).getIntList() ) + for( final int newDim : this.config.get( PACKAGE_DEST_CATEGORY, PACKAGE_KEY_CATEGORY, PACKAGE_DEF_CATEGORY ).getIntList() ) { manager.sendPacket( ( new PacketNewStorageDimension( newDim ) ).getProxy() ); } } else { - for( TickHandler.PlayerColor pc : TickHandler.INSTANCE.getPlayerColors().values() ) + for( final TickHandler.PlayerColor pc : TickHandler.INSTANCE.getPlayerColors().values() ) { NetworkHandler.instance.sendToAll( pc.getPacket() ); } diff --git a/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java b/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java index f5aa6d74..8caef8e2 100644 --- a/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java +++ b/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java @@ -51,7 +51,7 @@ public class MeteorDataNameEncoder this( DATA_SEPARATOR, BASE_EXTENSION_SEPARATOR, FILE_EXTENSION, bitScale ); } - private MeteorDataNameEncoder( char dataSeparator, char baseExtSeparator, @Nonnull final String fileExtension, final int bitScale ) + private MeteorDataNameEncoder( final char dataSeparator, final char baseExtSeparator, @Nonnull final String fileExtension, final int bitScale ) { Preconditions.checkNotNull( fileExtension ); Preconditions.checkArgument( !fileExtension.isEmpty() ); @@ -72,7 +72,7 @@ public class MeteorDataNameEncoder * * @since rv3 05.06.2015 */ - public String encode( int dimension, int chunkX, int chunkZ ) + public String encode( final int dimension, final int chunkX, final int chunkZ ) { final int shiftedX = chunkX >> this.bitScale; final int shiftedZ = chunkZ >> this.bitScale; diff --git a/src/main/java/appeng/core/worlddata/PlayerData.java b/src/main/java/appeng/core/worlddata/PlayerData.java index 07b536cf..960d2e6b 100644 --- a/src/main/java/appeng/core/worlddata/PlayerData.java +++ b/src/main/java/appeng/core/worlddata/PlayerData.java @@ -68,14 +68,14 @@ final class PlayerData implements IWorldPlayerData, IOnWorldStartable, IOnWorldS @Nullable @Override - public EntityPlayer getPlayerFromID( int playerID ) + public EntityPlayer getPlayerFromID( final int playerID ) { final Optional maybe = this.playerMapping.get( playerID ); if( maybe.isPresent() ) { final UUID uuid = maybe.get(); - for( EntityPlayer player : CommonHelper.proxy.getPlayers() ) + for( final EntityPlayer player : CommonHelper.proxy.getPlayers() ) { if( player.getUniqueID().equals( uuid ) ) { diff --git a/src/main/java/appeng/core/worlddata/PlayerMapping.java b/src/main/java/appeng/core/worlddata/PlayerMapping.java index 98189112..bc8e9900 100644 --- a/src/main/java/appeng/core/worlddata/PlayerMapping.java +++ b/src/main/java/appeng/core/worlddata/PlayerMapping.java @@ -44,7 +44,7 @@ final class PlayerMapping implements IWorldPlayerMapping */ private final Map mappings; - public PlayerMapping( ConfigCategory category ) + public PlayerMapping( final ConfigCategory category ) { final PlayerMappingsInitializer init = new PlayerMappingsInitializer( category ); @@ -53,7 +53,7 @@ final class PlayerMapping implements IWorldPlayerMapping @Nonnull @Override - public Optional get( int id ) + public Optional get( final int id ) { final UUID maybe = this.mappings.get( id ); @@ -61,7 +61,7 @@ final class PlayerMapping implements IWorldPlayerMapping } @Override - public void put( int id, @Nonnull UUID uuid ) + public void put( final int id, @Nonnull final UUID uuid ) { Preconditions.checkNotNull( uuid ); diff --git a/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java b/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java index 55e8deb6..4199f8a2 100644 --- a/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java +++ b/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java @@ -50,7 +50,7 @@ class PlayerMappingsInitializer * * @param playerList the category for the player list, generally extracted using the "players" tag */ - PlayerMappingsInitializer( ConfigCategory playerList ) + PlayerMappingsInitializer( final ConfigCategory playerList ) { // Matcher for UUIDs final UUIDMatcher matcher = new UUIDMatcher(); @@ -62,7 +62,7 @@ class PlayerMappingsInitializer this.playerMappings = new HashMap<>( capacity ); // Iterates through every pair of UUID to ID - for( Map.Entry entry : playerList.getValues().entrySet() ) + for( final Map.Entry entry : playerList.getValues().entrySet() ) { final String maybeUUID = entry.getKey(); final int id = entry.getValue().getInt(); diff --git a/src/main/java/appeng/core/worlddata/SpawnData.java b/src/main/java/appeng/core/worlddata/SpawnData.java index 35f01790..7564614b 100644 --- a/src/main/java/appeng/core/worlddata/SpawnData.java +++ b/src/main/java/appeng/core/worlddata/SpawnData.java @@ -57,10 +57,10 @@ final class SpawnData implements IWorldSpawnData } @Override - public void setGenerated( int dim, int chunkX, int chunkZ ) { + public void setGenerated( final int dim, final int chunkX, final int chunkZ ) { synchronized( SpawnData.class ) { - NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); + final NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); // edit. data.setBoolean( chunkX + "," + chunkZ, true ); @@ -70,24 +70,24 @@ final class SpawnData implements IWorldSpawnData } @Override - public boolean hasGenerated( int dim, int chunkX, int chunkZ ) + public boolean hasGenerated( final int dim, final int chunkX, final int chunkZ ) { synchronized( SpawnData.class ) { - NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); + final NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); return data.getBoolean( chunkX + "," + chunkZ ); } } @Override - public boolean addNearByMeteorites( int dim, int chunkX, int chunkZ, NBTTagCompound newData ) + public boolean addNearByMeteorites( final int dim, final int chunkX, final int chunkZ, final NBTTagCompound newData ) { synchronized( SpawnData.class ) { - NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); + final NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ ); // edit. - int size = data.getInteger( "num" ); + final int size = data.getInteger( "num" ); data.setTag( String.valueOf( size ), newData ); data.setInteger( "num", size + 1 ); @@ -98,9 +98,9 @@ final class SpawnData implements IWorldSpawnData } @Override - public Collection getNearByMeteorites( int dim, int chunkX, int chunkZ ) + public Collection getNearByMeteorites( final int dim, final int chunkX, final int chunkZ ) { - Collection ll = new LinkedList(); + final Collection ll = new LinkedList(); synchronized( SpawnData.class ) { @@ -108,15 +108,15 @@ final class SpawnData implements IWorldSpawnData { for( int z = -1; z <= 1; z++ ) { - int cx = x + ( chunkX >> 4 ); - int cz = z + ( chunkZ >> 4 ); + final int cx = x + ( chunkX >> 4 ); + final int cz = z + ( chunkZ >> 4 ); - NBTTagCompound data = this.loadSpawnData( dim, cx << 4, cz << 4 ); + final NBTTagCompound data = this.loadSpawnData( dim, cx << 4, cz << 4 ); if( data != null ) { // edit. - int size = data.getInteger( "num" ); + final int size = data.getInteger( "num" ); for( int s = 0; s < size; s++ ) { ll.add( data.getCompoundTag( String.valueOf( s ) ) ); @@ -129,7 +129,7 @@ final class SpawnData implements IWorldSpawnData return ll; } - private NBTTagCompound loadSpawnData( int dim, int chunkX, int chunkZ ) + private NBTTagCompound loadSpawnData( final int dim, final int chunkX, final int chunkZ ) { if( !Thread.holdsLock( SpawnData.class ) ) { @@ -149,7 +149,7 @@ final class SpawnData implements IWorldSpawnData fileInputStream = new FileInputStream( file ); data = CompressedStreamTools.readCompressed( fileInputStream ); } - catch( Throwable e ) + catch( final Throwable e ) { data = new NBTTagCompound(); AELog.error( e ); @@ -162,7 +162,7 @@ final class SpawnData implements IWorldSpawnData { fileInputStream.close(); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -177,7 +177,7 @@ final class SpawnData implements IWorldSpawnData return data; } - private void writeSpawnData( int dim, int chunkX, int chunkZ, NBTTagCompound data ) + private void writeSpawnData( final int dim, final int chunkX, final int chunkZ, final NBTTagCompound data ) { if( !Thread.holdsLock( SpawnData.class ) ) { @@ -193,7 +193,7 @@ final class SpawnData implements IWorldSpawnData fileOutputStream = new FileOutputStream( file ); CompressedStreamTools.writeCompressed( data, fileOutputStream ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); } @@ -205,7 +205,7 @@ final class SpawnData implements IWorldSpawnData { fileOutputStream.close(); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/core/worlddata/StorageData.java b/src/main/java/appeng/core/worlddata/StorageData.java index f7d290b2..e13be38c 100644 --- a/src/main/java/appeng/core/worlddata/StorageData.java +++ b/src/main/java/appeng/core/worlddata/StorageData.java @@ -70,16 +70,16 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn */ @Nullable @Override - public GridStorage getGridStorage( long storageID ) + public GridStorage getGridStorage( final long storageID ) { - GridStorageSearch gss = new GridStorageSearch( storageID ); - WeakReference result = this.loadedStorage.get( gss ); + final GridStorageSearch gss = new GridStorageSearch( storageID ); + final WeakReference result = this.loadedStorage.get( gss ); if( result == null || result.get() == null ) { - String id = String.valueOf( storageID ); - String data = this.config.get( "gridstorage", id, "" ).getString(); - GridStorage thisStorage = new GridStorage( data, storageID, gss ); + final String id = String.valueOf( storageID ); + final String data = this.config.get( "gridstorage", id, "" ).getString(); + final GridStorage thisStorage = new GridStorage( data, storageID, gss ); gss.gridStorage = new WeakReference( thisStorage ); this.loadedStorage.put( gss, new WeakReference( gss ) ); return thisStorage; @@ -95,9 +95,9 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn @Override public GridStorage getNewGridStorage() { - long storageID = this.nextGridStorage(); - GridStorageSearch gss = new GridStorageSearch( storageID ); - GridStorage newStorage = new GridStorage( storageID, gss ); + final long storageID = this.nextGridStorage(); + final GridStorageSearch gss = new GridStorageSearch( storageID ); + final GridStorage newStorage = new GridStorage( storageID, gss ); gss.gridStorage = new WeakReference( newStorage ); this.loadedStorage.put( gss, new WeakReference( gss ) ); @@ -107,24 +107,24 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn @Override public long nextGridStorage() { - long r = this.lastGridStorage; + final long r = this.lastGridStorage; this.lastGridStorage++; this.config.get( "Counters", "lastGridStorage", this.lastGridStorage ).set( Long.toString( this.lastGridStorage ) ); return r; } @Override - public void destroyGridStorage( long id ) + public void destroyGridStorage( final long id ) { - String stringID = String.valueOf( id ); + final String stringID = String.valueOf( id ); this.config.getCategory( "gridstorage" ).remove( stringID ); } @Override - public int getNextOrderedValue( String name ) + public int getNextOrderedValue( final String name ) { - Property p = this.config.get( "orderedValues", name, 0 ); - int myValue = p.getInt(); + final Property p = this.config.get( "orderedValues", name, 0 ); + final int myValue = p.getInt(); p.set( myValue + 1 ); return myValue; } @@ -138,7 +138,7 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn { this.lastGridStorage = Long.parseLong( lastString ); } - catch( NumberFormatException err ) + catch( final NumberFormatException err ) { AELog.warning( "The config contained a value which was not represented as a Long: %s", lastString ); @@ -150,12 +150,12 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn public void onWorldStop() { // populate new data - for( GridStorageSearch gs : this.loadedStorage.keySet() ) + for( final GridStorageSearch gs : this.loadedStorage.keySet() ) { - GridStorage thisStorage = gs.gridStorage.get(); + final GridStorage thisStorage = gs.gridStorage.get(); if( thisStorage != null && thisStorage.getGrid() != null && !thisStorage.getGrid().isEmpty() ) { - String value = thisStorage.getValue(); + final String value = thisStorage.getValue(); this.config.get( GRID_STORAGE_CATEGORY, String.valueOf( thisStorage.getID() ), value ).set( value ); } } diff --git a/src/main/java/appeng/core/worlddata/WorldData.java b/src/main/java/appeng/core/worlddata/WorldData.java index c351fa9b..86025bf4 100644 --- a/src/main/java/appeng/core/worlddata/WorldData.java +++ b/src/main/java/appeng/core/worlddata/WorldData.java @@ -151,7 +151,7 @@ public final class WorldData implements IWorldData throw new IllegalStateException( "Failed to create " + this.spawnDirectory.getAbsolutePath() ); } - for( IOnWorldStartable startable : this.startables ) + for( final IOnWorldStartable startable : this.startables ) { startable.onWorldStart(); } @@ -164,7 +164,7 @@ public final class WorldData implements IWorldData { Preconditions.checkNotNull( instance ); - for( IOnWorldStoppable stoppable : this.stoppables ) + for( final IOnWorldStoppable stoppable : this.stoppables ) { stoppable.onWorldStop(); } diff --git a/src/main/java/appeng/crafting/CraftBranchFailure.java b/src/main/java/appeng/crafting/CraftBranchFailure.java index fcd517fa..c8da305e 100644 --- a/src/main/java/appeng/crafting/CraftBranchFailure.java +++ b/src/main/java/appeng/crafting/CraftBranchFailure.java @@ -29,7 +29,7 @@ public class CraftBranchFailure extends Exception final IAEItemStack missing; - public CraftBranchFailure( IAEItemStack what, long howMany ) + public CraftBranchFailure( final IAEItemStack what, final long howMany ) { super( "Failed: " + what.getItem().getUnlocalizedName() + " x " + howMany ); this.missing = what.copy(); diff --git a/src/main/java/appeng/crafting/CraftingCalculationFailure.java b/src/main/java/appeng/crafting/CraftingCalculationFailure.java index fbb66eac..d34ff80f 100644 --- a/src/main/java/appeng/crafting/CraftingCalculationFailure.java +++ b/src/main/java/appeng/crafting/CraftingCalculationFailure.java @@ -29,7 +29,7 @@ public class CraftingCalculationFailure extends RuntimeException final IAEItemStack missing; - public CraftingCalculationFailure( IAEItemStack what, long howMany ) + public CraftingCalculationFailure( final IAEItemStack what, final long howMany ) { super( "this should have been caught!" ); this.missing = what.copy(); diff --git a/src/main/java/appeng/crafting/CraftingJob.java b/src/main/java/appeng/crafting/CraftingJob.java index a59dc62d..3f7a1de7 100644 --- a/src/main/java/appeng/crafting/CraftingJob.java +++ b/src/main/java/appeng/crafting/CraftingJob.java @@ -67,7 +67,7 @@ public class CraftingJob implements Runnable, ICraftingJob private int time = 5; private int incTime = Integer.MAX_VALUE; - public CraftingJob( World w, NBTTagCompound data ) + public CraftingJob( final World w, final NBTTagCompound data ) { this.world = this.wrapWorld( w ); this.storage = AEApi.instance().storage().createItemList(); @@ -76,12 +76,12 @@ public class CraftingJob implements Runnable, ICraftingJob this.availableCheck = null; } - private World wrapWorld( World w ) + private World wrapWorld( final World w ) { return w; } - public CraftingJob( World w, IGrid grid, BaseActionSource actionSrc, IAEItemStack what, ICraftingCallback callback ) + public CraftingJob( final World w, final IGrid grid, final BaseActionSource actionSrc, final IAEItemStack what, final ICraftingCallback callback ) { this.world = this.wrapWorld( w ); this.output = what.copy(); @@ -90,35 +90,35 @@ public class CraftingJob implements Runnable, ICraftingJob this.actionSrc = actionSrc; this.callback = callback; - ICraftingGrid cc = grid.getCache( ICraftingGrid.class ); - IStorageGrid sg = grid.getCache( IStorageGrid.class ); + final ICraftingGrid cc = grid.getCache( ICraftingGrid.class ); + final IStorageGrid sg = grid.getCache( IStorageGrid.class ); this.original = new MECraftingInventory( sg.getItemInventory(), actionSrc, false, false, false ); this.tree = this.getCraftingTree( cc, what ); this.availableCheck = null; } - private CraftingTreeNode getCraftingTree( ICraftingGrid cc, IAEItemStack what ) + private CraftingTreeNode getCraftingTree( final ICraftingGrid cc, final IAEItemStack what ) { return new CraftingTreeNode( cc, this, what, null, -1, 0 ); } - public void refund( IAEItemStack o ) + public void refund( final IAEItemStack o ) { this.availableCheck.injectItems( o, Actionable.MODULATE, this.actionSrc ); } - public IAEItemStack checkUse( IAEItemStack available ) + public IAEItemStack checkUse( final IAEItemStack available ) { return this.availableCheck.extractItems( available, Actionable.MODULATE, this.actionSrc ); } - public void writeToNBT( NBTTagCompound out ) + public void writeToNBT( final NBTTagCompound out ) { } - public void addTask( IAEItemStack what, long crafts, ICraftingPatternDetails details, int depth ) + public void addTask( IAEItemStack what, final long crafts, final ICraftingPatternDetails details, final int depth ) { if( crafts > 0 ) { @@ -144,18 +144,18 @@ public class CraftingJob implements Runnable, ICraftingJob TickHandler.INSTANCE.registerCraftingSimulation( this.world, this ); this.handlePausing(); - Stopwatch timer = Stopwatch.createStarted(); + final Stopwatch timer = Stopwatch.createStarted(); - MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); + final MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); craftingInventory.ignore( this.output ); this.availableCheck = new MECraftingInventory( this.original, false, false, false ); this.tree.request( craftingInventory, this.output.getStackSize(), this.actionSrc ); this.tree.dive( this ); - for( String s : this.opsAndMultiplier.keySet() ) + for( final String s : this.opsAndMultiplier.keySet() ) { - TwoIntegers ti = this.opsAndMultiplier.get( s ); + final TwoIntegers ti = this.opsAndMultiplier.get( s ); AELog.crafting( s + " * " + ti.times + " = " + ( ti.perOp * ti.times ) ); } @@ -163,14 +163,14 @@ public class CraftingJob implements Runnable, ICraftingJob // if ( mode == Actionable.MODULATE ) // craftingInventory.moveItemsToStorage( storage ); } - catch( CraftBranchFailure e ) + catch( final CraftBranchFailure e ) { this.simulate = true; try { - Stopwatch timer = Stopwatch.createStarted(); - MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); + final Stopwatch timer = Stopwatch.createStarted(); + final MECraftingInventory craftingInventory = new MECraftingInventory( this.original, true, false, true ); craftingInventory.ignore( this.output ); this.availableCheck = new MECraftingInventory( this.original, false, false, false ); @@ -179,34 +179,34 @@ public class CraftingJob implements Runnable, ICraftingJob this.tree.request( craftingInventory, this.output.getStackSize(), this.actionSrc ); this.tree.dive( this ); - for( String s : this.opsAndMultiplier.keySet() ) + for( final String s : this.opsAndMultiplier.keySet() ) { - TwoIntegers ti = this.opsAndMultiplier.get( s ); + final TwoIntegers ti = this.opsAndMultiplier.get( s ); AELog.crafting( s + " * " + ti.times + " = " + ( ti.perOp * ti.times ) ); } AELog.crafting( "------------- " + this.bytes + "b simulate" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" ); } - catch( CraftBranchFailure e1 ) + catch( final CraftBranchFailure e1 ) { AELog.error( e1 ); } - catch( CraftingCalculationFailure f ) + catch( final CraftingCalculationFailure f ) { AELog.error( f ); } - catch( InterruptedException e1 ) + catch( final InterruptedException e1 ) { AELog.crafting( "Crafting calculation canceled." ); this.finish(); return; } } - catch( CraftingCalculationFailure f ) + catch( final CraftingCalculationFailure f ) { AELog.error( f ); } - catch( InterruptedException e1 ) + catch( final InterruptedException e1 ) { AELog.crafting( "Crafting calculation canceled." ); this.finish(); @@ -215,7 +215,7 @@ public class CraftingJob implements Runnable, ICraftingJob this.log( "crafting job now done" ); } - catch( Throwable t ) + catch( final Throwable t ) { this.finish(); throw new IllegalStateException( t ); @@ -277,7 +277,7 @@ public class CraftingJob implements Runnable, ICraftingJob } } - private void log( String string ) + private void log( final String string ) { // AELog.crafting( string ); } @@ -295,7 +295,7 @@ public class CraftingJob implements Runnable, ICraftingJob } @Override - public void populatePlan( IItemList plan ) + public void populatePlan( final IItemList plan ) { if( this.tree != null ) { @@ -326,7 +326,7 @@ public class CraftingJob implements Runnable, ICraftingJob * * @return true if this needs more simulation */ - public boolean simulateFor( int milli ) + public boolean simulateFor( final int milli ) { this.time = milli; @@ -351,7 +351,7 @@ public class CraftingJob implements Runnable, ICraftingJob { this.monitor.wait(); } - catch( InterruptedException ignored ) + catch( final InterruptedException ignored ) { } } @@ -362,7 +362,7 @@ public class CraftingJob implements Runnable, ICraftingJob return true; } - public void addBytes( long crafts ) + public void addBytes( final long crafts ) { this.bytes += crafts; } diff --git a/src/main/java/appeng/crafting/CraftingLink.java b/src/main/java/appeng/crafting/CraftingLink.java index 54637924..805a52c4 100644 --- a/src/main/java/appeng/crafting/CraftingLink.java +++ b/src/main/java/appeng/crafting/CraftingLink.java @@ -38,7 +38,7 @@ public class CraftingLink implements ICraftingLink boolean done = false; CraftingLinkNexus tie; - public CraftingLink( NBTTagCompound data, ICraftingRequester req ) + public CraftingLink( final NBTTagCompound data, final ICraftingRequester req ) { this.CraftID = data.getString( "CraftID" ); this.canceled = data.getBoolean( "canceled" ); @@ -54,7 +54,7 @@ public class CraftingLink implements ICraftingLink this.cpu = null; } - public CraftingLink( NBTTagCompound data, ICraftingCPU cpu ) + public CraftingLink( final NBTTagCompound data, final ICraftingCPU cpu ) { this.CraftID = data.getString( "CraftID" ); this.canceled = data.getBoolean( "canceled" ); @@ -137,7 +137,7 @@ public class CraftingLink implements ICraftingLink } @Override - public void writeToNBT( NBTTagCompound tag ) + public void writeToNBT( final NBTTagCompound tag ) { tag.setString( "CraftID", this.CraftID ); tag.setBoolean( "canceled", this.canceled ); @@ -152,7 +152,7 @@ public class CraftingLink implements ICraftingLink return this.CraftID; } - public void setNexus( CraftingLinkNexus n ) + public void setNexus( final CraftingLinkNexus n ) { if( this.tie != null ) { @@ -174,7 +174,7 @@ public class CraftingLink implements ICraftingLink } } - public IAEItemStack injectItems( IAEItemStack input, Actionable mode ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode ) { if( this.tie == null || this.tie.req == null || this.tie.req.req == null ) { diff --git a/src/main/java/appeng/crafting/CraftingLinkNexus.java b/src/main/java/appeng/crafting/CraftingLinkNexus.java index 1082d223..a01a23dd 100644 --- a/src/main/java/appeng/crafting/CraftingLinkNexus.java +++ b/src/main/java/appeng/crafting/CraftingLinkNexus.java @@ -34,12 +34,12 @@ public class CraftingLinkNexus CraftingLink req; CraftingLink cpu; - public CraftingLinkNexus( String craftID ) + public CraftingLinkNexus( final String craftID ) { this.CraftID = craftID; } - public boolean isDead( IGrid g, CraftingGridCache craftingGridCache ) + public boolean isDead( final IGrid g, final CraftingGridCache craftingGridCache ) { if( this.canceled || this.done ) { @@ -52,8 +52,8 @@ public class CraftingLinkNexus } else { - boolean hasCpu = craftingGridCache.hasCpu( this.cpu.cpu ); - boolean hasMachine = this.req.req.getActionableNode().getGrid() == g; + final boolean hasCpu = craftingGridCache.hasCpu( this.cpu.cpu ); + final boolean hasMachine = this.req.req.getActionableNode().getGrid() == g; if( hasCpu && hasMachine ) { @@ -93,7 +93,7 @@ public class CraftingLinkNexus } } - public void remove( CraftingLink craftingLink ) + public void remove( final CraftingLink craftingLink ) { if( this.req == craftingLink ) { @@ -105,7 +105,7 @@ public class CraftingLinkNexus } } - public void add( CraftingLink craftingLink ) + public void add( final CraftingLink craftingLink ) { if( craftingLink.cpu != null ) { @@ -146,7 +146,7 @@ public class CraftingLinkNexus } } - public boolean isMachine( IGridHost machine ) + public boolean isMachine( final IGridHost machine ) { return this.req == machine; } diff --git a/src/main/java/appeng/crafting/CraftingTreeNode.java b/src/main/java/appeng/crafting/CraftingTreeNode.java index cc6cea5d..10db819e 100644 --- a/src/main/java/appeng/crafting/CraftingTreeNode.java +++ b/src/main/java/appeng/crafting/CraftingTreeNode.java @@ -58,7 +58,7 @@ public class CraftingTreeNode boolean sim; - public CraftingTreeNode( ICraftingGrid cc, CraftingJob job, IAEItemStack wat, CraftingTreeProcess par, int slot, int depth ) + public CraftingTreeNode( final ICraftingGrid cc, final CraftingJob job, final IAEItemStack wat, final CraftingTreeProcess par, final int slot, final int depth ) { this.what = wat; this.parent = par; @@ -73,7 +73,7 @@ public class CraftingTreeNode return; // if you can emit for something, you can't make it with patterns. } - for( ICraftingPatternDetails details : cc.getCraftingFor( this.what, this.parent == null ? null : this.parent.details, slot, this.world ) )// in + for( final ICraftingPatternDetails details : cc.getCraftingFor( this.what, this.parent == null ? null : this.parent.details, slot, this.world ) )// in // order. { if( this.parent == null || this.parent.notRecursive( details ) ) @@ -83,10 +83,10 @@ public class CraftingTreeNode } } - boolean notRecursive( ICraftingPatternDetails details ) + boolean notRecursive( final ICraftingPatternDetails details ) { IAEItemStack[] o = details.getCondensedOutputs(); - for( IAEItemStack i : o ) + for( final IAEItemStack i : o ) { if( i.equals( this.what ) ) { @@ -95,7 +95,7 @@ public class CraftingTreeNode } o = details.getCondensedInputs(); - for( IAEItemStack i : o ) + for( final IAEItemStack i : o ) { if( i.equals( this.what ) ) { @@ -111,11 +111,11 @@ public class CraftingTreeNode return this.parent.notRecursive( details ); } - public IAEItemStack request( MECraftingInventory inv, long l, BaseActionSource src ) throws CraftBranchFailure, InterruptedException + public IAEItemStack request( final MECraftingInventory inv, long l, final BaseActionSource src ) throws CraftBranchFailure, InterruptedException { this.job.handlePausing(); - List thingsUsed = new LinkedList(); + final List thingsUsed = new LinkedList(); this.what.setStackSize( l ); if( this.slot >= 0 && this.parent != null && this.parent.details.isCraftable() ) @@ -126,13 +126,13 @@ public class CraftingTreeNode { fuzz = fuzz.copy(); fuzz.setStackSize( l ); - IAEItemStack available = inv.extractItems( fuzz, Actionable.MODULATE, src ); + final IAEItemStack available = inv.extractItems( fuzz, Actionable.MODULATE, src ); if( available != null ) { if( !this.exhausted ) { - IAEItemStack is = this.job.checkUse( available ); + final IAEItemStack is = this.job.checkUse( available ); if( is != null ) { thingsUsed.add( is.copy() ); @@ -153,13 +153,13 @@ public class CraftingTreeNode } else { - IAEItemStack available = inv.extractItems( this.what, Actionable.MODULATE, src ); + final IAEItemStack available = inv.extractItems( this.what, Actionable.MODULATE, src ); if( available != null ) { if( !this.exhausted ) { - IAEItemStack is = this.job.checkUse( available ); + final IAEItemStack is = this.job.checkUse( available ); if( is != null ) { thingsUsed.add( is.copy() ); @@ -179,7 +179,7 @@ public class CraftingTreeNode if( this.canEmit ) { - IAEItemStack wat = this.what.copy(); + final IAEItemStack wat = this.what.copy(); wat.setStackSize( l ); this.howManyEmitted = wat.getStackSize(); @@ -192,16 +192,16 @@ public class CraftingTreeNode if( this.nodes.size() == 1 ) { - CraftingTreeProcess pro = this.nodes.get( 0 ); + final CraftingTreeProcess pro = this.nodes.get( 0 ); while( pro.possible && l > 0 ) { - IAEItemStack madeWhat = pro.getAmountCrafted( this.what ); + final IAEItemStack madeWhat = pro.getAmountCrafted( this.what ); pro.request( inv, pro.getTimes( l, madeWhat.getStackSize() ), src ); madeWhat.setStackSize( l ); - IAEItemStack available = inv.extractItems( madeWhat, Actionable.MODULATE, src ); + final IAEItemStack available = inv.extractItems( madeWhat, Actionable.MODULATE, src ); if( available != null ) { @@ -221,17 +221,17 @@ public class CraftingTreeNode } else if( this.nodes.size() > 1 ) { - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { try { while( pro.possible && l > 0 ) { - MECraftingInventory subInv = new MECraftingInventory( inv, true, true, true ); + final MECraftingInventory subInv = new MECraftingInventory( inv, true, true, true ); pro.request( subInv, 1, src ); this.what.setStackSize( l ); - IAEItemStack available = subInv.extractItems( this.what, Actionable.MODULATE, src ); + final IAEItemStack available = subInv.extractItems( this.what, Actionable.MODULATE, src ); if( available != null ) { @@ -254,7 +254,7 @@ public class CraftingTreeNode } } } - catch( CraftBranchFailure fail ) + catch( final CraftBranchFailure fail ) { pro.possible = true; } @@ -265,12 +265,12 @@ public class CraftingTreeNode { this.missing += l; this.bytes += l; - IAEItemStack rv = this.what.copy(); + final IAEItemStack rv = this.what.copy(); rv.setStackSize( l ); return rv; } - for( IAEItemStack o : thingsUsed ) + for( final IAEItemStack o : thingsUsed ) { this.job.refund( o.copy() ); o.setStackSize( -o.getStackSize() ); @@ -280,7 +280,7 @@ public class CraftingTreeNode throw new CraftBranchFailure( this.what, l ); } - public void dive( CraftingJob job ) + public void dive( final CraftingJob job ) { if( this.missing > 0 ) { @@ -290,15 +290,15 @@ public class CraftingTreeNode job.addBytes( 8 + this.bytes ); - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { pro.dive( job ); } } - public IAEItemStack getStack( long size ) + public IAEItemStack getStack( final long size ) { - IAEItemStack is = this.what.copy(); + final IAEItemStack is = this.what.copy(); is.setStackSize( size ); return is; } @@ -311,17 +311,17 @@ public class CraftingTreeNode this.used.resetStatus(); this.exhausted = false; - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { pro.setSimulate(); } } - public void setJob( MECraftingInventory storage, CraftingCPUCluster craftingCPUCluster, BaseActionSource src ) throws CraftBranchFailure + public void setJob( final MECraftingInventory storage, final CraftingCPUCluster craftingCPUCluster, final BaseActionSource src ) throws CraftBranchFailure { - for( IAEItemStack i : this.used ) + for( final IAEItemStack i : this.used ) { - IAEItemStack ex = storage.extractItems( i, Actionable.MODULATE, src ); + final IAEItemStack ex = storage.extractItems( i, Actionable.MODULATE, src ); if( ex == null || ex.getStackSize() != i.getStackSize() ) { @@ -333,39 +333,39 @@ public class CraftingTreeNode if( this.howManyEmitted > 0 ) { - IAEItemStack i = this.what.copy(); + final IAEItemStack i = this.what.copy(); i.setStackSize( this.howManyEmitted ); craftingCPUCluster.addEmitable( i ); } - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { pro.setJob( storage, craftingCPUCluster, src ); } } - public void getPlan( IItemList plan ) + public void getPlan( final IItemList plan ) { if( this.missing > 0 ) { - IAEItemStack o = this.what.copy(); + final IAEItemStack o = this.what.copy(); o.setStackSize( this.missing ); plan.add( o ); } if( this.howManyEmitted > 0 ) { - IAEItemStack i = this.what.copy(); + final IAEItemStack i = this.what.copy(); i.setCountRequestable( this.howManyEmitted ); plan.addRequestable( i ); } - for( IAEItemStack i : this.used ) + for( final IAEItemStack i : this.used ) { plan.add( i.copy() ); } - for( CraftingTreeProcess pro : this.nodes ) + for( final CraftingTreeProcess pro : this.nodes ) { pro.getPlan( plan ); } diff --git a/src/main/java/appeng/crafting/CraftingTreeProcess.java b/src/main/java/appeng/crafting/CraftingTreeProcess.java index b57dfcee..9c689483 100644 --- a/src/main/java/appeng/crafting/CraftingTreeProcess.java +++ b/src/main/java/appeng/crafting/CraftingTreeProcess.java @@ -56,20 +56,20 @@ public class CraftingTreeProcess boolean fullSimulation; private long bytes = 0; - public CraftingTreeProcess( ICraftingGrid cc, CraftingJob job, ICraftingPatternDetails details, CraftingTreeNode craftingTreeNode, int depth ) + public CraftingTreeProcess( final ICraftingGrid cc, final CraftingJob job, final ICraftingPatternDetails details, final CraftingTreeNode craftingTreeNode, final int depth ) { this.parent = craftingTreeNode; this.details = details; this.job = job; this.depth = depth; - World world = job.getWorld(); + final World world = job.getWorld(); if( details.isCraftable() ) { - IAEItemStack[] list = details.getInputs(); + final IAEItemStack[] list = details.getInputs(); - InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); - IAEItemStack[] is = details.getInputs(); + final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final IAEItemStack[] is = details.getInputs(); for( int x = 0; x < ic.getSizeInventory(); x++ ) { ic.setInventorySlotContents( x, is[x] == null ? null : is[x].getItemStack() ); @@ -79,19 +79,19 @@ public class CraftingTreeProcess for( int x = 0; x < ic.getSizeInventory(); x++ ) { - ItemStack g = ic.getStackInSlot( x ); + final ItemStack g = ic.getStackInSlot( x ); if( g != null && g.stackSize > 1 ) { this.fullSimulation = true; } } - for( IAEItemStack part : details.getCondensedInputs() ) + for( final IAEItemStack part : details.getCondensedInputs() ) { - ItemStack g = part.getItemStack(); + final ItemStack g = part.getItemStack(); boolean isAnInput = false; - for( IAEItemStack a : details.getCondensedOutputs() ) + for( final IAEItemStack a : details.getCondensedOutputs() ) { if( g != null && a != null && a.equals( g ) ) { @@ -110,13 +110,13 @@ public class CraftingTreeProcess } } - boolean complicated = false; + final boolean complicated = false; if( this.containerItems || complicated ) { for( int x = 0; x < list.length; x++ ) { - IAEItemStack part = list[x]; + final IAEItemStack part = list[x]; if( part != null ) { this.nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, x, depth + 1 ), part.getStackSize() ); @@ -126,11 +126,11 @@ public class CraftingTreeProcess else { // this is minor different then below, this slot uses the pattern, but kinda fudges it. - for( IAEItemStack part : details.getCondensedInputs() ) + for( final IAEItemStack part : details.getCondensedInputs() ) { for( int x = 0; x < list.length; x++ ) { - IAEItemStack comparePart = list[x]; + final IAEItemStack comparePart = list[x]; if( part != null && part.equals( comparePart ) ) { // use the first slot... @@ -143,12 +143,12 @@ public class CraftingTreeProcess } else { - for( IAEItemStack part : details.getCondensedInputs() ) + for( final IAEItemStack part : details.getCondensedInputs() ) { - ItemStack g = part.getItemStack(); + final ItemStack g = part.getItemStack(); boolean isAnInput = false; - for( IAEItemStack a : details.getCondensedOutputs() ) + for( final IAEItemStack a : details.getCondensedOutputs() ) { if( g != null && a != null && a.equals( g ) ) { @@ -162,19 +162,19 @@ public class CraftingTreeProcess } } - for( IAEItemStack part : details.getCondensedInputs() ) + for( final IAEItemStack part : details.getCondensedInputs() ) { this.nodes.put( new CraftingTreeNode( cc, job, part.copy(), this, -1, depth + 1 ), part.getStackSize() ); } } } - public boolean notRecursive( ICraftingPatternDetails details ) + public boolean notRecursive( final ICraftingPatternDetails details ) { return this.parent == null || this.parent.notRecursive( details ); } - long getTimes( long remaining, long stackSize ) + long getTimes( final long remaining, final long stackSize ) { if( this.limitQty || this.fullSimulation ) { @@ -183,18 +183,18 @@ public class CraftingTreeProcess return ( remaining / stackSize ) + ( remaining % stackSize != 0 ? 1 : 0 ); } - public void request( MECraftingInventory inv, long i, BaseActionSource src ) throws CraftBranchFailure, InterruptedException + public void request( final MECraftingInventory inv, final long i, final BaseActionSource src ) throws CraftBranchFailure, InterruptedException { this.job.handlePausing(); if( this.fullSimulation ) { - InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); + final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 ); - for( Entry entry : this.nodes.entrySet() ) + for( final Entry entry : this.nodes.entrySet() ) { - IAEItemStack item = entry.getKey().getStack( entry.getValue() ); - IAEItemStack stack = entry.getKey().request( inv, item.getStackSize(), src ); + final IAEItemStack item = entry.getKey().getStack( entry.getValue() ); + final IAEItemStack stack = entry.getKey().request( inv, item.getStackSize(), src ); ic.setInventorySlotContents( entry.getKey().slot, stack.getItemStack() ); } @@ -206,7 +206,7 @@ public class CraftingTreeProcess ItemStack is = ic.getStackInSlot( x ); is = Platform.getContainerItem( is ); - IAEItemStack o = AEApi.instance().storage().createItemStack( is ); + final IAEItemStack o = AEApi.instance().storage().createItemStack( is ); if( o != null ) { this.bytes++; @@ -217,15 +217,15 @@ public class CraftingTreeProcess else { // request and remove inputs... - for( Entry entry : this.nodes.entrySet() ) + for( final Entry entry : this.nodes.entrySet() ) { - IAEItemStack item = entry.getKey().getStack( entry.getValue() ); - IAEItemStack stack = entry.getKey().request( inv, item.getStackSize() * i, src ); + final IAEItemStack item = entry.getKey().getStack( entry.getValue() ); + final IAEItemStack stack = entry.getKey().request( inv, item.getStackSize() * i, src ); if( this.containerItems ) { - ItemStack is = Platform.getContainerItem( stack.getItemStack() ); - IAEItemStack o = AEApi.instance().storage().createItemStack( is ); + final ItemStack is = Platform.getContainerItem( stack.getItemStack() ); + final IAEItemStack o = AEApi.instance().storage().createItemStack( is ); if( o != null ) { this.bytes++; @@ -238,9 +238,9 @@ public class CraftingTreeProcess // assume its possible. // add crafting results.. - for( IAEItemStack out : this.details.getCondensedOutputs() ) + for( final IAEItemStack out : this.details.getCondensedOutputs() ) { - IAEItemStack o = out.copy(); + final IAEItemStack o = out.copy(); o.setStackSize( o.getStackSize() * i ); inv.injectItems( o, Actionable.MODULATE, src ); } @@ -248,10 +248,10 @@ public class CraftingTreeProcess this.crafts += i; } - public void dive( CraftingJob job ) + public void dive( final CraftingJob job ) { job.addTask( this.getAmountCrafted( this.parent.getStack( 1 ) ), this.crafts, this.details, this.depth ); - for( CraftingTreeNode pro : this.nodes.keySet() ) + for( final CraftingTreeNode pro : this.nodes.keySet() ) { pro.dive( job ); } @@ -261,7 +261,7 @@ public class CraftingTreeProcess IAEItemStack getAmountCrafted( IAEItemStack what2 ) { - for( IAEItemStack is : this.details.getCondensedOutputs() ) + for( final IAEItemStack is : this.details.getCondensedOutputs() ) { if( is.equals( what2 ) ) { @@ -272,7 +272,7 @@ public class CraftingTreeProcess } // more fuzzy! - for( IAEItemStack is : this.details.getCondensedOutputs() ) + for( final IAEItemStack is : this.details.getCondensedOutputs() ) { if( is.getItem() == what2.getItem() && ( is.getItem().isDamageable() || is.getItemDamage() == what2.getItemDamage() ) ) { @@ -290,23 +290,23 @@ public class CraftingTreeProcess this.crafts = 0; this.bytes = 0; - for( CraftingTreeNode pro : this.nodes.keySet() ) + for( final CraftingTreeNode pro : this.nodes.keySet() ) { pro.setSimulate(); } } - public void setJob( MECraftingInventory storage, CraftingCPUCluster craftingCPUCluster, BaseActionSource src ) throws CraftBranchFailure + public void setJob( final MECraftingInventory storage, final CraftingCPUCluster craftingCPUCluster, final BaseActionSource src ) throws CraftBranchFailure { craftingCPUCluster.addCrafting( this.details, this.crafts ); - for( CraftingTreeNode pro : this.nodes.keySet() ) + for( final CraftingTreeNode pro : this.nodes.keySet() ) { pro.setJob( storage, craftingCPUCluster, src ); } } - public void getPlan( IItemList plan ) + public void getPlan( final IItemList plan ) { for( IAEItemStack i : this.details.getOutputs() ) { @@ -315,7 +315,7 @@ public class CraftingTreeProcess plan.addRequestable( i ); } - for( CraftingTreeNode pro : this.nodes.keySet() ) + for( final CraftingTreeNode pro : this.nodes.keySet() ) { pro.getPlan( plan ); } diff --git a/src/main/java/appeng/crafting/CraftingWatcher.java b/src/main/java/appeng/crafting/CraftingWatcher.java index 5b8bae57..2ee6a41a 100644 --- a/src/main/java/appeng/crafting/CraftingWatcher.java +++ b/src/main/java/appeng/crafting/CraftingWatcher.java @@ -41,7 +41,7 @@ public class CraftingWatcher implements ICraftingWatcher final ICraftingWatcherHost host; final HashSet myInterests = new HashSet(); - public CraftingWatcher( CraftingGridCache cache, ICraftingWatcherHost host ) + public CraftingWatcher( final CraftingGridCache cache, final ICraftingWatcherHost host ) { this.gsc = cache; this.host = host; @@ -65,7 +65,7 @@ public class CraftingWatcher implements ICraftingWatcher } @Override - public boolean contains( Object o ) + public boolean contains( final Object o ) { return this.myInterests.contains( o ); } @@ -86,13 +86,13 @@ public class CraftingWatcher implements ICraftingWatcher @Nonnull @Override - public T[] toArray( @Nonnull T[] a ) + public T[] toArray( @Nonnull final T[] a ) { return this.myInterests.toArray( a ); } @Override - public boolean add( IAEStack e ) + public boolean add( final IAEStack e ) { if( this.myInterests.contains( e ) ) { @@ -103,23 +103,23 @@ public class CraftingWatcher implements ICraftingWatcher } @Override - public boolean remove( Object o ) + public boolean remove( final Object o ) { return this.myInterests.remove( o ) && this.gsc.interestManager.remove( (IAEStack) o, this ); } @Override - public boolean containsAll( @Nonnull Collection c ) + public boolean containsAll( @Nonnull final Collection c ) { return this.myInterests.containsAll( c ); } @Override - public boolean addAll( @Nonnull Collection c ) + public boolean addAll( @Nonnull final Collection c ) { boolean didChange = false; - for( IAEStack o : c ) + for( final IAEStack o : c ) { didChange = this.add( o ) || didChange; } @@ -128,10 +128,10 @@ public class CraftingWatcher implements ICraftingWatcher } @Override - public boolean removeAll( @Nonnull Collection c ) + public boolean removeAll( @Nonnull final Collection c ) { boolean didSomething = false; - for( Object o : c ) + for( final Object o : c ) { didSomething = this.remove( o ) || didSomething; } @@ -139,10 +139,10 @@ public class CraftingWatcher implements ICraftingWatcher } @Override - public boolean retainAll( @Nonnull Collection c ) + public boolean retainAll( @Nonnull final Collection c ) { boolean changed = false; - Iterator i = this.iterator(); + final Iterator i = this.iterator(); while( i.hasNext() ) { @@ -159,7 +159,7 @@ public class CraftingWatcher implements ICraftingWatcher @Override public void clear() { - Iterator i = this.myInterests.iterator(); + final Iterator i = this.myInterests.iterator(); while( i.hasNext() ) { this.gsc.interestManager.remove( i.next(), this ); @@ -174,7 +174,7 @@ public class CraftingWatcher implements ICraftingWatcher final Iterator interestIterator; IAEStack myLast; - public ItemWatcherIterator( CraftingWatcher parent, Iterator i ) + public ItemWatcherIterator( final CraftingWatcher parent, final Iterator i ) { this.watcher = parent; this.interestIterator = i; diff --git a/src/main/java/appeng/crafting/MECraftingInventory.java b/src/main/java/appeng/crafting/MECraftingInventory.java index 9da58d39..0ec5f990 100644 --- a/src/main/java/appeng/crafting/MECraftingInventory.java +++ b/src/main/java/appeng/crafting/MECraftingInventory.java @@ -59,7 +59,7 @@ public class MECraftingInventory implements IMEInventory this.par = null; } - public MECraftingInventory( MECraftingInventory parent ) + public MECraftingInventory( final MECraftingInventory parent ) { this.target = parent; this.logExtracted = parent.logExtracted; @@ -98,7 +98,7 @@ public class MECraftingInventory implements IMEInventory this.par = parent; } - public MECraftingInventory( IMEMonitor target, BaseActionSource src, boolean logExtracted, boolean logInjections, boolean logMissing ) + public MECraftingInventory( final IMEMonitor target, final BaseActionSource src, final boolean logExtracted, final boolean logInjections, final boolean logMissing ) { this.target = target; this.logExtracted = logExtracted; @@ -133,7 +133,7 @@ public class MECraftingInventory implements IMEInventory } this.localCache = AEApi.instance().storage().createItemList(); - for( IAEItemStack is : target.getStorageList() ) + for( final IAEItemStack is : target.getStorageList() ) { this.localCache.add( target.extractItems( is, Actionable.SIMULATE, src ) ); } @@ -141,7 +141,7 @@ public class MECraftingInventory implements IMEInventory this.par = null; } - public MECraftingInventory( IMEInventory target, boolean logExtracted, boolean logInjections, boolean logMissing ) + public MECraftingInventory( final IMEInventory target, final boolean logExtracted, final boolean logInjections, final boolean logMissing ) { this.target = target; this.logExtracted = logExtracted; @@ -180,7 +180,7 @@ public class MECraftingInventory implements IMEInventory } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { if( input == null ) { @@ -200,14 +200,14 @@ public class MECraftingInventory implements IMEInventory } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( request == null ) { return null; } - IAEItemStack list = this.localCache.findPrecise( request ); + final IAEItemStack list = this.localCache.findPrecise( request ); if( list == null || list.getStackSize() == 0 ) { return null; @@ -227,7 +227,7 @@ public class MECraftingInventory implements IMEInventory return request; } - IAEItemStack ret = request.copy(); + final IAEItemStack ret = request.copy(); ret.setStackSize( list.getStackSize() ); if( mode == Actionable.MODULATE ) @@ -243,9 +243,9 @@ public class MECraftingInventory implements IMEInventory } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( IAEItemStack is : this.localCache ) + for( final IAEItemStack is : this.localCache ) { out.add( is ); } @@ -264,15 +264,15 @@ public class MECraftingInventory implements IMEInventory return this.localCache; } - public boolean commit( BaseActionSource src ) + public boolean commit( final BaseActionSource src ) { - IItemList added = AEApi.instance().storage().createItemList(); - IItemList pulled = AEApi.instance().storage().createItemList(); + final IItemList added = AEApi.instance().storage().createItemList(); + final IItemList pulled = AEApi.instance().storage().createItemList(); boolean failed = false; if( this.logInjections ) { - for( IAEItemStack inject : this.injectedCache ) + for( final IAEItemStack inject : this.injectedCache ) { IAEItemStack result = null; added.add( result = this.target.injectItems( inject, Actionable.MODULATE, src ) ); @@ -287,7 +287,7 @@ public class MECraftingInventory implements IMEInventory if( failed ) { - for( IAEItemStack is : added ) + for( final IAEItemStack is : added ) { this.target.extractItems( is, Actionable.MODULATE, src ); } @@ -297,7 +297,7 @@ public class MECraftingInventory implements IMEInventory if( this.logExtracted ) { - for( IAEItemStack extra : this.extractedCache ) + for( final IAEItemStack extra : this.extractedCache ) { IAEItemStack result = null; pulled.add( result = this.target.extractItems( extra, Actionable.MODULATE, src ) ); @@ -312,12 +312,12 @@ public class MECraftingInventory implements IMEInventory if( failed ) { - for( IAEItemStack is : added ) + for( final IAEItemStack is : added ) { this.target.extractItems( is, Actionable.MODULATE, src ); } - for( IAEItemStack is : pulled ) + for( final IAEItemStack is : pulled ) { this.target.injectItems( is, Actionable.MODULATE, src ); } @@ -327,7 +327,7 @@ public class MECraftingInventory implements IMEInventory if( this.logMissing && this.par != null ) { - for( IAEItemStack extra : this.missingCache ) + for( final IAEItemStack extra : this.missingCache ) { this.par.addMissing( extra ); } @@ -336,14 +336,14 @@ public class MECraftingInventory implements IMEInventory return true; } - public void addMissing( IAEItemStack extra ) + public void addMissing( final IAEItemStack extra ) { this.missingCache.add( extra ); } - public void ignore( IAEItemStack what ) + public void ignore( final IAEItemStack what ) { - IAEItemStack list = this.localCache.findPrecise( what ); + final IAEItemStack list = this.localCache.findPrecise( what ); if( list != null ) { list.setStackSize( 0 ); diff --git a/src/main/java/appeng/debug/BlockChunkloader.java b/src/main/java/appeng/debug/BlockChunkloader.java index 54f9d2f1..121b692f 100644 --- a/src/main/java/appeng/debug/BlockChunkloader.java +++ b/src/main/java/appeng/debug/BlockChunkloader.java @@ -44,7 +44,7 @@ public class BlockChunkloader extends AEBaseTileBlock implements LoadingCallback } @Override - public void ticketsLoaded( List tickets, World world ) + public void ticketsLoaded( final List tickets, final World world ) { } diff --git a/src/main/java/appeng/debug/BlockCubeGenerator.java b/src/main/java/appeng/debug/BlockCubeGenerator.java index 675db3b8..501d7c5d 100644 --- a/src/main/java/appeng/debug/BlockCubeGenerator.java +++ b/src/main/java/appeng/debug/BlockCubeGenerator.java @@ -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 ); diff --git a/src/main/java/appeng/debug/BlockPhantomNode.java b/src/main/java/appeng/debug/BlockPhantomNode.java index 71a75adb..205a9e83 100644 --- a/src/main/java/appeng/debug/BlockPhantomNode.java +++ b/src/main/java/appeng/debug/BlockPhantomNode.java @@ -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; } diff --git a/src/main/java/appeng/debug/TileChunkLoader.java b/src/main/java/appeng/debug/TileChunkLoader.java index cfa9e455..f384329a 100644 --- a/src/main/java/appeng/debug/TileChunkLoader.java +++ b/src/main/java/appeng/debug/TileChunkLoader.java @@ -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 pl = server.getConfigurationManager().playerEntityList; - for( EntityPlayerMP p : pl ) + final List pl = server.getConfigurationManager().playerEntityList; + for( final EntityPlayerMP p : pl ) { p.addChatMessage( new ChatComponentText( "Can't chunk load.." ) ); } diff --git a/src/main/java/appeng/debug/TileCubeGenerator.java b/src/main/java/appeng/debug/TileCubeGenerator.java index 884fd69e..4a480b48 100644 --- a/src/main/java/appeng/debug/TileCubeGenerator.java +++ b/src/main/java/appeng/debug/TileCubeGenerator.java @@ -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 ) diff --git a/src/main/java/appeng/debug/TileItemGen.java b/src/main/java/appeng/debug/TileItemGen.java index 93fab9fe..494b3f22 100644 --- a/src/main/java/appeng/debug/TileItemGen.java +++ b/src/main/java/appeng/debug/TileItemGen.java @@ -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 list = new ArrayList(); + final List list = new ArrayList(); 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 ) { } diff --git a/src/main/java/appeng/debug/TilePhantomNode.java b/src/main/java/appeng/debug/TilePhantomNode.java index b6d7933e..4a534096 100644 --- a/src/main/java/appeng/debug/TilePhantomNode.java +++ b/src/main/java/appeng/debug/TilePhantomNode.java @@ -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 ) { diff --git a/src/main/java/appeng/debug/ToolDebugCard.java b/src/main/java/appeng/debug/ToolDebugCard.java index 08282ee9..a74e4c9d 100644 --- a/src/main/java/appeng/debug/ToolDebugCard.java +++ b/src/main/java/appeng/debug/ToolDebugCard.java @@ -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 next = new HashSet(); next.add( node ); - int maxLength = 10000; + final int maxLength = 10000; int length = 0; outer: while( !next.isEmpty() ) { - Iterable current = next; + final Iterable current = next; next = new HashSet(); - 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 c : g.getMachineClasses() ) + final TickManagerCache tmc = g.getCache( ITickManager.class ); + for( final Class 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"; diff --git a/src/main/java/appeng/debug/ToolEraser.java b/src/main/java/appeng/debug/ToolEraser.java index e59de0da..74e5457e 100644 --- a/src/main/java/appeng/debug/ToolEraser.java +++ b/src/main/java/appeng/debug/ToolEraser.java @@ -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 next = new LinkedList(); next.add( pos ); @@ -69,12 +69,12 @@ public class ToolEraser extends AEBaseItem int blocks = 0; while( blocks < BLOCK_ERASE_LIMIT && !next.isEmpty() ) { - List c = next; + final List c = next; next = new LinkedList(); - 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 ) { diff --git a/src/main/java/appeng/debug/ToolMeteoritePlacer.java b/src/main/java/appeng/debug/ToolMeteoritePlacer.java index 7743ece7..25f59e2f 100644 --- a/src/main/java/appeng/debug/ToolMeteoritePlacer.java +++ b/src/main/java/appeng/debug/ToolMeteoritePlacer.java @@ -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 ) { diff --git a/src/main/java/appeng/debug/ToolReplicatorCard.java b/src/main/java/appeng/debug/ToolReplicatorCard.java index 98fe936a..195f3d21 100644 --- a/src/main/java/appeng/debug/ToolReplicatorCard.java +++ b/src/main/java/appeng/debug/ToolReplicatorCard.java @@ -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 ) ); } diff --git a/src/main/java/appeng/decorative/solid/ChargedQuartzOreBlock.java b/src/main/java/appeng/decorative/solid/ChargedQuartzOreBlock.java index 91d8f474..e55ab806 100644 --- a/src/main/java/appeng/decorative/solid/ChargedQuartzOreBlock.java +++ b/src/main/java/appeng/decorative/solid/ChargedQuartzOreBlock.java @@ -45,11 +45,11 @@ public final class ChargedQuartzOreBlock extends QuartzOreBlock @Override public Item getItemDropped( - IBlockState state, - Random rand, - int fortune ) + final IBlockState state, + final Random rand, + final int fortune ) { - for( Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().asSet() ) + for( final Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().asSet() ) { return charged; } @@ -59,9 +59,9 @@ public final class ChargedQuartzOreBlock extends QuartzOreBlock @Override public int damageDropped( - IBlockState state ) + final IBlockState state ) { - for ( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() ) + for ( final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() ) { return crystalStack.getItemDamage(); } @@ -71,10 +71,10 @@ public final class ChargedQuartzOreBlock extends QuartzOreBlock @Override public void randomDisplayTick( - World w, - BlockPos pos, - IBlockState state, - Random r ) + final World w, + final BlockPos pos, + final IBlockState state, + final Random r ) { if ( !AEConfig.instance.enableEffects ) { @@ -112,7 +112,7 @@ public final class ChargedQuartzOreBlock extends QuartzOreBlock if( CommonHelper.proxy.shouldAddParticles( r ) ) { - ChargedOreFX fx = new ChargedOreFX( w, pos.getX() + xOff, pos.getY() + yOff, pos.getZ() + zOff, 0.0f, 0.0f, 0.0f ); + final ChargedOreFX fx = new ChargedOreFX( w, pos.getX() + xOff, pos.getY() + yOff, pos.getZ() + zOff, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } } diff --git a/src/main/java/appeng/decorative/solid/QuartzGlassBlock.java b/src/main/java/appeng/decorative/solid/QuartzGlassBlock.java index 1e6f743a..87c1e1e2 100644 --- a/src/main/java/appeng/decorative/solid/QuartzGlassBlock.java +++ b/src/main/java/appeng/decorative/solid/QuartzGlassBlock.java @@ -60,11 +60,11 @@ public class QuartzGlassBlock extends AEBaseBlock @Override public boolean shouldSideBeRendered( - IBlockAccess w, - BlockPos pos, - EnumFacing side ) + final IBlockAccess w, + final BlockPos pos, + final EnumFacing side ) { - Material mat = w.getBlockState( pos ).getBlock().getMaterial(); + final Material mat = w.getBlockState( pos ).getBlock().getMaterial(); if( mat == Material.glass || mat == AEGlassMaterial.INSTANCE ) { if( w.getBlockState( pos ).getBlock().getRenderType() == this.getRenderType() ) diff --git a/src/main/java/appeng/decorative/solid/QuartzLampBlock.java b/src/main/java/appeng/decorative/solid/QuartzLampBlock.java index 169992ed..9560c449 100644 --- a/src/main/java/appeng/decorative/solid/QuartzLampBlock.java +++ b/src/main/java/appeng/decorative/solid/QuartzLampBlock.java @@ -44,10 +44,10 @@ public class QuartzLampBlock extends QuartzGlassBlock @Override public void randomDisplayTick( - World w, - BlockPos pos, - IBlockState state, - Random r ) + final World w, + final BlockPos pos, + final IBlockState state, + final Random r ) { if( !AEConfig.instance.enableEffects ) { @@ -56,11 +56,11 @@ public class QuartzLampBlock extends QuartzGlassBlock if( CommonHelper.proxy.shouldAddParticles( r ) ) { - double d0 = ( r.nextFloat() - 0.5F ) * 0.96D; - double d1 = ( r.nextFloat() - 0.5F ) * 0.96D; - double d2 = ( r.nextFloat() - 0.5F ) * 0.96D; + final double d0 = ( r.nextFloat() - 0.5F ) * 0.96D; + final double d1 = ( r.nextFloat() - 0.5F ) * 0.96D; + final double d2 = ( r.nextFloat() - 0.5F ) * 0.96D; - VibrantFX fx = new VibrantFX( w, 0.5 + pos.getX() + d0, 0.5 + pos.getY() + d1, 0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D ); + final VibrantFX fx = new VibrantFX( w, 0.5 + pos.getX() + d0, 0.5 + pos.getY() + d1, 0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D ); Minecraft.getMinecraft().effectRenderer.addEffect( fx ); } diff --git a/src/main/java/appeng/decorative/solid/QuartzOreBlock.java b/src/main/java/appeng/decorative/solid/QuartzOreBlock.java index 4164ad35..48136694 100644 --- a/src/main/java/appeng/decorative/solid/QuartzOreBlock.java +++ b/src/main/java/appeng/decorative/solid/QuartzOreBlock.java @@ -79,8 +79,8 @@ public class QuartzOreBlock extends AEBaseBlock @Override public int getMixedBrightnessForBlock( - IBlockAccess worldIn, - BlockPos pos ) + final IBlockAccess worldIn, + final BlockPos pos ) { int j1 = super.getMixedBrightnessForBlock( worldIn, pos ); if( this.enhanceBrightness ) @@ -106,18 +106,18 @@ public class QuartzOreBlock extends AEBaseBlock } @Override - public int quantityDropped( Random rand ) + public int quantityDropped( final Random rand ) { return 1 + rand.nextInt( 2 ); } @Override public Item getItemDropped( - IBlockState state, /* is null */ - Random rand, - int fortune ) + final IBlockState state, /* is null */ + final Random rand, + final int fortune ) { - for( Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem().asSet() ) + for( final Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem().asSet() ) { return crystalItem; } @@ -127,17 +127,17 @@ public class QuartzOreBlock extends AEBaseBlock @Override public void dropBlockAsItemWithChance( - World w, - BlockPos pos, - IBlockState state, - float chance, - int fortune ) + final World w, + final BlockPos pos, + final IBlockState state, + final float chance, + final int fortune ) { super.dropBlockAsItemWithChance( w, pos, state, chance, fortune ); if( this.getItemDropped( state, w.rand, fortune ) != Item.getItemFromBlock( this ) ) { - int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 ); + final int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 ); this.dropXpOnBlockBreak( w, pos, xp ); } @@ -145,9 +145,9 @@ public class QuartzOreBlock extends AEBaseBlock @Override public int damageDropped( - IBlockState state ) + final IBlockState state ) { - for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 ).asSet() ) + for( final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 ).asSet() ) { return crystalStack.getItemDamage(); } @@ -156,7 +156,7 @@ public class QuartzOreBlock extends AEBaseBlock } @Override - public int quantityDroppedWithBonus( int fortune, Random rand ) + public int quantityDroppedWithBonus( final int fortune, final Random rand ) { if( fortune > 0 && Item.getItemFromBlock( this ) != this.getItemDropped( null, rand, fortune ) ) { @@ -175,17 +175,17 @@ public class QuartzOreBlock extends AEBaseBlock } } - public void setBoostBrightnessLow( int boostBrightnessLow ) + public void setBoostBrightnessLow( final int boostBrightnessLow ) { this.boostBrightnessLow = boostBrightnessLow; } - public void setBoostBrightnessHigh( int boostBrightnessHigh ) + public void setBoostBrightnessHigh( final int boostBrightnessHigh ) { this.boostBrightnessHigh = boostBrightnessHigh; } - public void setEnhanceBrightness( boolean enhanceBrightness ) + public void setEnhanceBrightness( final boolean enhanceBrightness ) { this.enhanceBrightness = enhanceBrightness; } diff --git a/src/main/java/appeng/decorative/solid/QuartzPillarBlock.java b/src/main/java/appeng/decorative/solid/QuartzPillarBlock.java index bfd97785..01fa064a 100644 --- a/src/main/java/appeng/decorative/solid/QuartzPillarBlock.java +++ b/src/main/java/appeng/decorative/solid/QuartzPillarBlock.java @@ -45,14 +45,14 @@ public class QuartzPillarBlock extends AEBaseBlock implements IOrientableBlock @Override public int getMetaFromState( - IBlockState state ) + final IBlockState state ) { return 0; } @Override public IBlockState getStateFromMeta( - int meta ) + final int meta ) { return getDefaultState(); } @@ -70,7 +70,7 @@ public class QuartzPillarBlock extends AEBaseBlock implements IOrientableBlock } @Override - public IOrientable getOrientable( final IBlockAccess w,BlockPos pos ) + public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos ) { return new MetaRotation( w, pos,false ); } diff --git a/src/main/java/appeng/decorative/solid/SkyStoneBlock.java b/src/main/java/appeng/decorative/solid/SkyStoneBlock.java index b3939f4f..9438e56d 100644 --- a/src/main/java/appeng/decorative/solid/SkyStoneBlock.java +++ b/src/main/java/appeng/decorative/solid/SkyStoneBlock.java @@ -45,7 +45,7 @@ public class SkyStoneBlock extends AEBaseBlock private static final double BREAK_SPEAK_THRESHOLD = 7.0; private final SkystoneType type; - public SkyStoneBlock( SkystoneType type ) + public SkyStoneBlock( final SkystoneType type ) { super( Material.rock, Optional.of( type.name() ) ); this.setHardness( 50 ); @@ -63,11 +63,11 @@ public class SkyStoneBlock extends AEBaseBlock } @SubscribeEvent - public void breakFaster( PlayerEvent.BreakSpeed event ) + public void breakFaster( final PlayerEvent.BreakSpeed event ) { if( event.state.getBlock() == this && event.entityPlayer != null ) { - ItemStack is = event.entityPlayer.inventory.getCurrentItem(); + final ItemStack is = event.entityPlayer.inventory.getCurrentItem(); int level = -1; if( is != null && is.getItem() != null ) @@ -83,7 +83,7 @@ public class SkyStoneBlock extends AEBaseBlock } @Override - public void onBlockAdded( World w, BlockPos pos, IBlockState state ) + public void onBlockAdded( final World w, final BlockPos pos, final IBlockState state ) { super.onBlockAdded( w, pos, state ); if( Platform.isServer() ) @@ -93,7 +93,7 @@ public class SkyStoneBlock extends AEBaseBlock } @Override - public void breakBlock( World w, BlockPos pos, IBlockState state ) + public void breakBlock( final World w, final BlockPos pos, final IBlockState state ) { super.breakBlock( w, pos, state ); @@ -104,7 +104,7 @@ public class SkyStoneBlock extends AEBaseBlock } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { switch( type ) { diff --git a/src/main/java/appeng/decorative/stair/BlockStairCommon.java b/src/main/java/appeng/decorative/stair/BlockStairCommon.java index b7b6a3a5..a2f596ca 100644 --- a/src/main/java/appeng/decorative/stair/BlockStairCommon.java +++ b/src/main/java/appeng/decorative/stair/BlockStairCommon.java @@ -29,7 +29,7 @@ import appeng.core.features.AEFeature; public class BlockStairCommon extends AEBaseStairBlock { - public BlockStairCommon( Block block, String type ) + public BlockStairCommon( final Block block, final String type ) { super( block, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), type ); } diff --git a/src/main/java/appeng/decorative/stair/DecorativeStairIdentifier.java b/src/main/java/appeng/decorative/stair/DecorativeStairIdentifier.java index 90958262..7872bd5c 100644 --- a/src/main/java/appeng/decorative/stair/DecorativeStairIdentifier.java +++ b/src/main/java/appeng/decorative/stair/DecorativeStairIdentifier.java @@ -41,7 +41,7 @@ public enum DecorativeStairIdentifier implements Identifier * * @see net.minecraftforge.fml.common.registry.GameRegistry#registerBlock(Block, String) */ - DecorativeStairIdentifier( @Nonnull String name ) + DecorativeStairIdentifier( @Nonnull final String name ) { Preconditions.checkNotNull( name ); Preconditions.checkArgument( !name.isEmpty() ); diff --git a/src/main/java/appeng/decorative/stair/FluixStairBlock.java b/src/main/java/appeng/decorative/stair/FluixStairBlock.java index 1eea266c..46cd3fc9 100644 --- a/src/main/java/appeng/decorative/stair/FluixStairBlock.java +++ b/src/main/java/appeng/decorative/stair/FluixStairBlock.java @@ -11,7 +11,7 @@ import net.minecraft.block.Block; */ public class FluixStairBlock extends BlockStairCommon { - public FluixStairBlock( Block block, String type ) + public FluixStairBlock( final Block block, final String type ) { super( block, type ); } diff --git a/src/main/java/appeng/decorative/stair/FluixStairSupplier.java b/src/main/java/appeng/decorative/stair/FluixStairSupplier.java index 98e5b98f..ee2120e5 100644 --- a/src/main/java/appeng/decorative/stair/FluixStairSupplier.java +++ b/src/main/java/appeng/decorative/stair/FluixStairSupplier.java @@ -18,7 +18,7 @@ public class FluixStairSupplier implements Supplier { private final Supplier fluixBlockSupplier; - public FluixStairSupplier( Supplier fluixBlockSupplier ) + public FluixStairSupplier( final Supplier fluixBlockSupplier ) { Preconditions.checkNotNull( fluixBlockSupplier ); diff --git a/src/main/java/appeng/decorative/stair/StairBlockDefinition.java b/src/main/java/appeng/decorative/stair/StairBlockDefinition.java index b8cd4aa5..1edb3698 100644 --- a/src/main/java/appeng/decorative/stair/StairBlockDefinition.java +++ b/src/main/java/appeng/decorative/stair/StairBlockDefinition.java @@ -39,7 +39,7 @@ public class StairBlockDefinition implements IBlockDefinition } @Override - public boolean isSameAs( IBlockAccess world, BlockPos pos ) + public boolean isSameAs( final IBlockAccess world, final BlockPos pos ) { return false; } @@ -58,7 +58,7 @@ public class StairBlockDefinition implements IBlockDefinition } @Override - public Optional maybeStack( int stackSize ) + public Optional maybeStack( final int stackSize ) { return null; } @@ -70,7 +70,7 @@ public class StairBlockDefinition implements IBlockDefinition } @Override - public boolean isSameAs( ItemStack comparableStack ) + public boolean isSameAs( final ItemStack comparableStack ) { return false; } diff --git a/src/main/java/appeng/entity/AEBaseEntityItem.java b/src/main/java/appeng/entity/AEBaseEntityItem.java index 516df06b..07e4c11c 100644 --- a/src/main/java/appeng/entity/AEBaseEntityItem.java +++ b/src/main/java/appeng/entity/AEBaseEntityItem.java @@ -30,18 +30,18 @@ import net.minecraft.world.World; public abstract class AEBaseEntityItem extends EntityItem { - public AEBaseEntityItem( World world ) + public AEBaseEntityItem( final World world ) { super( world ); } - public AEBaseEntityItem( World world, double x, double y, double z, ItemStack stack ) + public AEBaseEntityItem( final World world, final double x, final double y, final double z, final ItemStack stack ) { super( world, x, y, z, stack ); } @SuppressWarnings( "unchecked" ) - public List getCheckedEntitiesWithinAABBExcludingEntity( AxisAlignedBB region ) + public List getCheckedEntitiesWithinAABBExcludingEntity( final AxisAlignedBB region ) { return this.worldObj.getEntitiesWithinAABBExcludingEntity( this, region ); } diff --git a/src/main/java/appeng/entity/EntityChargedQuartz.java b/src/main/java/appeng/entity/EntityChargedQuartz.java index 617e11b9..f112b9f6 100644 --- a/src/main/java/appeng/entity/EntityChargedQuartz.java +++ b/src/main/java/appeng/entity/EntityChargedQuartz.java @@ -47,12 +47,12 @@ public final class EntityChargedQuartz extends AEBaseEntityItem int transformTime = 0; @Reflected - public EntityChargedQuartz( World w ) + public EntityChargedQuartz( final World w ) { super( w ); } - public EntityChargedQuartz( World w, double x, double y, double z, ItemStack is ) + public EntityChargedQuartz( final World w, final double x, final double y, final double z, final ItemStack is ) { super( w, x, y, z, is ); } @@ -74,11 +74,11 @@ public final class EntityChargedQuartz extends AEBaseEntityItem } this.delay++; - int j = MathHelper.floor_double( this.posX ); - int i = MathHelper.floor_double( this.posY ); - int k = MathHelper.floor_double( this.posZ ); + final int j = MathHelper.floor_double( this.posX ); + final int i = MathHelper.floor_double( this.posY ); + final int k = MathHelper.floor_double( this.posZ ); - Material mat = this.worldObj.getBlockState( new BlockPos( j, i, k ) ).getBlock().getMaterial(); + final Material mat = this.worldObj.getBlockState( new BlockPos( j, i, k ) ).getBlock().getMaterial(); if( Platform.isServer() && mat.isLiquid() ) { this.transformTime++; @@ -98,22 +98,22 @@ public final class EntityChargedQuartz extends AEBaseEntityItem public boolean transform() { - ItemStack item = this.getEntityItem(); + final ItemStack item = this.getEntityItem(); final IMaterials materials = AEApi.instance().definitions().materials(); if( materials.certusQuartzCrystalCharged().isSameAs( item ) ) { - AxisAlignedBB region = AxisAlignedBB.fromBounds( this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1 ); - List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); + final AxisAlignedBB region = AxisAlignedBB.fromBounds( this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1 ); + final List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); EntityItem redstone = null; EntityItem netherQuartz = null; - for( Entity e : l ) + for( final Entity e : l ) { if( e instanceof EntityItem && !e.isDead ) { - ItemStack other = ( (EntityItem) e ).getEntityItem(); + final ItemStack other = ( (EntityItem) e ).getEntityItem(); if( other != null && other.stackSize > 0 ) { if( Platform.isSameItem( other, new ItemStack( Items.redstone ) ) ) @@ -150,7 +150,7 @@ public final class EntityChargedQuartz extends AEBaseEntityItem netherQuartz.setDead(); } - for( ItemStack fluixCrystalStack : materials.fluixCrystal().maybeStack( 2 ).asSet() ) + for( final ItemStack fluixCrystalStack : materials.fluixCrystal().maybeStack( 2 ).asSet() ) { final EntityItem entity = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, fluixCrystalStack ); diff --git a/src/main/java/appeng/entity/EntityFloatingItem.java b/src/main/java/appeng/entity/EntityFloatingItem.java index e827ecaa..d2e4fe12 100644 --- a/src/main/java/appeng/entity/EntityFloatingItem.java +++ b/src/main/java/appeng/entity/EntityFloatingItem.java @@ -32,7 +32,7 @@ public final class EntityFloatingItem extends EntityItem int superDeath = 0; float progress = 0; - public EntityFloatingItem( Entity parent, World world, double x, double y, double z, ItemStack stack ) + public EntityFloatingItem( final Entity parent, final World world, final double x, final double y, final double z, final ItemStack stack ) { super( world, x, y, z, stack ); this.motionX = this.motionY = this.motionZ = 0.0d; @@ -60,7 +60,7 @@ public final class EntityFloatingItem extends EntityItem this.setNoDespawn(); } - public void setProgress( float progress ) + public void setProgress( final float progress ) { this.progress = progress; if( this.progress > 0.99 ) diff --git a/src/main/java/appeng/entity/EntityGrowingCrystal.java b/src/main/java/appeng/entity/EntityGrowingCrystal.java index d849e23f..02636d97 100644 --- a/src/main/java/appeng/entity/EntityGrowingCrystal.java +++ b/src/main/java/appeng/entity/EntityGrowingCrystal.java @@ -42,12 +42,12 @@ public final class EntityGrowingCrystal extends EntityItem private int progress_1000 = 0; - public EntityGrowingCrystal( World w ) + public EntityGrowingCrystal( final World w ) { super( w ); } - public EntityGrowingCrystal( World w, double x, double y, double z, ItemStack is ) + public EntityGrowingCrystal( final World w, final double x, final double y, final double z, final ItemStack is ) { super( w, x, y, z, is ); this.setNoDespawn(); @@ -63,23 +63,23 @@ public final class EntityGrowingCrystal extends EntityItem return; } - ItemStack is = this.getEntityItem(); - Item gc = is.getItem(); + final ItemStack is = this.getEntityItem(); + final Item gc = is.getItem(); if( gc instanceof IGrowableCrystal ) // if it changes this just stops being an issue... { - int j = MathHelper.floor_double( this.posX ); - int i = MathHelper.floor_double( this.posY ); - int k = MathHelper.floor_double( this.posZ ); + final int j = MathHelper.floor_double( this.posX ); + final int i = MathHelper.floor_double( this.posY ); + final int k = MathHelper.floor_double( this.posZ ); - Block blk = this.worldObj.getBlockState( new BlockPos( j, i, k ) ).getBlock(); - Material mat = blk.getMaterial(); - IGrowableCrystal cry = (IGrowableCrystal) is.getItem(); + final Block blk = this.worldObj.getBlockState( new BlockPos( j, i, k ) ).getBlock(); + final Material mat = blk.getMaterial(); + final IGrowableCrystal cry = (IGrowableCrystal) is.getItem(); - float multiplier = cry.getMultiplier( blk, mat ); - int speed = (int) Math.max( 1, this.getSpeed( j, i, k ) * multiplier ); + final float multiplier = cry.getMultiplier( blk, mat ); + final int speed = (int) Math.max( 1, this.getSpeed( j, i, k ) * multiplier ); - boolean isClient = Platform.isClient(); + final boolean isClient = Platform.isClient(); if( mat.isLiquid() ) { @@ -148,7 +148,7 @@ public final class EntityGrowingCrystal extends EntityItem } } - private int getSpeed( int x, int y, int z ) + private int getSpeed( final int x, final int y, final int z ) { final int per = 80; final float mul = 0.3f; @@ -188,9 +188,9 @@ public final class EntityGrowingCrystal extends EntityItem return qty; } - private boolean isAccelerated( int x, int y, int z ) + private boolean isAccelerated( final int x, final int y, final int z ) { - TileEntity te = this.worldObj.getTileEntity( new BlockPos( x, y, z ) ); + final TileEntity te = this.worldObj.getTileEntity( new BlockPos( x, y, z ) ); return te instanceof ICrystalGrowthAccelerator && ( (ICrystalGrowthAccelerator) te ).isPowered(); } diff --git a/src/main/java/appeng/entity/EntityIds.java b/src/main/java/appeng/entity/EntityIds.java index 3acbc9a8..3c469421 100644 --- a/src/main/java/appeng/entity/EntityIds.java +++ b/src/main/java/appeng/entity/EntityIds.java @@ -33,7 +33,7 @@ public final class EntityIds { } - public static int get( Class droppedEntity ) + public static int get( final Class droppedEntity ) { if( droppedEntity == EntityTinyTNTPrimed.class ) { diff --git a/src/main/java/appeng/entity/EntitySingularity.java b/src/main/java/appeng/entity/EntitySingularity.java index 796cda9a..00325fd3 100644 --- a/src/main/java/appeng/entity/EntitySingularity.java +++ b/src/main/java/appeng/entity/EntitySingularity.java @@ -44,18 +44,18 @@ public final class EntitySingularity extends AEBaseEntityItem private static int randTickSeed = 0; @Reflected - public EntitySingularity( World w ) + public EntitySingularity( final World w ) { super( w ); } - public EntitySingularity( World w, double x, double y, double z, ItemStack is ) + public EntitySingularity( final World w, final double x, final double y, final double z, final ItemStack is ) { super( w, x, y, z, is ); } @Override - public boolean attackEntityFrom( DamageSource src, float dmg ) + public boolean attackEntityFrom( final DamageSource src, final float dmg ) { if( src.isExplosion() ) { @@ -78,24 +78,24 @@ public final class EntitySingularity extends AEBaseEntityItem return; } - ItemStack item = this.getEntityItem(); + final ItemStack item = this.getEntityItem(); final IMaterials materials = AEApi.instance().definitions().materials(); if( materials.singularity().isSameAs( item ) ) { - AxisAlignedBB region = AxisAlignedBB.fromBounds( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 ); - List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); + final AxisAlignedBB region = AxisAlignedBB.fromBounds( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 ); + final List l = this.getCheckedEntitiesWithinAABBExcludingEntity( region ); - for( Entity e : l ) + for( final Entity e : l ) { if( e instanceof EntityItem ) { - ItemStack other = ( (EntityItem) e ).getEntityItem(); + final ItemStack other = ( (EntityItem) e ).getEntityItem(); if( other != null ) { boolean matches = false; - for( ItemStack is : OreDictionary.getOres( "dustEnder" ) ) + for( final ItemStack is : OreDictionary.getOres( "dustEnder" ) ) { if( OreDictionary.itemMatches( other, is, false ) ) { @@ -107,7 +107,7 @@ public final class EntitySingularity extends AEBaseEntityItem // check... other name. if( !matches ) { - for( ItemStack is : OreDictionary.getOres( "dustEnderPearl" ) ) + for( final ItemStack is : OreDictionary.getOres( "dustEnderPearl" ) ) { if( OreDictionary.itemMatches( other, is, false ) ) { @@ -127,9 +127,9 @@ public final class EntitySingularity extends AEBaseEntityItem e.setDead(); } - for( ItemStack singularityStack : materials.qESingularity().maybeStack( 2 ).asSet() ) + for( final ItemStack singularityStack : materials.qESingularity().maybeStack( 2 ).asSet() ) { - NBTTagCompound cmp = Platform.openNbtData( singularityStack ); + final NBTTagCompound cmp = Platform.openNbtData( singularityStack ); cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 ); randTickSeed++; item.stackSize--; diff --git a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java index 5e6dd8db..30bc483f 100644 --- a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java +++ b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java @@ -47,13 +47,13 @@ import appeng.util.Platform; public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntityAdditionalSpawnData { @Reflected - public EntityTinyTNTPrimed( World w ) + public EntityTinyTNTPrimed( final World w ) { super( w ); this.setSize( 0.35F, 0.35F ); } - public EntityTinyTNTPrimed( World w, double x, double y, double z, EntityLivingBase igniter ) + public EntityTinyTNTPrimed( final World w, final double x, final double y, final double z, final EntityLivingBase igniter ) { super( w, x, y, z, igniter ); this.setSize( 0.55F, 0.55F ); @@ -86,7 +86,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit if( this.isInWater() && Platform.isServer() ) // put out the fuse. { - for( ItemStack tntStack : AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).asSet() ) + for( final ItemStack tntStack : AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).asSet() ) { final EntityItem item = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, tntStack ); @@ -128,7 +128,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit return; } - for( Object e : this.worldObj.getEntitiesWithinAABBExcludingEntity( this, AxisAlignedBB.fromBounds( this.posX - 1.5, this.posY - 1.5f, this.posZ - 1.5, this.posX + 1.5, this.posY + 1.5, this.posZ + 1.5 ) ) ) + for( final Object e : this.worldObj.getEntitiesWithinAABBExcludingEntity( this, AxisAlignedBB.fromBounds( this.posX - 1.5, this.posY - 1.5f, this.posZ - 1.5, this.posX + 1.5, this.posY + 1.5, this.posZ + 1.5 ) ) ) { if( e instanceof Entity ) { @@ -139,7 +139,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit if( AEConfig.instance.isFeatureEnabled( AEFeature.TinyTNTBlockDamage ) ) { this.posY -= 0.25; - Explosion ex = new Explosion( this.worldObj, this, this.posX, this.posY, this.posZ, 0.2f, false, false ); + final Explosion ex = new Explosion( this.worldObj, this, this.posX, this.posY, this.posZ, 0.2f, false, false ); for( int x = (int) ( this.posX - 2 ); x <= this.posX + 2; x++ ) { @@ -147,14 +147,14 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit { for( int z = (int) ( this.posZ - 2 ); z <= this.posZ + 2; z++ ) { - BlockPos point = new BlockPos( x,y,z); - IBlockState state = this.worldObj.getBlockState( point ); - Block block = state.getBlock(); + final BlockPos point = new BlockPos( x,y,z); + final IBlockState state = this.worldObj.getBlockState( point ); + final Block block = state.getBlock(); if( block != null && !block.isAir( this.worldObj, point ) ) { float strength = (float) ( 2.3f - ( ( ( x + 0.5f ) - this.posX ) * ( ( x + 0.5f ) - this.posX ) + ( ( y + 0.5f ) - this.posY ) * ( ( y + 0.5f ) - this.posY ) + ( ( z + 0.5f ) - this.posZ ) * ( ( z + 0.5f ) - this.posZ ) ) ); - float resistance = block.getExplosionResistance( this.worldObj, point, this, ex ); + final float resistance = block.getExplosionResistance( this.worldObj, point, this, ex ); strength -= ( resistance + 0.3F ) * 0.11f; if( strength > 0.01 ) @@ -179,13 +179,13 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit } @Override - public void writeSpawnData( ByteBuf data ) + public void writeSpawnData( final ByteBuf data ) { data.writeByte( this.fuse ); } @Override - public void readSpawnData( ByteBuf data ) + public void readSpawnData( final ByteBuf data ) { this.fuse = data.readByte(); } diff --git a/src/main/java/appeng/entity/RenderFloatingItem.java b/src/main/java/appeng/entity/RenderFloatingItem.java index 1a990753..4f64488a 100644 --- a/src/main/java/appeng/entity/RenderFloatingItem.java +++ b/src/main/java/appeng/entity/RenderFloatingItem.java @@ -39,7 +39,7 @@ public class RenderFloatingItem extends RenderEntityItem public static DoubleBuffer buffer = ByteBuffer.allocateDirect( 8 * 4 ).asDoubleBuffer(); - public RenderFloatingItem(RenderManager manager) + public RenderFloatingItem( final RenderManager manager) { super(manager,Minecraft.getMinecraft().getRenderItem()); this.shadowOpaque = 0.0F; @@ -47,16 +47,16 @@ public class RenderFloatingItem extends RenderEntityItem @Override public void doRender( - Entity entityItem, - double x, - double y, - double z, - float yaw, - float partialTick ) + final Entity entityItem, + final double x, + final double y, + final double z, + final float yaw, + final float partialTick ) { if( entityItem instanceof EntityFloatingItem ) { - EntityFloatingItem efi = (EntityFloatingItem) entityItem; + final EntityFloatingItem efi = (EntityFloatingItem) entityItem; if( efi.progress > 0.0 ) { GL11.glPushMatrix(); diff --git a/src/main/java/appeng/entity/RenderTinyTNTPrimed.java b/src/main/java/appeng/entity/RenderTinyTNTPrimed.java index 86dfd92c..8be162d8 100644 --- a/src/main/java/appeng/entity/RenderTinyTNTPrimed.java +++ b/src/main/java/appeng/entity/RenderTinyTNTPrimed.java @@ -42,21 +42,21 @@ public class RenderTinyTNTPrimed extends Render private final ModelGenerator blockRenderer = new ModelGenerator(); - public RenderTinyTNTPrimed(RenderManager p_i46134_1_) + public RenderTinyTNTPrimed( final RenderManager p_i46134_1_) { super(p_i46134_1_); this.shadowSize = 0.5F; } @Override - public void doRender( Entity tnt, double x, double y, double z, float unused, float life ) + public void doRender( final Entity tnt, final double x, final double y, final double z, final float unused, final float life ) { this.renderPrimedTNT( (EntityTinyTNTPrimed) tnt, x, y, z, unused, life ); } - public void renderPrimedTNT( EntityTinyTNTPrimed tnt, double x, double y, double z, float unused, float life ) + public void renderPrimedTNT( final EntityTinyTNTPrimed tnt, final double x, final double y, final double z, final float unused, final float life ) { - BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); + final BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y + 0.5F, (float)z); float f2; @@ -77,7 +77,7 @@ public class RenderTinyTNTPrimed extends Render f2 *= f2; f2 *= f2; - float f3 = 1.0F + f2 * 0.3F; + final float f3 = 1.0F + f2 * 0.3F; GL11.glScalef( f3, f3, f3 ); } @@ -111,7 +111,7 @@ public class RenderTinyTNTPrimed extends Render } @Override - protected ResourceLocation getEntityTexture( Entity entity ) + protected ResourceLocation getEntityTexture( final Entity entity ) { return TextureMap.locationBlocksTexture; } diff --git a/src/main/java/appeng/facade/FacadeContainer.java b/src/main/java/appeng/facade/FacadeContainer.java index fa8358ea..337df73b 100644 --- a/src/main/java/appeng/facade/FacadeContainer.java +++ b/src/main/java/appeng/facade/FacadeContainer.java @@ -47,13 +47,13 @@ public class FacadeContainer implements IFacadeContainer final int facades = 6; final CableBusStorage storage; - public FacadeContainer( CableBusStorage cbs ) + public FacadeContainer( final CableBusStorage cbs ) { this.storage = cbs; } @Override - public boolean addFacade( IFacadePart a ) + public boolean addFacade( final IFacadePart a ) { if( this.getFacade( a.getSide() ) == null ) { @@ -64,7 +64,7 @@ public class FacadeContainer implements IFacadeContainer } @Override - public void removeFacade( IPartHost host, AEPartLocation side ) + public void removeFacade( final IPartHost host, final AEPartLocation side ) { if( side != null && side != AEPartLocation.INTERNAL ) { @@ -80,7 +80,7 @@ public class FacadeContainer implements IFacadeContainer } @Override - public IFacadePart getFacade( AEPartLocation s ) + public IFacadePart getFacade( final AEPartLocation s ) { return this.storage.getFacade( s.ordinal() ); } @@ -88,7 +88,7 @@ public class FacadeContainer implements IFacadeContainer @Override public void rotateLeft() { - IFacadePart[] newFacades = new FacadePart[6]; + final IFacadePart[] newFacades = new FacadePart[6]; newFacades[AEPartLocation.UP.ordinal()] = this.storage.getFacade( AEPartLocation.UP.ordinal() ); newFacades[AEPartLocation.DOWN.ordinal()] = this.storage.getFacade( AEPartLocation.DOWN.ordinal() ); @@ -106,13 +106,13 @@ public class FacadeContainer implements IFacadeContainer } @Override - public void writeToNBT( NBTTagCompound c ) + public void writeToNBT( final NBTTagCompound c ) { for( int x = 0; x < this.facades; x++ ) { if( this.storage.getFacade( x ) != null ) { - NBTTagCompound data = new NBTTagCompound(); + final NBTTagCompound data = new NBTTagCompound(); this.storage.getFacade( x ).getItemStack().writeToNBT( data ); c.setTag( "facade:" + x, data ); } @@ -120,22 +120,22 @@ public class FacadeContainer implements IFacadeContainer } @Override - public boolean readFromStream( ByteBuf out ) throws IOException + public boolean readFromStream( final ByteBuf out ) throws IOException { - int facadeSides = out.readByte(); + final int facadeSides = out.readByte(); boolean changed = false; - int[] ids = new int[2]; + final int[] ids = new int[2]; for( int x = 0; x < this.facades; x++ ) { - AEPartLocation side = AEPartLocation.fromOrdinal( x ); - int ix = ( 1 << x ); + final AEPartLocation side = AEPartLocation.fromOrdinal( x ); + final int ix = ( 1 << x ); if( ( facadeSides & ix ) == ix ) { ids[0] = out.readInt(); ids[1] = out.readInt(); - boolean isBC = ids[0] < 0; + final boolean isBC = ids[0] < 0; ids[0] = Math.abs( ids[0] ); if( isBC && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) @@ -150,10 +150,10 @@ public class FacadeContainer implements IFacadeContainer else if( !isBC ) { - for( Item facadeItem : AEApi.instance().definitions().items().facade().maybeItem().asSet() ) + for( final Item facadeItem : AEApi.instance().definitions().items().facade().maybeItem().asSet() ) { - ItemFacade ifa = (ItemFacade) facadeItem; - ItemStack facade = ifa.createFromIDs( ids ); + final ItemFacade ifa = (ItemFacade) facadeItem; + final ItemStack facade = ifa.createFromIDs( ids ); if( facade != null ) { changed = changed || this.storage.getFacade( x ) == null; @@ -173,19 +173,19 @@ public class FacadeContainer implements IFacadeContainer } @Override - public void readFromNBT( NBTTagCompound c ) + public void readFromNBT( final NBTTagCompound c ) { for( int x = 0; x < this.facades; x++ ) { this.storage.setFacade( x, null ); - NBTTagCompound t = c.getCompoundTag( "facade:" + x ); + final NBTTagCompound t = c.getCompoundTag( "facade:" + x ); if( t != null ) { - ItemStack is = ItemStack.loadItemStackFromNBT( t ); + final ItemStack is = ItemStack.loadItemStackFromNBT( t ); if( is != null ) { - Item i = is.getItem(); + final Item i = is.getItem(); if( i instanceof IFacadeItem ) { this.storage.setFacade( x, ( (IFacadeItem) i ).createPartFromItemStack( is, AEPartLocation.fromOrdinal( x ) ) ); @@ -207,7 +207,7 @@ public class FacadeContainer implements IFacadeContainer } @Override - public void writeToStream( ByteBuf out ) throws IOException + public void writeToStream( final ByteBuf out ) throws IOException { int facadeSides = 0; for( int x = 0; x < this.facades; x++ ) @@ -221,11 +221,11 @@ public class FacadeContainer implements IFacadeContainer for( int x = 0; x < this.facades; x++ ) { - IFacadePart part = this.getFacade( AEPartLocation.fromOrdinal( x ) ); + final IFacadePart part = this.getFacade( AEPartLocation.fromOrdinal( x ) ); if( part != null ) { - int itemID = Item.getIdFromItem( part.getItem() ); - int dmgValue = part.getItemDamage(); + final int itemID = Item.getIdFromItem( part.getItem() ); + final int dmgValue = part.getItemDamage(); out.writeInt( itemID * ( part.notAEFacade() ? -1 : 1 ) ); out.writeInt( dmgValue ); } diff --git a/src/main/java/appeng/facade/FacadePart.java b/src/main/java/appeng/facade/FacadePart.java index 6cce57dd..09e9e44c 100644 --- a/src/main/java/appeng/facade/FacadePart.java +++ b/src/main/java/appeng/facade/FacadePart.java @@ -64,7 +64,7 @@ public class FacadePart implements IFacadePart, IBoxProvider public final AEPartLocation side; public int thickness = 2; - public FacadePart( ItemStack facade, AEPartLocation side ) + public FacadePart( final ItemStack facade, final AEPartLocation side ) { if( facade == null ) { @@ -75,7 +75,7 @@ public class FacadePart implements IFacadePart, IBoxProvider this.side = side; } - public static boolean isFacade( ItemStack is ) + public static boolean isFacade( final ItemStack is ) { return is.getItem() instanceof IFacadeItem; } @@ -87,7 +87,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } @Override - public void getBoxes( IPartCollisionHelper ch, Entity e ) + public void getBoxes( final IPartCollisionHelper ch, final Entity e ) { if( e instanceof EntityLivingBase ) { @@ -103,15 +103,15 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper instance2, ModelGenerator renderer, IFacadeContainer fc, AxisAlignedBB busBounds, boolean renderStilt ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper instance2, final ModelGenerator renderer, final IFacadeContainer fc, final AxisAlignedBB busBounds, final boolean renderStilt ) { if( this.facade != null ) { - BusRenderHelper instance = (BusRenderHelper) instance2; + final BusRenderHelper instance = (BusRenderHelper) instance2; try { - ItemStack randomItem = this.getTexture(); + final ItemStack randomItem = this.getTexture(); RenderBlocksWorkaround rbw = null; if( renderer instanceof RenderBlocksWorkaround ) @@ -130,7 +130,7 @@ public class FacadePart implements IFacadePart, IBoxProvider IAESprite myIcon = null; if( this.notAEFacade() && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) { - IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); myIcon = bc.getCobbleStructurePipeTexture(); } @@ -158,8 +158,8 @@ public class FacadePart implements IFacadePart, IBoxProvider { if( randomItem.getItem() instanceof ItemBlock ) { - ItemBlock ib = (ItemBlock) randomItem.getItem(); - Block blk = Block.getBlockFromItem( ib ); + final ItemBlock ib = (ItemBlock) randomItem.getItem(); + final Block blk = Block.getBlockFromItem( ib ); if( AEApi.instance().partHelper().getCableRenderMode().transparentFacades ) { @@ -179,9 +179,9 @@ public class FacadePart implements IFacadePart, IBoxProvider try { - int color = ib.getColorFromItemStack( randomItem, 0 ); + final int color = ib.getColorFromItemStack( randomItem, 0 ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } @@ -216,7 +216,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } else {*/ - IAESprite[] icon_down = renderer.getIcon( blk.getDefaultState() ); + final IAESprite[] icon_down = renderer.getIcon( blk.getDefaultState() ); instance.setTexture( icon_down[EnumFacing.DOWN.ordinal()], icon_down[EnumFacing.UP.ordinal()], icon_down[EnumFacing.NORTH.ordinal()], icon_down[EnumFacing.SOUTH.ordinal()], icon_down[EnumFacing.WEST.ordinal()], icon_down[EnumFacing.EAST.ordinal()] ); //} @@ -333,7 +333,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -342,15 +342,15 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper instance, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper instance, final ModelGenerator renderer ) { if( this.facade != null ) { - IFacadeItem fi = (IFacadeItem) this.facade.getItem(); + final IFacadeItem fi = (IFacadeItem) this.facade.getItem(); try { - ItemStack randomItem = fi.getTextureItem( this.facade ); + final ItemStack randomItem = fi.getTextureItem( this.facade ); instance.setTexture( renderer.getIcon( facade ) ); instance.setBounds( 7, 7, 4, 9, 9, 14 ); @@ -361,15 +361,15 @@ public class FacadePart implements IFacadePart, IBoxProvider { if( randomItem.getItem() instanceof ItemBlock ) { - ItemBlock ib = (ItemBlock) randomItem.getItem(); - Block blk = Block.getBlockFromItem( ib ); + final ItemBlock ib = (ItemBlock) randomItem.getItem(); + final Block blk = Block.getBlockFromItem( ib ); try { - int color = ib.getColorFromItemStack( randomItem, 0 ); + final int color = ib.getColorFromItemStack( randomItem, 0 ); instance.setInvColor( color ); } - catch( Throwable error ) + catch( final Throwable error ) { instance.setInvColor( 0xffffff ); } @@ -385,7 +385,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } } } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } @@ -407,7 +407,7 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override public Item getItem() { - ItemStack is = this.getTexture(); + final ItemStack is = this.getTexture(); if( is == null ) { return null; @@ -418,7 +418,7 @@ public class FacadePart implements IFacadePart, IBoxProvider @Override public int getItemDamage() { - ItemStack is = this.getTexture(); + final ItemStack is = this.getTexture(); if( is == null ) { return 0; @@ -433,7 +433,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } @Override - public void setThinFacades( boolean useThinFacades ) + public void setThinFacades( final boolean useThinFacades ) { this.thickness = useThinFacades ? 1 : 2; } @@ -446,8 +446,8 @@ public class FacadePart implements IFacadePart, IBoxProvider return true; } - ItemStack is = this.getTexture(); - Block blk = Block.getBlockFromItem( is.getItem() ); + final ItemStack is = this.getTexture(); + final Block blk = Block.getBlockFromItem( is.getItem() ); return !blk.isOpaqueCube(); } @@ -460,7 +460,7 @@ public class FacadePart implements IFacadePart, IBoxProvider // AE Facade if( maybeFacade instanceof IFacadeItem ) { - IFacadeItem facade = (IFacadeItem) maybeFacade; + final IFacadeItem facade = (IFacadeItem) maybeFacade; return facade.getTextureItem( this.facade ); } @@ -474,12 +474,12 @@ public class FacadePart implements IFacadePart, IBoxProvider return null; } - private EnumSet calculateFaceOpenFaces( IBlockAccess blockAccess, IFacadeContainer fc, BlockPos pos, AEPartLocation side ) + private EnumSet calculateFaceOpenFaces( final IBlockAccess blockAccess, final IFacadeContainer fc, final BlockPos pos, final AEPartLocation side ) { - EnumSet out = EnumSet.of( side, side.getOpposite() ); - IFacadePart facade = fc.getFacade( side ); + final EnumSet out = EnumSet.of( side, side.getOpposite() ); + final IFacadePart facade = fc.getFacade( side ); - for( AEPartLocation it : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation it : AEPartLocation.SIDE_LOCATIONS ) { if( !out.contains( it ) && this.hasAlphaDiff( blockAccess.getTileEntity( pos.offset( it.getFacing() ) ), side, facade ) ) { @@ -489,7 +489,7 @@ public class FacadePart implements IFacadePart, IBoxProvider if( out.contains( AEPartLocation.UP ) && ( side.xOffset != 0 || side.zOffset != 0 ) ) { - IFacadePart fp = fc.getFacade( AEPartLocation.UP ); + final IFacadePart fp = fc.getFacade( AEPartLocation.UP ); if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) ) { out.remove( AEPartLocation.UP ); @@ -498,7 +498,7 @@ public class FacadePart implements IFacadePart, IBoxProvider if( out.contains( AEPartLocation.DOWN ) && ( side.xOffset != 0 || side.zOffset != 0 ) ) { - IFacadePart fp = fc.getFacade( AEPartLocation.DOWN ); + final IFacadePart fp = fc.getFacade( AEPartLocation.DOWN ); if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) ) { out.remove( AEPartLocation.DOWN ); @@ -507,7 +507,7 @@ public class FacadePart implements IFacadePart, IBoxProvider if( out.contains( AEPartLocation.SOUTH ) && ( side.xOffset != 0 ) ) { - IFacadePart fp = fc.getFacade( AEPartLocation.SOUTH ); + final IFacadePart fp = fc.getFacade( AEPartLocation.SOUTH ); if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) ) { out.remove( AEPartLocation.SOUTH ); @@ -516,7 +516,7 @@ public class FacadePart implements IFacadePart, IBoxProvider if( out.contains( AEPartLocation.NORTH ) && ( side.xOffset != 0 ) ) { - IFacadePart fp = fc.getFacade( AEPartLocation.NORTH ); + final IFacadePart fp = fc.getFacade( AEPartLocation.NORTH ); if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) ) { out.remove( AEPartLocation.NORTH ); @@ -552,14 +552,14 @@ public class FacadePart implements IFacadePart, IBoxProvider } @SideOnly( Side.CLIENT ) - private void renderSegmentBlockCurrentBounds( IPartRenderHelper instance, BlockPos pos, ModelGenerator renderer, double minX, double minY, double minZ, double maxX, double maxY, double maxZ ) + private void renderSegmentBlockCurrentBounds( final IPartRenderHelper instance, final BlockPos pos, final ModelGenerator renderer, final double minX, final double minY, final double minZ, final double maxX, final double maxY, final double maxZ ) { - double oldMinX = renderer.renderMinX; - double oldMinY = renderer.renderMinY; - double oldMinZ = renderer.renderMinZ; - double oldMaxX = renderer.renderMaxX; - double oldMaxY = renderer.renderMaxY; - double oldMaxZ = renderer.renderMaxZ; + final double oldMinX = renderer.renderMinX; + final double oldMinY = renderer.renderMinY; + final double oldMinZ = renderer.renderMinZ; + final double oldMaxX = renderer.renderMaxX; + final double oldMaxY = renderer.renderMaxY; + final double oldMaxZ = renderer.renderMaxZ; renderer.renderMinX = Math.max( renderer.renderMinX, minX ); renderer.renderMinY = Math.max( renderer.renderMinY, minY ); @@ -582,12 +582,12 @@ public class FacadePart implements IFacadePart, IBoxProvider renderer.renderMaxZ = oldMaxZ; } - private boolean hasAlphaDiff( TileEntity tileEntity, AEPartLocation side, IFacadePart facade ) + private boolean hasAlphaDiff( final TileEntity tileEntity, final AEPartLocation side, final IFacadePart facade ) { if( tileEntity instanceof IPartHost ) { - IPartHost ph = (IPartHost) tileEntity; - IFacadePart fp = ph.getFacadeContainer().getFacade( side ); + final IPartHost ph = (IPartHost) tileEntity; + final IFacadePart fp = ph.getFacadeContainer().getFacade( side ); return fp == null || ( fp.isTransparent() != facade.isTransparent() ); } @@ -596,7 +596,7 @@ public class FacadePart implements IFacadePart, IBoxProvider } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { this.getBoxes( bch, null ); } diff --git a/src/main/java/appeng/helpers/AEGlassMaterial.java b/src/main/java/appeng/helpers/AEGlassMaterial.java index 4f1dc35c..01244afa 100644 --- a/src/main/java/appeng/helpers/AEGlassMaterial.java +++ b/src/main/java/appeng/helpers/AEGlassMaterial.java @@ -28,7 +28,7 @@ public class AEGlassMaterial extends Material public static final AEGlassMaterial INSTANCE = ( new AEGlassMaterial( MapColor.airColor ) ); - public AEGlassMaterial( MapColor color ) + public AEGlassMaterial( final MapColor color ) { super( color ); } diff --git a/src/main/java/appeng/helpers/DualityInterface.java b/src/main/java/appeng/helpers/DualityInterface.java index f0b48453..7f211240 100644 --- a/src/main/java/appeng/helpers/DualityInterface.java +++ b/src/main/java/appeng/helpers/DualityInterface.java @@ -128,7 +128,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn IMEInventory destination; private boolean isWorking = false; - public DualityInterface( AENetworkProxy networkProxy, IInterfaceHost ih ) + public DualityInterface( final AENetworkProxy networkProxy, final IInterfaceHost ih ) { this.gridProxy = networkProxy; this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL ); @@ -150,7 +150,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.isWorking ) { @@ -167,11 +167,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } else if( inv == this.storage && slot >= 0 ) { - boolean had = this.hasWorkToDo(); + final boolean had = this.hasWorkToDo(); this.updatePlan( slot ); - boolean now = this.hasWorkToDo(); + final boolean now = this.hasWorkToDo(); if( had != now ) { @@ -186,7 +186,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -194,7 +194,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { this.config.writeToNBT( data, "config" ); this.patterns.writeToNBT( data, "patterns" ); @@ -204,12 +204,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.craftingTracker.writeToNBT( data ); data.setInteger( "priority", this.priority ); - NBTTagList waitingToSend = new NBTTagList(); + final NBTTagList waitingToSend = new NBTTagList(); if( this.waitingToSend != null ) { - for( ItemStack is : this.waitingToSend ) + for( final ItemStack is : this.waitingToSend ) { - NBTTagCompound item = new NBTTagCompound(); + final NBTTagCompound item = new NBTTagCompound(); is.writeToNBT( item ); waitingToSend.appendTag( item ); } @@ -217,18 +217,18 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn data.setTag( "waitingToSend", waitingToSend ); } - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { this.waitingToSend = null; - NBTTagList waitingList = data.getTagList( "waitingToSend", 10 ); + final NBTTagList waitingList = data.getTagList( "waitingToSend", 10 ); if( waitingList != null ) { for( int x = 0; x < waitingList.tagCount(); x++ ) { - NBTTagCompound c = waitingList.getCompoundTagAt( x ); + final NBTTagCompound c = waitingList.getCompoundTagAt( x ); if( c != null ) { - ItemStack is = ItemStack.loadItemStackFromNBT( c ); + final ItemStack is = ItemStack.loadItemStackFromNBT( c ); this.addToSendList( is ); } } @@ -245,7 +245,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.updateCraftingList(); } - public void addToSendList( ItemStack is ) + public void addToSendList( final ItemStack is ) { if( is == null ) { @@ -263,7 +263,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -273,7 +273,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { this.hasConfig = false; - for( ItemStack p : this.config ) + for( final ItemStack p : this.config ) { if( p != null ) { @@ -282,14 +282,14 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - boolean had = this.hasWorkToDo(); + final boolean had = this.hasWorkToDo(); for( int x = 0; x < NUMBER_OF_CONFIG_SLOTS; x++ ) { this.updatePlan( x ); } - boolean has = this.hasWorkToDo(); + final boolean has = this.hasWorkToDo(); if( had != has ) { @@ -304,7 +304,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -315,7 +315,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public void updateCraftingList() { - Boolean[] accountedFor = { false, false, false, false, false, false, false, false, false }; // 9... + final Boolean[] accountedFor = { false, false, false, false, false, false, false, false, false }; // 9... assert ( accountedFor.length == this.patterns.getSizeInventory() ); @@ -326,15 +326,15 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( this.craftingList != null ) { - Iterator i = this.craftingList.iterator(); + final Iterator i = this.craftingList.iterator(); while( i.hasNext() ) { - ICraftingPatternDetails details = i.next(); + final ICraftingPatternDetails details = i.next(); boolean found = false; for( int x = 0; x < accountedFor.length; x++ ) { - ItemStack is = this.patterns.getStackInSlot( x ); + final ItemStack is = this.patterns.getStackInSlot( x ); if( details.getPattern() == is ) { accountedFor[x] = found = true; @@ -360,7 +360,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -371,7 +371,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return this.hasItemsToSend() || this.requireWork[0] != null || this.requireWork[1] != null || this.requireWork[2] != null || this.requireWork[3] != null || this.requireWork[4] != null || this.requireWork[5] != null || this.requireWork[6] != null || this.requireWork[7] != null; } - private void updatePlan( int slot ) + private void updatePlan( final int slot ) { IAEItemStack req = this.config.getAEStackInSlot( slot ); if( req != null && req.getStackSize() <= 0 ) @@ -380,11 +380,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn req = null; } - ItemStack Stored = this.storage.getStackInSlot( slot ); + final ItemStack Stored = this.storage.getStackInSlot( slot ); if( req == null && Stored != null ) { - IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); + final IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); this.requireWork[slot] = work.setStackSize( -work.getStackSize() ); return; } @@ -407,7 +407,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn else // Stored != null; dispose! { - IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); + final IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); this.requireWork[slot] = work.setStackSize( -work.getStackSize() ); return; } @@ -427,20 +427,20 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) ); this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } - TileEntity te = this.iHost.getTileEntity(); + final TileEntity te = this.iHost.getTileEntity(); if( te != null && te.getWorld() != null ) { Platform.notifyBlocksOfNeighbors( te.getWorld(), te.getPos() ); } } - public void addToCraftingList( ItemStack is ) + public void addToCraftingList( final ItemStack is ) { if( is == null ) { @@ -449,8 +449,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( is.getItem() instanceof ICraftingPatternItem ) { - ICraftingPatternItem cpi = (ICraftingPatternItem) is.getItem(); - ICraftingPatternDetails details = cpi.getPatternForItem( is, this.iHost.getTileEntity().getWorld() ); + final ICraftingPatternItem cpi = (ICraftingPatternItem) is.getItem(); + final ICraftingPatternDetails details = cpi.getPatternForItem( is, this.iHost.getTileEntity().getWorld() ); if( details != null ) { @@ -470,9 +470,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { - IAEItemStack out = this.destination.injectItems( AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, null ); + final IAEItemStack out = this.destination.injectItems( AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, null ); if( out == null ) { return true; @@ -501,7 +501,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.items.setInternal( this.gridProxy.getStorage().getItemInventory() ); this.fluids.setInternal( this.gridProxy.getStorage().getFluidInventory() ); } - catch( GridAccessException gae ) + catch( final GridAccessException gae ) { this.items.setInternal( new NullInventory() ); this.fluids.setInternal( new NullInventory() ); @@ -510,7 +510,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.notifyNeighbors(); } - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.SMART; } @@ -533,19 +533,19 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - public int[] getSlotsForFace( EnumFacing side ) + public int[] getSlotsForFace( final EnumFacing side ) { return this.sides; } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.Interface.min, TickRates.Interface.max, !this.hasWorkToDo(), true ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( !this.gridProxy.isActive() ) { @@ -557,37 +557,37 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.pushItemsOut( this.iHost.getTargets() ); } - boolean couldDoWork = this.updateStorage(); + final boolean couldDoWork = this.updateStorage(); return this.hasWorkToDo() ? ( couldDoWork ? TickRateModulation.URGENT : TickRateModulation.SLOWER ) : TickRateModulation.SLEEP; } - private void pushItemsOut( EnumSet possibleDirections ) + private void pushItemsOut( final EnumSet possibleDirections ) { if( !this.hasItemsToSend() ) { return; } - TileEntity tile = this.iHost.getTileEntity(); - World w = tile.getWorld(); + final TileEntity tile = this.iHost.getTileEntity(); + final World w = tile.getWorld(); - Iterator i = this.waitingToSend.iterator(); + final Iterator i = this.waitingToSend.iterator(); while( i.hasNext() ) { ItemStack whatToSend = i.next(); - for( EnumFacing s : possibleDirections ) + for( final EnumFacing s : possibleDirections ) { - TileEntity te = w.getTileEntity( tile.getPos().offset( s ) ); + final TileEntity te = w.getTileEntity( tile.getPos().offset( s ) ); if( te == null ) { continue; } - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); if( ad != null ) { - ItemStack Result = ad.addItems( whatToSend ); + final ItemStack Result = ad.addItems( whatToSend ); if( Result == null ) { @@ -632,16 +632,16 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return didSomething; } - private boolean usePlan( int x, IAEItemStack itemStack ) + private boolean usePlan( final int x, final IAEItemStack itemStack ) { - InventoryAdaptor adaptor = this.getAdaptor( x ); + final InventoryAdaptor adaptor = this.getAdaptor( x ); this.isWorking = true; boolean changed = false; try { this.destination = this.gridProxy.getStorage().getItemInventory(); - IEnergySource src = this.gridProxy.getEnergy(); + final IEnergySource src = this.gridProxy.getEnergy(); if( this.craftingTracker.isBusy( x ) ) { @@ -656,11 +656,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn throw new GridAccessException(); } - IAEItemStack acquired = Platform.poweredExtraction( src, this.destination, itemStack, this.interfaceRequestSource ); + final IAEItemStack acquired = Platform.poweredExtraction( src, this.destination, itemStack, this.interfaceRequestSource ); if( acquired != null ) { changed = true; - ItemStack issue = adaptor.addItems( acquired.getItemStack() ); + final ItemStack issue = adaptor.addItems( acquired.getItemStack() ); if( issue != null ) { throw new IllegalStateException( "bad attempt at managing inventory. ( addItems )" ); @@ -679,7 +679,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn long diff = toStore.getStackSize(); // make sure strange things didn't happen... - ItemStack canExtract = adaptor.simulateRemove( (int) diff, toStore.getItemStack(), null ); + final ItemStack canExtract = adaptor.simulateRemove( (int) diff, toStore.getItemStack(), null ); if( canExtract == null || canExtract.stackSize != diff ) { changed = true; @@ -697,7 +697,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { // extract items! changed = true; - ItemStack removed = adaptor.removeItems( (int) diff, null, null ); + final ItemStack removed = adaptor.removeItems( (int) diff, null, null ); if( removed == null ) { throw new IllegalStateException( "bad attempt at managing inventory. ( removeItems )" ); @@ -710,7 +710,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } // else wtf? } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -724,12 +724,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return changed; } - private InventoryAdaptor getAdaptor( int slot ) + private InventoryAdaptor getAdaptor( final int slot ) { return new AdaptorIInventory( this.slotInv.getWrapper( slot ) ); } - private boolean handleCrafting( int x, InventoryAdaptor d, IAEItemStack itemStack ) + private boolean handleCrafting( final int x, final InventoryAdaptor d, final IAEItemStack itemStack ) { try { @@ -738,7 +738,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return this.craftingTracker.handleCrafting( x, itemStack.getStackSize(), itemStack, d, this.iHost.getTileEntity().getWorld(), this.gridProxy.getGrid(), this.gridProxy.getCrafting(), this.mySource ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -747,7 +747,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { if( this.upgrades == null ) { @@ -779,7 +779,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "storage" ) ) { @@ -816,7 +816,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { if( this.getInstalledUpgrades( Upgrades.CRAFTING ) == 0 ) { @@ -842,7 +842,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.craftingTracker.cancel(); } - public IStorageMonitorable getMonitorable( EnumFacing side, BaseActionSource src, IStorageMonitorable myInterface ) + public IStorageMonitorable getMonitorable( final EnumFacing side, final BaseActionSource src, final IStorageMonitorable myInterface ) { if( Platform.canAccess( this.gridProxy, src ) ) { @@ -869,20 +869,20 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table ) { if( this.hasItemsToSend() || !this.gridProxy.isActive() ) { return false; } - TileEntity tile = this.iHost.getTileEntity(); - World w = tile.getWorld(); + final TileEntity tile = this.iHost.getTileEntity(); + final World w = tile.getWorld(); - EnumSet possibleDirections = this.iHost.getTargets(); - for( EnumFacing s : possibleDirections ) + final EnumSet possibleDirections = this.iHost.getTargets(); + for( final EnumFacing s : possibleDirections ) { - TileEntity te = w.getTileEntity( tile.getPos().offset( s ) ); + final TileEntity te = w.getTileEntity( tile.getPos().offset( s ) ); if( te instanceof IInterfaceHost ) { try @@ -892,7 +892,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn continue; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { continue; } @@ -900,7 +900,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( te instanceof ICraftingMachine ) { - ICraftingMachine cm = (ICraftingMachine) te; + final ICraftingMachine cm = (ICraftingMachine) te; if( cm.acceptsPlans() ) { if( cm.pushPattern( patternDetails, table, s.getOpposite() ) ) @@ -911,7 +911,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); if( ad != null ) { if( this.isBlocking() ) @@ -926,7 +926,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { for( int x = 0; x < table.getSizeInventory(); x++ ) { - ItemStack is = table.getStackInSlot( x ); + final ItemStack is = table.getStackInSlot( x ); if( is != null ) { final ItemStack added = ad.addItems( is ); @@ -954,17 +954,17 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( this.isBlocking() ) { - EnumSet possibleDirections = this.iHost.getTargets(); - TileEntity tile = this.iHost.getTileEntity(); - World w = tile.getWorld(); + final EnumSet possibleDirections = this.iHost.getTargets(); + final TileEntity tile = this.iHost.getTileEntity(); + final World w = tile.getWorld(); boolean allAreBusy = true; - for( EnumFacing s : possibleDirections ) + for( final EnumFacing s : possibleDirections ) { - TileEntity te = w.getTileEntity( tile.getPos().offset( s ) ); + final TileEntity te = w.getTileEntity( tile.getPos().offset( s ) ); - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); if( ad != null ) { if( ad.simulateRemove( 1, null, null ) == null ) @@ -981,7 +981,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return busy; } - private boolean sameGrid( IGrid grid ) throws GridAccessException + private boolean sameGrid( final IGrid grid ) throws GridAccessException { return grid == this.gridProxy.getGrid(); } @@ -991,11 +991,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return this.cm.getSetting( Settings.BLOCK ) == YesNo.YES; } - private boolean acceptsItems( InventoryAdaptor ad, InventoryCrafting table ) + private boolean acceptsItems( final InventoryAdaptor ad, final InventoryCrafting table ) { for( int x = 0; x < table.getSizeInventory(); x++ ) { - ItemStack is = table.getStackInSlot( x ); + final ItemStack is = table.getStackInSlot( x ); if( is == null ) { continue; @@ -1011,11 +1011,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public void provideCrafting( ICraftingProviderHelper craftingTracker ) + public void provideCrafting( final ICraftingProviderHelper craftingTracker ) { if( this.gridProxy.isActive() && this.craftingList != null ) { - for( ICraftingPatternDetails details : this.craftingList ) + for( final ICraftingPatternDetails details : this.craftingList ) { details.setPriority( this.priority ); craftingTracker.addCraftingOption( this, details ); @@ -1023,11 +1023,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - public void addDrops( List drops ) + public void addDrops( final List drops ) { if( this.waitingToSend != null ) { - for( ItemStack is : this.waitingToSend ) + for( final ItemStack is : this.waitingToSend ) { if( is != null ) { @@ -1036,7 +1036,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - for( ItemStack is : this.upgrades ) + for( final ItemStack is : this.upgrades ) { if( is != null ) { @@ -1044,7 +1044,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - for( ItemStack is : this.storage ) + for( final ItemStack is : this.storage ) { if( is != null ) { @@ -1052,7 +1052,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - for( ItemStack is : this.patterns ) + for( final ItemStack is : this.patterns ) { if( is != null ) { @@ -1084,13 +1084,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return this.craftingTracker.getRequestedJobs(); } - public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack acquired, Actionable mode ) + public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack acquired, final Actionable mode ) { - int slot = this.craftingTracker.getSlot( link ); + final int slot = this.craftingTracker.getSlot( link ); if( acquired != null && slot >= 0 && slot <= this.requireWork.length ) { - InventoryAdaptor adaptor = this.getAdaptor( slot ); + final InventoryAdaptor adaptor = this.getAdaptor( slot ); if( mode == Actionable.SIMULATE ) { @@ -1098,7 +1098,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } else { - IAEItemStack is = AEItemStack.create( adaptor.addItems( acquired.getItemStack() ) ); + final IAEItemStack is = AEItemStack.create( adaptor.addItems( acquired.getItemStack() ) ); this.updatePlan( slot ); return is; } @@ -1107,7 +1107,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return acquired; } - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { this.craftingTracker.jobStateChange( link ); } @@ -1123,9 +1123,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } final EnumSet possibleDirections = this.iHost.getTargets(); - for( EnumFacing direction : possibleDirections ) + for( final EnumFacing direction : possibleDirections ) { - BlockPos targ = hostTile.getPos().offset( direction ); + final BlockPos targ = hostTile.getPos().offset( direction ); final TileEntity directedTile = hostWorld.getTileEntity( targ ); if( directedTile == null ) @@ -1142,7 +1142,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn continue; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { continue; } @@ -1158,7 +1158,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn if( directedTile instanceof ISidedInventory ) { - int[] sides = ( (ISidedInventory) directedTile ).getSlotsForFace( direction.getOpposite() ); + final int[] sides = ( (ISidedInventory) directedTile ).getSlotsForFace( direction.getOpposite() ); if( sides == null || sides.length == 0 ) { @@ -1172,13 +1172,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { Vec3 from = new Vec3( hostTile.getPos().getX() + 0.5, hostTile.getPos().getY() + 0.5, hostTile.getPos().getZ() + 0.5 ); from = from.addVector( direction.getFrontOffsetX() * 0.501, direction.getFrontOffsetY() * 0.501, direction.getFrontOffsetZ() * 0.501 ); - Vec3 to = from.addVector( direction.getFrontOffsetX(), direction.getFrontOffsetY(), direction.getFrontOffsetZ() ); - MovingObjectPosition mop = hostWorld.rayTraceBlocks( from, to, true ); + final Vec3 to = from.addVector( direction.getFrontOffsetX(), direction.getFrontOffsetY(), direction.getFrontOffsetZ() ); + final MovingObjectPosition mop = hostWorld.rayTraceBlocks( from, to, true ); if( mop != null && !BAD_BLOCKS.contains( directedBlock ) ) { if( mop.getBlockPos().equals( directedTile.getPos() ) ) { - ItemStack g = directedBlock.getPickBlock( mop, hostWorld, directedTile.getPos() ); + final ItemStack g = directedBlock.getPickBlock( mop, hostWorld, directedTile.getPos() ); if( g != null ) { what = g; @@ -1186,7 +1186,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } } - catch( Throwable t ) + catch( final Throwable t ) { BAD_BLOCKS.add( directedBlock ); // nope! } @@ -1196,7 +1196,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return what.getUnlocalizedName(); } - Item item = Item.getItemFromBlock( directedBlock ); + final Item item = Item.getItemFromBlock( directedBlock ); if( item == null ) { return directedBlock.getUnlocalizedName(); @@ -1209,7 +1209,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn public long getSortValue() { - TileEntity te = this.iHost.getTileEntity(); + final TileEntity te = this.iHost.getTileEntity(); return ( te.getPos().getZ() << 24 ) ^ ( te.getPos().getX() << 8 ) ^ te.getPos().getY(); } @@ -1225,7 +1225,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; this.markDirty(); @@ -1234,7 +1234,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn { this.gridProxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.gridProxy.getNode() ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -1243,7 +1243,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn private class InterfaceRequestSource extends MachineSource { - public InterfaceRequestSource( IActionHost v ) + public InterfaceRequestSource( final IActionHost v ) { super( v ); } @@ -1253,14 +1253,14 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn private class InterfaceInventory extends MEMonitorIInventory { - public InterfaceInventory( DualityInterface tileInterface ) + public InterfaceInventory( final DualityInterface tileInterface ) { super( new AdaptorIInventory( tileInterface.storage ) ); this.mySource = new MachineSource( DualityInterface.this.iHost ); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { if( src instanceof InterfaceRequestSource ) { @@ -1271,7 +1271,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable type, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable type, final BaseActionSource src ) { if( src instanceof InterfaceRequestSource ) { diff --git a/src/main/java/appeng/helpers/LocationRotation.java b/src/main/java/appeng/helpers/LocationRotation.java index 96949404..9c31659e 100644 --- a/src/main/java/appeng/helpers/LocationRotation.java +++ b/src/main/java/appeng/helpers/LocationRotation.java @@ -32,7 +32,7 @@ public class LocationRotation implements IOrientable final int y; final int z; - public LocationRotation( IBlockAccess world, int x, int y, int z ) + public LocationRotation( final IBlockAccess world, final int x, final int y, final int z ) { this.w = world; this.x = x; @@ -59,12 +59,12 @@ public class LocationRotation implements IOrientable @Override public EnumFacing getUp() { - int num = Math.abs( this.x + this.y + this.z ) % 6; + final int num = Math.abs( this.x + this.y + this.z ) % 6; return EnumFacing.VALUES[ num ]; } @Override - public void setOrientation( EnumFacing forward, EnumFacing up ) + public void setOrientation( final EnumFacing forward, final EnumFacing up ) { } diff --git a/src/main/java/appeng/helpers/MetaRotation.java b/src/main/java/appeng/helpers/MetaRotation.java index 020fd21b..1be3176b 100644 --- a/src/main/java/appeng/helpers/MetaRotation.java +++ b/src/main/java/appeng/helpers/MetaRotation.java @@ -37,7 +37,7 @@ public class MetaRotation implements IOrientable final IBlockAccess w; final BlockPos pos; - public MetaRotation( IBlockAccess world, BlockPos pos, boolean FullFacing ) + public MetaRotation( final IBlockAccess world, final BlockPos pos, final boolean FullFacing ) { this.w = world; this.pos = pos; @@ -63,11 +63,11 @@ public class MetaRotation implements IOrientable @Override public EnumFacing getUp() { - IBlockState state = w.getBlockState( pos ); + final IBlockState state = w.getBlockState( pos ); if (useFacing ) { - EnumFacing f = state == null ? EnumFacing.UP : (EnumFacing) state.getValue( BlockTorch.FACING ); + final EnumFacing f = state == null ? EnumFacing.UP : (EnumFacing) state.getValue( BlockTorch.FACING ); return f; } @@ -89,7 +89,7 @@ public class MetaRotation implements IOrientable } @Override - public void setOrientation( EnumFacing forward, EnumFacing up ) + public void setOrientation( final EnumFacing forward, final EnumFacing up ) { if( this.w instanceof World ) { diff --git a/src/main/java/appeng/helpers/MultiCraftingTracker.java b/src/main/java/appeng/helpers/MultiCraftingTracker.java index a1f06e94..04e1eee6 100644 --- a/src/main/java/appeng/helpers/MultiCraftingTracker.java +++ b/src/main/java/appeng/helpers/MultiCraftingTracker.java @@ -47,7 +47,7 @@ public class MultiCraftingTracker private ICraftingLink[] links = null; private int failedCraftingAttempts = 0; - public MultiCraftingTracker( ICraftingRequester o, int size ) + public MultiCraftingTracker( final ICraftingRequester o, final int size ) { this.owner = o; this.size = size; @@ -58,7 +58,7 @@ public class MultiCraftingTracker return failedCraftingAttempts; } - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { for( int x = 0; x < this.size; x++ ) { @@ -71,7 +71,7 @@ public class MultiCraftingTracker } } - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { for( int x = 0; x < this.size; x++ ) { @@ -86,7 +86,7 @@ public class MultiCraftingTracker } } - public boolean handleCrafting( int x, long itemToCraft, IAEItemStack ais, InventoryAdaptor d, World w, IGrid g, ICraftingGrid cg, BaseActionSource mySrc ) + public boolean handleCrafting( final int x, final long itemToCraft, final IAEItemStack ais, final InventoryAdaptor d, final World w, final IGrid g, final ICraftingGrid cg, final BaseActionSource mySrc ) { if( ais != null && d.simulateAdd( ais.getItemStack() ) == null ) { @@ -126,11 +126,11 @@ public class MultiCraftingTracker return true; } } - catch( InterruptedException e ) + catch( final InterruptedException e ) { // :P } - catch( ExecutionException e ) + catch( final ExecutionException e ) { // :P } @@ -159,7 +159,7 @@ public class MultiCraftingTracker return ImmutableSet.copyOf( new NonNullArrayIterator( this.links ) ); } - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { if( this.links != null ) { @@ -174,7 +174,7 @@ public class MultiCraftingTracker } } - public int getSlot( ICraftingLink link ) + public int getSlot( final ICraftingLink link ) { if( this.links != null ) { @@ -194,7 +194,7 @@ public class MultiCraftingTracker { if( this.links != null ) { - for( ICraftingLink l : this.links ) + for( final ICraftingLink l : this.links ) { if( l != null ) { @@ -207,7 +207,7 @@ public class MultiCraftingTracker if( this.jobs != null ) { - for( Future l : this.jobs ) + for( final Future l : this.jobs ) { if( l != null ) { @@ -219,12 +219,12 @@ public class MultiCraftingTracker } } - public boolean isBusy( int slot ) + public boolean isBusy( final int slot ) { return this.getLink( slot ) != null || this.getJob( slot ) != null; } - private ICraftingLink getLink( int slot ) + private ICraftingLink getLink( final int slot ) { if( this.links == null ) { @@ -234,7 +234,7 @@ public class MultiCraftingTracker return this.links[slot]; } - private void setLink( int slot, ICraftingLink l ) + private void setLink( final int slot, final ICraftingLink l ) { if( this.links == null ) { @@ -264,7 +264,7 @@ public class MultiCraftingTracker } } - private Future getJob( int slot ) + private Future getJob( final int slot ) { if( this.jobs == null ) { @@ -274,7 +274,7 @@ public class MultiCraftingTracker return this.jobs[slot]; } - private void setJob( int slot, Future l ) + private void setJob( final int slot, final Future l ) { if( this.jobs == null ) { @@ -285,7 +285,7 @@ public class MultiCraftingTracker boolean hasStuff = false; - for( Future job : this.jobs ) + for( final Future job : this.jobs ) { if( job != null ) { diff --git a/src/main/java/appeng/helpers/NonNullArrayIterator.java b/src/main/java/appeng/helpers/NonNullArrayIterator.java index 3eb05b53..ca952628 100644 --- a/src/main/java/appeng/helpers/NonNullArrayIterator.java +++ b/src/main/java/appeng/helpers/NonNullArrayIterator.java @@ -30,7 +30,7 @@ public class NonNullArrayIterator implements Iterator private final E[] g; private int offset = 0; - public NonNullArrayIterator( E[] o ) + public NonNullArrayIterator( final E[] o ) { this.g = o; } diff --git a/src/main/java/appeng/helpers/NullRotation.java b/src/main/java/appeng/helpers/NullRotation.java index 32f402cc..70dd4877 100644 --- a/src/main/java/appeng/helpers/NullRotation.java +++ b/src/main/java/appeng/helpers/NullRotation.java @@ -50,7 +50,7 @@ public class NullRotation implements IOrientable } @Override - public void setOrientation( EnumFacing forward, EnumFacing up ) + public void setOrientation( final EnumFacing forward, final EnumFacing up ) { } diff --git a/src/main/java/appeng/helpers/PatternHelper.java b/src/main/java/appeng/helpers/PatternHelper.java index 172ca181..1dd642a0 100644 --- a/src/main/java/appeng/helpers/PatternHelper.java +++ b/src/main/java/appeng/helpers/PatternHelper.java @@ -59,27 +59,27 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable in = new ArrayList(); - List out = new ArrayList(); + final List in = new ArrayList(); + final List out = new ArrayList(); for( int x = 0; x < inTag.tagCount(); x++ ) { - ItemStack gs = ItemStack.loadItemStackFromNBT( inTag.getCompoundTagAt( x ) ); + final ItemStack gs = ItemStack.loadItemStackFromNBT( inTag.getCompoundTagAt( x ) ); this.crafting.setInventorySlotContents( x, gs ); if( gs != null && ( !this.isCrafting || !gs.hasTagCompound() ) ) @@ -111,7 +111,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable tmpOutputs = new HashMap(); - for( IAEItemStack io : this.outputs ) + final HashMap tmpOutputs = new HashMap(); + for( final IAEItemStack io : this.outputs ) { if( io == null ) { continue; } - IAEItemStack g = tmpOutputs.get( io ); + final IAEItemStack g = tmpOutputs.get( io ); if( g == null ) { tmpOutputs.put( io, io.copy() ); @@ -141,15 +141,15 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable tmpInputs = new HashMap(); - for( IAEItemStack io : this.inputs ) + final HashMap tmpInputs = new HashMap(); + for( final IAEItemStack io : this.inputs ) { if( io == null ) { continue; } - IAEItemStack g = tmpInputs.get( io ); + final IAEItemStack g = tmpInputs.get( io ); if( g == null ) { tmpInputs.put( io, io.copy() ); @@ -167,7 +167,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable> ( offset + 32 ) ); } @@ -400,13 +400,13 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable> target; - public PlayerSecurityWrapper( HashMap> playerPerms ) + public PlayerSecurityWrapper( final HashMap> playerPerms ) { this.target = playerPerms; } @Override - public void addPlayer( int playerID, EnumSet permissions ) + public void addPlayer( final int playerID, final EnumSet permissions ) { this.target.put( playerID, permissions ); } diff --git a/src/main/java/appeng/helpers/Splotch.java b/src/main/java/appeng/helpers/Splotch.java index 0e87d461..ec5cb7c4 100644 --- a/src/main/java/appeng/helpers/Splotch.java +++ b/src/main/java/appeng/helpers/Splotch.java @@ -33,13 +33,13 @@ public class Splotch public final AEColor color; private final int pos; - public Splotch( AEColor col, boolean lit, EnumFacing side, Vec3 position ) + public Splotch( final AEColor col, final boolean lit, final EnumFacing side, final Vec3 position ) { this.color = col; this.lumen = lit; - double x; - double y; + final double x; + final double y; if( side == EnumFacing.SOUTH || side == EnumFacing.NORTH ) { @@ -59,28 +59,28 @@ public class Splotch y = position.zCoord; } - int a = (int) ( x * 0xF ); - int b = (int) ( y * 0xF ); + final int a = (int) ( x * 0xF ); + final int b = (int) ( y * 0xF ); this.pos = a | ( b << 4 ); this.side = side; } - public Splotch( ByteBuf data ) + public Splotch( final ByteBuf data ) { this.pos = data.readByte(); - int val = data.readByte(); + final int val = data.readByte(); this.side = EnumFacing.VALUES[ val & 0x07 ]; this.color = AEColor.values()[( val >> 3 ) & 0x0F]; this.lumen = ( ( val >> 7 ) & 0x01 ) > 0; } - public void writeToStream( ByteBuf stream ) + public void writeToStream( final ByteBuf stream ) { stream.writeByte( this.pos ); - int val = this.side.ordinal() | ( this.color.ordinal() << 3 ) | ( this.lumen ? 0x80 : 0x00 ); + final int val = this.side.ordinal() | ( this.color.ordinal() << 3 ) | ( this.lumen ? 0x80 : 0x00 ); stream.writeByte( val ); } @@ -96,7 +96,7 @@ public class Splotch public int getSeed() { - int val = this.side.ordinal() | ( this.color.ordinal() << 3 ) | ( this.lumen ? 0x80 : 0x00 ); + final int val = this.side.ordinal() | ( this.color.ordinal() << 3 ) | ( this.lumen ? 0x80 : 0x00 ); return Math.abs( this.pos + val ); } } diff --git a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java index a5982a09..44d7d57a 100644 --- a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java +++ b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java @@ -66,7 +66,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II double myRange = Double.MAX_VALUE; private final int inventorySlot; - public WirelessTerminalGuiObject( IWirelessTermHandler wh, ItemStack is, EntityPlayer ep, World w, int x, int y, int z ) + public WirelessTerminalGuiObject( final IWirelessTermHandler wh, final ItemStack is, final EntityPlayer ep, final World w, final int x, final int y, final int z ) { this.encryptionKey = wh.getEncryptionKey( is ); this.effectiveItem = is; @@ -78,17 +78,17 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II try { - long encKey = Long.parseLong( this.encryptionKey ); + final long encKey = Long.parseLong( this.encryptionKey ); obj = AEApi.instance().registries().locatable().getLocatableBy( encKey ); } - catch( NumberFormatException err ) + catch( final NumberFormatException err ) { // :P } if( obj instanceof IGridHost ) { - IGridNode n = ( (IGridHost) obj ).getGridNode( AEPartLocation.INTERNAL ); + final IGridNode n = ( (IGridHost) obj ).getGridNode( AEPartLocation.INTERNAL ); if( n != null ) { this.targetGrid = n.getGrid(); @@ -130,7 +130,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { if( this.itemStorage != null ) { @@ -139,7 +139,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver l ) { if( this.itemStorage != null ) { @@ -148,7 +148,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { if( this.itemStorage != null ) { @@ -178,7 +178,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { if( this.itemStorage != null ) { @@ -188,7 +188,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { if( this.itemStorage != null ) { @@ -218,13 +218,13 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return this.itemStorage.validForPass( i ); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { if( this.itemStorage != null ) { @@ -234,7 +234,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( this.itemStorage != null ) { @@ -254,7 +254,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier ) + public double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier usePowerMultiplier ) { if( this.wth != null && this.effectiveItem != null ) { @@ -280,13 +280,13 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II } @Override - public IGridNode getGridNode( AEPartLocation dir ) + public IGridNode getGridNode( final AEPartLocation dir ) { return this.getActionableNode(); } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.NONE; } @@ -326,13 +326,13 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II return false; } - IMachineSet tw = this.targetGrid.getMachines( TileWireless.class ); + final IMachineSet tw = this.targetGrid.getMachines( TileWireless.class ); this.myWap = null; - for( IGridNode n : tw ) + for( final IGridNode n : tw ) { - IWirelessAccessPoint wap = (IWirelessAccessPoint) n.getMachine(); + final IWirelessAccessPoint wap = (IWirelessAccessPoint) n.getMachine(); if( this.testWap( wap ) ) { this.myWap = wap; @@ -344,20 +344,20 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II return false; } - private boolean testWap( IWirelessAccessPoint wap ) + private boolean testWap( final IWirelessAccessPoint wap ) { double rangeLimit = wap.getRange(); rangeLimit *= rangeLimit; - DimensionalCoord dc = wap.getLocation(); + final DimensionalCoord dc = wap.getLocation(); if( dc.getWorld() == this.myPlayer.worldObj ) { - double offX = dc.x - this.myPlayer.posX; - double offY = dc.y - this.myPlayer.posY; - double offZ = dc.z - this.myPlayer.posZ; + final double offX = dc.x - this.myPlayer.posX; + final double offY = dc.y - this.myPlayer.posY; + final double offZ = dc.z - this.myPlayer.posZ; - double r = offX * offX + offY * offY + offZ * offZ; + final double r = offX * offX + offY * offY + offZ * offZ; if( r < rangeLimit && this.sqRange > r ) { if( wap.isActive() ) diff --git a/src/main/java/appeng/hooks/CompassManager.java b/src/main/java/appeng/hooks/CompassManager.java index f99034e9..9b26f549 100644 --- a/src/main/java/appeng/hooks/CompassManager.java +++ b/src/main/java/appeng/hooks/CompassManager.java @@ -32,28 +32,28 @@ public class CompassManager public static final CompassManager INSTANCE = new CompassManager(); final HashMap requests = new HashMap(); - public void postResult( long attunement, int x, int y, int z, CompassResult result ) + public void postResult( final long attunement, final int x, final int y, final int z, final CompassResult result ) { - CompassRequest r = new CompassRequest( attunement, x, y, z ); + final CompassRequest r = new CompassRequest( attunement, x, y, z ); this.requests.put( r, result ); } - public CompassResult getCompassDirection( long attunement, int x, int y, int z ) + public CompassResult getCompassDirection( final long attunement, final int x, final int y, final int z ) { - long now = System.currentTimeMillis(); + final long now = System.currentTimeMillis(); - Iterator i = this.requests.values().iterator(); + final Iterator i = this.requests.values().iterator(); while( i.hasNext() ) { - CompassResult res = i.next(); - long diff = now - res.time; + final CompassResult res = i.next(); + final long diff = now - res.time; if( diff > 20000 ) { i.remove(); } } - CompassRequest r = new CompassRequest( attunement, x, y, z ); + final CompassRequest r = new CompassRequest( attunement, x, y, z ); CompassResult res = this.requests.get( r ); if( res == null ) @@ -74,7 +74,7 @@ public class CompassManager return res; } - private void requestUpdate( CompassRequest r ) + private void requestUpdate( final CompassRequest r ) { NetworkHandler.instance.sendToServer( new PacketCompassRequest( r.attunement, r.cx, r.cz, r.cdy ) ); } @@ -89,7 +89,7 @@ public class CompassManager final int cdy; final int cz; - public CompassRequest( long attunement, int x, int y, int z ) + public CompassRequest( final long attunement, final int x, final int y, final int z ) { this.attunement = attunement; this.cx = x >> 4; @@ -105,7 +105,7 @@ public class CompassManager } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -115,7 +115,7 @@ public class CompassManager { return false; } - CompassRequest other = (CompassRequest) obj; + final CompassRequest other = (CompassRequest) obj; return this.attunement == other.attunement && this.cx == other.cx && this.cdy == other.cdy && this.cz == other.cz; } } diff --git a/src/main/java/appeng/hooks/CompassResult.java b/src/main/java/appeng/hooks/CompassResult.java index ead5e082..89f047d4 100644 --- a/src/main/java/appeng/hooks/CompassResult.java +++ b/src/main/java/appeng/hooks/CompassResult.java @@ -29,7 +29,7 @@ public class CompassResult public boolean requested = false; - public CompassResult( boolean hasResult, boolean spin, double rad ) + public CompassResult( final boolean hasResult, final boolean spin, final double rad ) { this.hasResult = hasResult; this.spin = spin; diff --git a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java index 66082b20..ce323696 100644 --- a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java +++ b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java @@ -32,14 +32,14 @@ public final class DispenserBehaviorTinyTNT extends BehaviorDefaultDispenseItem { @Override - protected ItemStack dispenseStack( IBlockSource dispenser, ItemStack dispensedItem ) + protected ItemStack dispenseStack( final IBlockSource dispenser, final ItemStack dispensedItem ) { - EnumFacing enumfacing = BlockDispenser.getFacing( dispenser.getBlockMetadata() ); - World world = dispenser.getWorld(); - int i = dispenser.getBlockPos().getX() + enumfacing.getFrontOffsetX(); - int j = dispenser.getBlockPos().getY() + enumfacing.getFrontOffsetY(); - int k = dispenser.getBlockPos().getZ() + enumfacing.getFrontOffsetZ(); - EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( world, i + 0.5F, j + 0.5F, k + 0.5F, null ); + final EnumFacing enumfacing = BlockDispenser.getFacing( dispenser.getBlockMetadata() ); + final World world = dispenser.getWorld(); + final int i = dispenser.getBlockPos().getX() + enumfacing.getFrontOffsetX(); + final int j = dispenser.getBlockPos().getY() + enumfacing.getFrontOffsetY(); + final int k = dispenser.getBlockPos().getZ() + enumfacing.getFrontOffsetZ(); + final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( world, i + 0.5F, j + 0.5F, k + 0.5F, null ); world.spawnEntityInWorld( primedTinyTNTEntity ); --dispensedItem.stackSize; return dispensedItem; diff --git a/src/main/java/appeng/hooks/DispenserBlockTool.java b/src/main/java/appeng/hooks/DispenserBlockTool.java index 3a80229b..a8b9601c 100644 --- a/src/main/java/appeng/hooks/DispenserBlockTool.java +++ b/src/main/java/appeng/hooks/DispenserBlockTool.java @@ -34,15 +34,15 @@ public final class DispenserBlockTool extends BehaviorDefaultDispenseItem { @Override - protected ItemStack dispenseStack( IBlockSource dispenser, ItemStack dispensedItem ) + protected ItemStack dispenseStack( final IBlockSource dispenser, final ItemStack dispensedItem ) { - Item i = dispensedItem.getItem(); + final Item i = dispensedItem.getItem(); if( i instanceof IBlockTool ) { - EnumFacing enumfacing = BlockDispenser.getFacing( dispenser.getBlockMetadata() ); - IBlockTool tm = (IBlockTool) i; + final EnumFacing enumfacing = BlockDispenser.getFacing( dispenser.getBlockMetadata() ); + final IBlockTool tm = (IBlockTool) i; - World w = dispenser.getWorld(); + final World w = dispenser.getWorld(); if( w instanceof WorldServer ) { tm.onItemUse( dispensedItem, Platform.getPlayer( (WorldServer) w ), w, dispenser.getBlockPos().offset( enumfacing ), enumfacing, 0.5f, 0.5f, 0.5f ); diff --git a/src/main/java/appeng/hooks/DispenserMatterCannon.java b/src/main/java/appeng/hooks/DispenserMatterCannon.java index e85d47ed..0ed31b16 100644 --- a/src/main/java/appeng/hooks/DispenserMatterCannon.java +++ b/src/main/java/appeng/hooks/DispenserMatterCannon.java @@ -37,14 +37,14 @@ public final class DispenserMatterCannon extends BehaviorDefaultDispenseItem { @Override - protected ItemStack dispenseStack( IBlockSource dispenser, ItemStack dispensedItem ) + protected ItemStack dispenseStack( final IBlockSource dispenser, ItemStack dispensedItem ) { - Item i = dispensedItem.getItem(); + final Item i = dispensedItem.getItem(); if( i instanceof ToolMassCannon ) { - EnumFacing enumfacing = BlockDispenser.getFacing( dispenser.getBlockMetadata() ); + final EnumFacing enumfacing = BlockDispenser.getFacing( dispenser.getBlockMetadata() ); AEPartLocation dir = AEPartLocation.INTERNAL; - for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) { if( enumfacing.getFrontOffsetX() == d.xOffset && enumfacing.getFrontOffsetY() == d.yOffset && enumfacing.getFrontOffsetZ() == d.zOffset ) { @@ -52,12 +52,12 @@ public final class DispenserMatterCannon extends BehaviorDefaultDispenseItem } } - ToolMassCannon tm = (ToolMassCannon) i; + final ToolMassCannon tm = (ToolMassCannon) i; - World w = dispenser.getWorld(); + final World w = dispenser.getWorld(); if( w instanceof WorldServer ) { - EntityPlayer p = Platform.getPlayer( (WorldServer) w ); + final EntityPlayer p = Platform.getPlayer( (WorldServer) w ); Platform.configurePlayer( p, dir, dispenser.getBlockTileEntity() ); p.posX += dir.xOffset; diff --git a/src/main/java/appeng/hooks/TickHandler.java b/src/main/java/appeng/hooks/TickHandler.java index 0cf6c434..98856eb2 100644 --- a/src/main/java/appeng/hooks/TickHandler.java +++ b/src/main/java/appeng/hooks/TickHandler.java @@ -77,7 +77,7 @@ public class TickHandler return this.cliPlayerColors; } - public void addCallable( World w, IWorldCallable c ) + public void addCallable( final World w, final IWorldCallable c ) { if( w == null ) { @@ -97,7 +97,7 @@ public class TickHandler } } - public void addInit( AEBaseTile tile ) + public void addInit( final AEBaseTile tile ) { if( Platform.isServer() ) // for no there is no reason to care about this on the client... { @@ -114,7 +114,7 @@ public class TickHandler return this.client; } - public void addNetwork( Grid grid ) + public void addNetwork( final Grid grid ) { if( Platform.isServer() ) // for no there is no reason to care about this on the client... { @@ -122,7 +122,7 @@ public class TickHandler } } - public void removeNetwork( Grid grid ) + public void removeNetwork( final Grid grid ) { if( Platform.isServer() ) // for no there is no reason to care about this on the client... { @@ -141,15 +141,15 @@ public class TickHandler } @SubscribeEvent - public void unloadWorld( WorldEvent.Unload ev ) + public void unloadWorld( final WorldEvent.Unload ev ) { if( Platform.isServer() ) // for no there is no reason to care about this on the client... { - LinkedList toDestroy = new LinkedList(); + final LinkedList toDestroy = new LinkedList(); - for( Grid g : this.getRepo().networks ) + for( final Grid g : this.getRepo().networks ) { - for( IGridNode n : g.getNodes() ) + for( final IGridNode n : g.getNodes() ) { if( n.getWorld() == ev.world ) { @@ -158,7 +158,7 @@ public class TickHandler } } - for( IGridNode n : toDestroy ) + for( final IGridNode n : toDestroy ) { n.destroy(); } @@ -166,9 +166,9 @@ public class TickHandler } @SubscribeEvent - public void onChunkLoad( ChunkEvent.Load load ) + public void onChunkLoad( final ChunkEvent.Load load ) { - for( Object te : load.getChunk().getTileEntityMap().values() ) + for( final Object te : load.getChunk().getTileEntityMap().values() ) { if( te instanceof AEBaseTile ) { @@ -178,13 +178,13 @@ public class TickHandler } @SubscribeEvent - public void onTick( TickEvent ev ) + public void onTick( final TickEvent ev ) { if( ev.type == Type.CLIENT && ev.phase == Phase.START ) { this.tickColors( this.cliPlayerColors ); - CableRenderMode currentMode = AEApi.instance().partHelper().getCableRenderMode(); + final CableRenderMode currentMode = AEApi.instance().partHelper().getCableRenderMode(); if( currentMode != this.crm ) { this.crm = currentMode; @@ -194,17 +194,17 @@ public class TickHandler if( ev.type == Type.WORLD && ev.phase == Phase.END ) { - WorldTickEvent wte = (WorldTickEvent) ev; + final WorldTickEvent wte = (WorldTickEvent) ev; synchronized( this.craftingJobs ) { - Collection jobSet = this.craftingJobs.get( wte.world ); + final Collection jobSet = this.craftingJobs.get( wte.world ); if( !jobSet.isEmpty() ) { - int simTime = Math.max( 1, AEConfig.instance.craftingCalculationTimePerTick / jobSet.size() ); - Iterator i = jobSet.iterator(); + final int simTime = Math.max( 1, AEConfig.instance.craftingCalculationTimePerTick / jobSet.size() ); + final Iterator i = jobSet.iterator(); while( i.hasNext() ) { - CraftingJob cj = i.next(); + final CraftingJob cj = i.next(); if( !cj.simulateFor( simTime ) ) { i.remove(); @@ -219,10 +219,10 @@ public class TickHandler { this.tickColors( this.srvPlayerColors ); // ready tiles. - HandlerRep repo = this.getRepo(); + final HandlerRep repo = this.getRepo(); while( !repo.tiles.isEmpty() ) { - AEBaseTile bt = repo.tiles.poll(); + final AEBaseTile bt = repo.tiles.poll(); if( !bt.isInvalid() ) { bt.onReady(); @@ -230,7 +230,7 @@ public class TickHandler } // tick networks. - for( Grid g : this.getRepo().networks ) + for( final Grid g : this.getRepo().networks ) { g.update(); } @@ -248,12 +248,12 @@ public class TickHandler } } - private void tickColors( HashMap playerSet ) + private void tickColors( final HashMap playerSet ) { - Iterator i = playerSet.values().iterator(); + final Iterator i = playerSet.values().iterator(); while( i.hasNext() ) { - PlayerColor pc = i.next(); + final PlayerColor pc = i.next(); if( pc.ticksLeft <= 0 ) { i.remove(); @@ -262,14 +262,14 @@ public class TickHandler } } - private void processQueue( Queue> queue, World world ) + private void processQueue( final Queue> queue, final World world ) { if( queue == null ) { return; } - Stopwatch sw = Stopwatch.createStarted(); + final Stopwatch sw = Stopwatch.createStarted(); IWorldCallable c = null; while( ( c = queue.poll() ) != null ) @@ -283,7 +283,7 @@ public class TickHandler break; } } - catch( Exception e ) + catch( final Exception e ) { AELog.error( e ); } @@ -294,7 +294,7 @@ public class TickHandler // AELog.info( "processQueue Time: " + time + "ms" ); } - public void registerCraftingSimulation( World world, CraftingJob craftingJob ) + public void registerCraftingSimulation( final World world, final CraftingJob craftingJob ) { synchronized( this.craftingJobs ) { @@ -324,7 +324,7 @@ public class TickHandler protected final int myEntity; protected int ticksLeft; - public PlayerColor( int id, AEColor col, int ticks ) + public PlayerColor( final int id, final AEColor col, final int ticks ) { this.myEntity = id; this.myColor = col; diff --git a/src/main/java/appeng/integration/IntegrationHelper.java b/src/main/java/appeng/integration/IntegrationHelper.java index 31d078c7..783bbd48 100644 --- a/src/main/java/appeng/integration/IntegrationHelper.java +++ b/src/main/java/appeng/integration/IntegrationHelper.java @@ -22,7 +22,7 @@ package appeng.integration; public class IntegrationHelper { - public static void testClassExistence( Object o, Class clz ) + public static void testClassExistence( final Object o, final Class clz ) { clz.isInstance( o ); } diff --git a/src/main/java/appeng/integration/IntegrationNode.java b/src/main/java/appeng/integration/IntegrationNode.java index faacb1ff..c19ef32d 100644 --- a/src/main/java/appeng/integration/IntegrationNode.java +++ b/src/main/java/appeng/integration/IntegrationNode.java @@ -42,7 +42,7 @@ public final class IntegrationNode Object instance; IIntegrationModule mod = null; - public IntegrationNode( String displayName, String modID, IntegrationType shortName, String name ) + public IntegrationNode( final String displayName, final String modID, final IntegrationType shortName, final String name ) { this.displayName = displayName; this.shortName = shortName; @@ -66,7 +66,7 @@ public final class IntegrationNode return this.state != IntegrationStage.FAILED; } - void call( IntegrationStage stage ) + void call( final IntegrationStage stage ) { if( this.state != IntegrationStage.FAILED ) { @@ -84,7 +84,7 @@ public final class IntegrationNode boolean enabled = this.modID == null || Loader.isModLoaded( this.modID ) || apiManager.hasAPI( this.modID ); AEConfig.instance.addCustomCategoryComment( "ModIntegration", "Valid Values are 'AUTO', 'ON', or 'OFF' - defaults to 'AUTO' ; Suggested that you leave this alone unless your experiencing an issue, or wish to disable the integration for a reason." ); - String mode = AEConfig.instance.get( "ModIntegration", this.displayName.replace( " ", "" ), "AUTO" ).getString(); + final String mode = AEConfig.instance.get( "ModIntegration", this.displayName.replace( " ", "" ), "AUTO" ).getString(); if( mode.toUpperCase().equals( "ON" ) ) { @@ -99,7 +99,7 @@ public final class IntegrationNode { this.classValue = this.getClass().getClassLoader().loadClass( this.name ); this.mod = (IIntegrationModule) this.classValue.getConstructor().newInstance(); - Field f = this.classValue.getField( "instance" ); + final Field f = this.classValue.getField( "instance" ); f.set( this.classValue, this.instance = this.mod ); } else @@ -125,7 +125,7 @@ public final class IntegrationNode break; } } - catch( Throwable t ) + catch( final Throwable t ) { this.failedStage = stage; this.exception = t; diff --git a/src/main/java/appeng/integration/IntegrationRegistry.java b/src/main/java/appeng/integration/IntegrationRegistry.java index bfca58de..2bbd9b15 100644 --- a/src/main/java/appeng/integration/IntegrationRegistry.java +++ b/src/main/java/appeng/integration/IntegrationRegistry.java @@ -36,7 +36,7 @@ public enum IntegrationRegistry private final Collection modules = new LinkedList(); - public void add( IntegrationType type ) + public void add( final IntegrationType type ) { if( type.side == IntegrationSide.CLIENT && FMLLaunchHandler.side() == Side.SERVER ) { @@ -53,12 +53,12 @@ public enum IntegrationRegistry public void init() { - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { node.call( IntegrationStage.PRE_INIT ); } - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { node.call( IntegrationStage.INIT ); } @@ -66,7 +66,7 @@ public enum IntegrationRegistry public void postInit() { - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { node.call( IntegrationStage.POST_INIT ); } @@ -76,7 +76,7 @@ public enum IntegrationRegistry { final StringBuilder builder = new StringBuilder( this.modules.size() * 3 ); - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { if( builder.length() != 0 ) { @@ -90,9 +90,9 @@ public enum IntegrationRegistry return builder.toString(); } - public boolean isEnabled( IntegrationType name ) + public boolean isEnabled( final IntegrationType name ) { - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { if( node.shortName == name ) { @@ -103,9 +103,9 @@ public enum IntegrationRegistry } @Nonnull - public Object getInstance( IntegrationType name ) + public Object getInstance( final IntegrationType name ) { - for( IntegrationNode node : this.modules ) + for( final IntegrationNode node : this.modules ) { if( node.shortName == name && node.isActive() ) { diff --git a/src/main/java/appeng/integration/IntegrationType.java b/src/main/java/appeng/integration/IntegrationType.java index 8214e616..3207a243 100644 --- a/src/main/java/appeng/integration/IntegrationType.java +++ b/src/main/java/appeng/integration/IntegrationType.java @@ -71,7 +71,7 @@ public enum IntegrationType public final String dspName; public final String modID; - IntegrationType( IntegrationSide side, String name, String modid ) + IntegrationType( final IntegrationSide side, final String name, final String modid ) { this.side = side; this.dspName = name; diff --git a/src/main/java/appeng/items/AEBaseItem.java b/src/main/java/appeng/items/AEBaseItem.java index 513bf11c..d5fe66c5 100644 --- a/src/main/java/appeng/items/AEBaseItem.java +++ b/src/main/java/appeng/items/AEBaseItem.java @@ -54,7 +54,7 @@ public abstract class AEBaseItem extends Item implements IAEFeature this.setNoRepair(); } - public AEBaseItem( Optional subName ) + public AEBaseItem( final Optional subName ) { this.subName = subName; this.fullName = new FeatureNameExtractor( this.getClass(), subName ).get(); @@ -78,32 +78,32 @@ public abstract class AEBaseItem extends Item implements IAEFeature // override! } - public void setFeature( EnumSet f ) + public void setFeature( final EnumSet f ) { this.feature = new ItemFeatureHandler( f, this, this, this.subName ); } @Override @SuppressWarnings( "unchecked" ) - public final void addInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public final void addInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { this.addCheckedInformation( stack, player, lines, displayMoreInfo ); } @Override @SuppressWarnings( "unchecked" ) - public final void getSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + public final void getSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { this.getCheckedSubItems( sameItem, creativeTab, itemStacks ); } @Override - public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 ) + public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack itemstack2 ) { return false; } - protected void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + protected void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addInformation( stack, player, lines, displayMoreInfo ); } @@ -113,25 +113,25 @@ public abstract class AEBaseItem extends Item implements IAEFeature @SideOnly(Side.CLIENT) public void registerIcons( - ClientHelper proxy, String name ) + final ClientHelper proxy, final String name ) { proxy.setIcon( this, 0, name ); } public IAESprite getIcon( - ItemStack is ) + final ItemStack is ) { return myIcon; } @SideOnly(Side.CLIENT) public void registerCustomIcon( - TextureMap map ) + final TextureMap map ) { } - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { super.getSubItems( sameItem, creativeTab, itemStacks ); } diff --git a/src/main/java/appeng/items/contents/CellConfig.java b/src/main/java/appeng/items/contents/CellConfig.java index 647efbe2..afb4d93b 100644 --- a/src/main/java/appeng/items/contents/CellConfig.java +++ b/src/main/java/appeng/items/contents/CellConfig.java @@ -29,7 +29,7 @@ public class CellConfig extends AppEngInternalInventory final ItemStack is; - public CellConfig( ItemStack is ) + public CellConfig( final ItemStack is ) { super( null, 63 ); this.is = is; diff --git a/src/main/java/appeng/items/contents/CellUpgrades.java b/src/main/java/appeng/items/contents/CellUpgrades.java index e6f4d71b..a830dc99 100644 --- a/src/main/java/appeng/items/contents/CellUpgrades.java +++ b/src/main/java/appeng/items/contents/CellUpgrades.java @@ -28,7 +28,7 @@ public final class CellUpgrades extends StackUpgradeInventory { final ItemStack is; - public CellUpgrades( ItemStack is, int upgrades ) + public CellUpgrades( final ItemStack is, final int upgrades ) { super( is, null, upgrades ); this.is = is; diff --git a/src/main/java/appeng/items/contents/NetworkToolViewer.java b/src/main/java/appeng/items/contents/NetworkToolViewer.java index be326eb2..6376eea6 100644 --- a/src/main/java/appeng/items/contents/NetworkToolViewer.java +++ b/src/main/java/appeng/items/contents/NetworkToolViewer.java @@ -36,7 +36,7 @@ public class NetworkToolViewer implements INetworkTool final ItemStack is; final IGridHost gh; - public NetworkToolViewer( ItemStack is, IGridHost gHost ) + public NetworkToolViewer( final ItemStack is, final IGridHost gHost ) { this.is = is; this.gh = gHost; @@ -54,25 +54,25 @@ public class NetworkToolViewer implements INetworkTool } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.inv.getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return this.inv.decrStackSize( i, j ); } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return this.inv.getStackInSlotOnClosing( i ); } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { this.inv.setInventorySlotContents( i, itemstack ); } @@ -103,25 +103,25 @@ public class NetworkToolViewer implements INetworkTool } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return this.inv.isUseableByPlayer( entityplayer ); } @Override - public void openInventory(EntityPlayer player) + public void openInventory( final EntityPlayer player) { this.inv.openInventory(player); } @Override - public void closeInventory(EntityPlayer player) + public void closeInventory( final EntityPlayer player) { this.inv.closeInventory(player); } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return this.inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule && ( (IUpgradeModule) itemstack.getItem() ).getType( itemstack ) != null; } @@ -140,15 +140,15 @@ public class NetworkToolViewer implements INetworkTool @Override public int getField( - int id ) + final int id ) { return inv.getField( id ); } @Override public void setField( - int id, - int value ) + final int id, + final int value ) { inv.setField( id, value ); } diff --git a/src/main/java/appeng/items/contents/PortableCellViewer.java b/src/main/java/appeng/items/contents/PortableCellViewer.java index 34694e08..7b8b6656 100644 --- a/src/main/java/appeng/items/contents/PortableCellViewer.java +++ b/src/main/java/appeng/items/contents/PortableCellViewer.java @@ -48,7 +48,7 @@ public class PortableCellViewer extends MEMonitorHandler implement private final IAEItemPowerStorage ips; private final int inventorySlot; - public PortableCellViewer( ItemStack is, int slot ) + public PortableCellViewer( final ItemStack is, final int slot ) { super( CellInventory.getCell( is, null ) ); this.ips = (IAEItemPowerStorage) is.getItem(); @@ -69,7 +69,7 @@ public class PortableCellViewer extends MEMonitorHandler implement } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier ) + public double extractAEPower( double amt, final Actionable mode, final PowerMultiplier usePowerMultiplier ) { amt = usePowerMultiplier.multiply( amt ); @@ -100,9 +100,9 @@ public class PortableCellViewer extends MEMonitorHandler implement { @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { - NBTTagCompound data = Platform.openNbtData( PortableCellViewer.this.target ); + final NBTTagCompound data = Platform.openNbtData( PortableCellViewer.this.target ); manager.writeToNBT( data ); } } ); diff --git a/src/main/java/appeng/items/contents/QuartzKnifeObj.java b/src/main/java/appeng/items/contents/QuartzKnifeObj.java index 710cc20d..380e42ab 100644 --- a/src/main/java/appeng/items/contents/QuartzKnifeObj.java +++ b/src/main/java/appeng/items/contents/QuartzKnifeObj.java @@ -28,7 +28,7 @@ public class QuartzKnifeObj implements IGuiItemObject final ItemStack is; - public QuartzKnifeObj( ItemStack o ) + public QuartzKnifeObj( final ItemStack o ) { this.is = o; } diff --git a/src/main/java/appeng/items/materials/MaterialType.java b/src/main/java/appeng/items/materials/MaterialType.java index 522344e3..c80e414a 100644 --- a/src/main/java/appeng/items/materials/MaterialType.java +++ b/src/main/java/appeng/items/materials/MaterialType.java @@ -94,19 +94,19 @@ public enum MaterialType private Class droppedEntity; private boolean isRegistered = false; - MaterialType( int metaValue ) + MaterialType( final int metaValue ) { this.damageValue = metaValue; this.features = EnumSet.of( AEFeature.Core ); } - MaterialType( int metaValue, AEFeature part ) + MaterialType( final int metaValue, final AEFeature part ) { this.damageValue = metaValue; this.features = EnumSet.of( part ); } - MaterialType( int metaValue, AEFeature part, Class c ) + MaterialType( final int metaValue, final AEFeature part, final Class c ) { this.features = EnumSet.of( part ); this.damageValue = metaValue; @@ -115,7 +115,7 @@ public enum MaterialType EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true ); } - MaterialType( int metaValue, AEFeature part, String oreDictionary, Class c ) + MaterialType( final int metaValue, final AEFeature part, final String oreDictionary, final Class c ) { this.features = EnumSet.of( part ); this.damageValue = metaValue; @@ -124,14 +124,14 @@ public enum MaterialType EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true ); } - MaterialType( int metaValue, AEFeature part, String oreDictionary ) + MaterialType( final int metaValue, final AEFeature part, final String oreDictionary ) { this.features = EnumSet.of( part ); this.damageValue = metaValue; this.oreName = oreDictionary; } - public ItemStack stack( int size ) + public ItemStack stack( final int size ) { return new ItemStack( this.itemInstance, size, this.damageValue ); } diff --git a/src/main/java/appeng/items/materials/MultiItem.java b/src/main/java/appeng/items/materials/MultiItem.java index e755434d..d4f2804e 100644 --- a/src/main/java/appeng/items/materials/MultiItem.java +++ b/src/main/java/appeng/items/materials/MultiItem.java @@ -84,11 +84,11 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); - MaterialType mt = this.getTypeByStack( stack ); + final MaterialType mt = this.getTypeByStack( stack ); if( mt == null ) { return; @@ -96,24 +96,24 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU if( mt == MaterialType.NamePress ) { - NBTTagCompound c = Platform.openNbtData( stack ); + final NBTTagCompound c = Platform.openNbtData( stack ); lines.add( c.getString( "InscribeName" ) ); } - Upgrades u = this.getType( stack ); + final Upgrades u = this.getType( stack ); if( u != null ) { - List textList = new LinkedList(); - for( Entry j : u.getSupported().entrySet() ) + final List textList = new LinkedList(); + for( final Entry j : u.getSupported().entrySet() ) { String name = null; - int limit = j.getValue(); + final int limit = j.getValue(); if( j.getKey().getItem() instanceof IItemGroup ) { - IItemGroup ig = (IItemGroup) j.getKey().getItem(); - String str = ig.getUnlocalizedGroupName( u.getSupported().keySet(), j.getKey() ); + final IItemGroup ig = (IItemGroup) j.getKey().getItem(); + final String str = ig.getUnlocalizedGroupName( u.getSupported().keySet(), j.getKey() ); if( str != null ) { name = Platform.gui_localize( str ) + ( limit > 1 ? " (" + limit + ')' : "" ); @@ -131,8 +131,8 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } } - Pattern p = Pattern.compile( "(\\d+)[^\\d]" ); - SlightlyBetterSort s = new SlightlyBetterSort( p ); + final Pattern p = Pattern.compile( "(\\d+)[^\\d]" ); + final SlightlyBetterSort s = new SlightlyBetterSort( p ); Collections.sort( textList, s ); lines.addAll( textList ); } @@ -140,9 +140,9 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU @Override @SideOnly( Side.CLIENT ) - public void registerIcons( ClientHelper proxy, String name ) + public void registerIcons( final ClientHelper proxy, final String name ) { - for( MaterialType type : MaterialType.values() ) + for( final MaterialType type : MaterialType.values() ) { if( type != MaterialType.InvalidType ) { @@ -151,7 +151,7 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } } - public MaterialType getTypeByStack( ItemStack is ) + public MaterialType getTypeByStack( final ItemStack is ) { if( this.dmgToMaterial.containsKey( is.getItemDamage() ) ) { @@ -161,7 +161,7 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } @Override - public Upgrades getType( ItemStack itemstack ) + public Upgrades getType( final ItemStack itemstack ) { switch( this.getTypeByStack( itemstack ) ) { @@ -182,13 +182,13 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } } - public IStackSrc createMaterial( MaterialType mat ) + public IStackSrc createMaterial( final MaterialType mat ) { Preconditions.checkState( !mat.isRegistered(), "Cannot create the same material twice." ); boolean enabled = true; - for( AEFeature f : mat.getFeature() ) + for( final AEFeature f : mat.getFeature() ) { enabled = enabled && AEConfig.instance.isFeatureEnabled( f ); } @@ -199,7 +199,7 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU { mat.itemInstance = this; mat.markReady(); - int newMaterialNum = mat.damageValue; + final int newMaterialNum = mat.damageValue; if( this.dmgToMaterial.get( newMaterialNum ) == null ) { @@ -217,25 +217,25 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU public void makeUnique() { - for( MaterialType mt : ImmutableSet.copyOf( this.dmgToMaterial.values() ) ) + for( final MaterialType mt : ImmutableSet.copyOf( this.dmgToMaterial.values() ) ) { if( mt.getOreName() != null ) { ItemStack replacement = null; - String[] names = mt.getOreName().split( "," ); + final String[] names = mt.getOreName().split( "," ); - for( String name : names ) + for( final String name : names ) { if( replacement != null ) { break; } - List options = OreDictionary.getOres( name ); + final List options = OreDictionary.getOres( name ); if( options != null && options.size() > 0 ) { - for( ItemStack is : options ) + for( final ItemStack is : options ) { if( is != null && is.getItem() != null ) { @@ -249,7 +249,7 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU if( replacement == null || AEConfig.instance.useAEVersion( mt ) ) { // continue using the AE2 item. - for( String name : names ) + for( final String name : names ) { OreDictionary.registerOre( name, mt.stack( 1 ) ); } @@ -269,26 +269,26 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { return "item.appliedenergistics2." + this.nameOf( is ); } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { - List types = Arrays.asList( MaterialType.values() ); + final List types = Arrays.asList( MaterialType.values() ); Collections.sort( types, new Comparator() { @Override - public int compare( MaterialType o1, MaterialType o2 ) + public int compare( final MaterialType o1, final MaterialType o2 ) { return o1.name().compareTo( o2.name() ); } } ); - for( MaterialType mat : types ) + for( final MaterialType mat : types ) { if( mat.damageValue >= 0 && mat.isRegistered() && mat.itemInstance == this ) { @@ -298,16 +298,16 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } @Override - public boolean onItemUseFirst( ItemStack is, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ ) + public boolean onItemUseFirst( final ItemStack is, final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ ) { if( player.isSneaking() ) { - TileEntity te = world.getTileEntity( pos ); + final TileEntity te = world.getTileEntity( pos ); IInventory upgrades = null; if( te instanceof IPartHost ) { - SelectedPart sp = ( (IPartHost) te ).selectPart( new Vec3( hitX, hitY, hitZ ) ); + final SelectedPart sp = ( (IPartHost) te ).selectPart( new Vec3( hitX, hitY, hitZ ) ); if( sp.part instanceof IUpgradeableHost ) { upgrades = ( (ISegmentedInventory) sp.part ).getInventoryByName( "upgrades" ); @@ -320,12 +320,12 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU if( upgrades != null && is != null && is.getItem() instanceof IUpgradeModule ) { - IUpgradeModule um = (IUpgradeModule) is.getItem(); - Upgrades u = um.getType( is ); + final IUpgradeModule um = (IUpgradeModule) is.getItem(); + final Upgrades u = um.getType( is ); if( u != null ) { - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( upgrades, EnumFacing.UP ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( upgrades, EnumFacing.UP ); if( ad != null ) { if( player.worldObj.isRemote ) @@ -344,22 +344,22 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } @Override - public boolean hasCustomEntity( ItemStack is ) + public boolean hasCustomEntity( final ItemStack is ) { return this.getTypeByStack( is ).hasCustomEntity(); } @Override - public Entity createEntity( World w, Entity location, ItemStack itemstack ) + public Entity createEntity( final World w, final Entity location, final ItemStack itemstack ) { - Class droppedEntity = this.getTypeByStack( itemstack ).getCustomEntityClass(); - Entity eqi; + final Class droppedEntity = this.getTypeByStack( itemstack ).getCustomEntityClass(); + final Entity eqi; try { eqi = droppedEntity.getConstructor( World.class, double.class, double.class, double.class, ItemStack.class ).newInstance( w, location.posX, location.posY, location.posZ, itemstack ); } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( t ); } @@ -378,14 +378,14 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU return eqi; } - private String nameOf( ItemStack is ) + private String nameOf( final ItemStack is ) { if( is == null ) { return "null"; } - MaterialType mt = this.getTypeByStack( is ); + final MaterialType mt = this.getTypeByStack( is ); if( mt == null ) { return "null"; @@ -395,7 +395,7 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } @Override - public int getBytes( ItemStack is ) + public int getBytes( final ItemStack is ) { switch( this.getTypeByStack( is ) ) { @@ -413,7 +413,7 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU } @Override - public boolean isStorageComponent( ItemStack is ) + public boolean isStorageComponent( final ItemStack is ) { switch( this.getTypeByStack( is ) ) { @@ -431,26 +431,26 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU { private final Pattern pattern; - public SlightlyBetterSort( Pattern pattern ) + public SlightlyBetterSort( final Pattern pattern ) { this.pattern = pattern; } @Override - public int compare( String o1, String o2 ) + public int compare( final String o1, final String o2 ) { try { - Matcher a = this.pattern.matcher( o1 ); - Matcher b = this.pattern.matcher( o2 ); + final Matcher a = this.pattern.matcher( o1 ); + final Matcher b = this.pattern.matcher( o2 ); if( a.find() && b.find() ) { - int ia = Integer.parseInt( a.group( 1 ) ); - int ib = Integer.parseInt( b.group( 1 ) ); + final int ia = Integer.parseInt( a.group( 1 ) ); + final int ib = Integer.parseInt( b.group( 1 ) ); return Integer.compare( ia, ib ); } } - catch( Throwable t ) + catch( final Throwable t ) { // ek! } diff --git a/src/main/java/appeng/items/misc/ItemCrystalSeed.java b/src/main/java/appeng/items/misc/ItemCrystalSeed.java index f146f7be..20ac0660 100644 --- a/src/main/java/appeng/items/misc/ItemCrystalSeed.java +++ b/src/main/java/appeng/items/misc/ItemCrystalSeed.java @@ -79,9 +79,9 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal @Override @SideOnly(Side.CLIENT) - public void registerIcons( ClientHelper ir, String name ) + public void registerIcons( final ClientHelper ir, final String name ) { - String preFix = name+"."; + final String preFix = name+"."; this.certus[0] = ir.setIcon( this, preFix + "Certus" ); this.certus[1] = ir.setIcon( this, preFix + "Certus2" ); @@ -99,7 +99,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal @Override public ModelResourceLocation getModelLocation( - ItemStack stack ) + final ItemStack stack ) { ModelResourceLocation[] list = null; @@ -143,7 +143,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } @Nullable - public static ResolverResult getResolver( int certus2 ) + public static ResolverResult getResolver( final int certus2 ) { ResolverResult resolver = null; @@ -157,13 +157,13 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal return resolver; } - private static ItemStack newStyle( ItemStack itemStack ) + private static ItemStack newStyle( final ItemStack itemStack ) { ( (ItemCrystalSeed) itemStack.getItem() ).getProgress( itemStack ); return itemStack; } - private int getProgress( ItemStack is ) + private int getProgress( final ItemStack is ) { if( is.hasTagCompound() ) { @@ -171,8 +171,8 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } else { - int progress; - NBTTagCompound comp = Platform.openNbtData( is ); + final int progress; + final NBTTagCompound comp = Platform.openNbtData( is ); comp.setInteger( "progress", progress = is.getItemDamage() ); is.setItemDamage( ( is.getItemDamage() / SINGLE_OFFSET ) * SINGLE_OFFSET ); return progress; @@ -181,29 +181,29 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal @Nullable @Override - public ItemStack triggerGrowth( ItemStack is ) + public ItemStack triggerGrowth( final ItemStack is ) { - int newDamage = this.getProgress( is ) + 1; + final int newDamage = this.getProgress( is ) + 1; final IMaterials materials = AEApi.instance().definitions().materials(); final int size = is.stackSize; if( newDamage == CERTUS + SINGLE_OFFSET ) { - for( ItemStack quartzStack : materials.purifiedCertusQuartzCrystal().maybeStack( size ).asSet() ) + for( final ItemStack quartzStack : materials.purifiedCertusQuartzCrystal().maybeStack( size ).asSet() ) { return quartzStack; } } if( newDamage == NETHER + SINGLE_OFFSET ) { - for( ItemStack quartzStack : materials.purifiedNetherQuartzCrystal().maybeStack( size ).asSet() ) + for( final ItemStack quartzStack : materials.purifiedNetherQuartzCrystal().maybeStack( size ).asSet() ) { return quartzStack; } } if( newDamage == FLUIX + SINGLE_OFFSET ) { - for( ItemStack quartzStack : materials.purifiedFluixCrystal().maybeStack( size ).asSet() ) + for( final ItemStack quartzStack : materials.purifiedFluixCrystal().maybeStack( size ).asSet() ) { return quartzStack; } @@ -217,39 +217,39 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal return is; } - private void setProgress( ItemStack is, int newDamage ) + private void setProgress( final ItemStack is, final int newDamage ) { - NBTTagCompound comp = Platform.openNbtData( is ); + final NBTTagCompound comp = Platform.openNbtData( is ); comp.setInteger( "progress", newDamage ); is.setItemDamage( is.getItemDamage() / LEVEL_OFFSET * LEVEL_OFFSET ); } @Override - public float getMultiplier( Block blk, Material mat ) + public float getMultiplier( final Block blk, final Material mat ) { return 0.5f; } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { lines.add( ButtonToolTips.DoesntDespawn.getLocal() ); - int progress = this.getProgress( stack ) % SINGLE_OFFSET; + final int progress = this.getProgress( stack ) % SINGLE_OFFSET; lines.add( Math.floor( (float) progress / (float) ( SINGLE_OFFSET / 100 ) ) + "%" ); super.addCheckedInformation( stack, player, lines, displayMoreInfo ); } @Override - public int getEntityLifespan( ItemStack itemStack, World world ) + public int getEntityLifespan( final ItemStack itemStack, final World world ) { return Integer.MAX_VALUE; } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { - int damage = this.getProgress( is ); + final int damage = this.getProgress( is ); if( damage < CERTUS + SINGLE_OFFSET ) { @@ -276,27 +276,27 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } @Override - public boolean isDamaged( ItemStack stack ) + public boolean isDamaged( final ItemStack stack ) { return false; } @Override - public int getMaxDamage( ItemStack stack ) + public int getMaxDamage( final ItemStack stack ) { return FINAL_STAGE; } @Override - public boolean hasCustomEntity( ItemStack stack ) + public boolean hasCustomEntity( final ItemStack stack ) { return true; } @Override - public Entity createEntity( World world, Entity location, ItemStack itemstack ) + public Entity createEntity( final World world, final Entity location, final ItemStack itemstack ) { - EntityGrowingCrystal egc = new EntityGrowingCrystal( world, location.posX, location.posY, location.posZ, itemstack ); + final EntityGrowingCrystal egc = new EntityGrowingCrystal( world, location.posX, location.posY, location.posZ, itemstack ); egc.motionX = location.motionX; egc.motionY = location.motionY; @@ -313,7 +313,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { // lvl 0 itemStacks.add( newStyle( new ItemStack( this, 1, CERTUS ) ) ); diff --git a/src/main/java/appeng/items/misc/ItemEncodedPattern.java b/src/main/java/appeng/items/misc/ItemEncodedPattern.java index 991424aa..83d58330 100644 --- a/src/main/java/appeng/items/misc/ItemEncodedPattern.java +++ b/src/main/java/appeng/items/misc/ItemEncodedPattern.java @@ -68,8 +68,8 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt @Override public void registerIcons( - ClientHelper proxy, - String name ) + final ClientHelper proxy, + final String name ) { encodedPatternModel = res = proxy.setIcon( this, name ); @@ -79,15 +79,15 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt @Override public ModelResourceLocation getModelLocation( - ItemStack stack ) + final ItemStack stack ) { if ( recursive == false ) { this.recursive = true; - ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem(); + final ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem(); - ItemStack is = iep.getOutput( stack ); + final ItemStack is = iep.getOutput( stack ); if ( Minecraft.getMinecraft().thePlayer.isSneaking() ) { return encodedPatternModel; @@ -103,7 +103,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt } @Override - public ItemStack onItemRightClick( ItemStack stack, World w, EntityPlayer player ) + public ItemStack onItemRightClick( final ItemStack stack, final World w, final EntityPlayer player ) { this.clearPattern( stack, player ); @@ -112,19 +112,19 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt @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 ) { return this.clearPattern( stack, player ); } - private boolean clearPattern( ItemStack stack, EntityPlayer player ) + private boolean clearPattern( final ItemStack stack, final EntityPlayer player ) { if( player.isSneaking() ) { @@ -133,13 +133,13 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt return false; } - InventoryPlayer inv = player.inventory; + final InventoryPlayer inv = player.inventory; for( int s = 0; s < player.inventory.getSizeInventory(); s++ ) { if( inv.getStackInSlot( s ) == stack ) { - for( ItemStack blankPattern : AEApi.instance().definitions().materials().blankPattern().maybeStack( stack.stackSize ).asSet() ) + for( final ItemStack blankPattern : AEApi.instance().definitions().materials().blankPattern().maybeStack( stack.stackSize ).asSet() ) { inv.setInventorySlotContents( s, blankPattern ); } @@ -153,9 +153,9 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - ICraftingPatternDetails details = this.getPatternForItem( stack, player.worldObj ); + final ICraftingPatternDetails details = this.getPatternForItem( stack, player.worldObj ); if( details == null ) { @@ -163,17 +163,17 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt return; } - boolean isCrafting = details.isCraftable(); + final boolean isCrafting = details.isCraftable(); - IAEItemStack[] in = details.getCondensedInputs(); - IAEItemStack[] out = details.getCondensedOutputs(); + final IAEItemStack[] in = details.getCondensedInputs(); + final IAEItemStack[] out = details.getCondensedOutputs(); - String label = ( isCrafting ? GuiText.Crafts.getLocal() : GuiText.Creates.getLocal() ) + ": "; - String and = ' ' + GuiText.And.getLocal() + ' '; - String with = GuiText.With.getLocal() + ": "; + final String label = ( isCrafting ? GuiText.Crafts.getLocal() : GuiText.Creates.getLocal() ) + ": "; + final String and = ' ' + GuiText.And.getLocal() + ' '; + final String with = GuiText.With.getLocal() + ": "; boolean first = true; - for( IAEItemStack anOut : out ) + for( final IAEItemStack anOut : out ) { if( anOut == null ) { @@ -185,7 +185,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt } first = true; - for( IAEItemStack anIn : in ) + for( final IAEItemStack anIn : in ) { if( anIn == null ) { @@ -198,19 +198,19 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt } @Override - public ICraftingPatternDetails getPatternForItem( ItemStack is, World w ) + public ICraftingPatternDetails getPatternForItem( final ItemStack is, final World w ) { try { return new PatternHelper( is, w ); } - catch( Throwable t ) + catch( final Throwable t ) { return null; } } - public ItemStack getOutput( ItemStack item ) + public ItemStack getOutput( final ItemStack item ) { ItemStack out = SIMPLE_CACHE.get( item ); if( out != null ) @@ -218,13 +218,13 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt return out; } - World w = CommonHelper.proxy.getWorld(); + final World w = CommonHelper.proxy.getWorld(); if( w == null ) { return null; } - ICraftingPatternDetails details = this.getPatternForItem( item, w ); + final ICraftingPatternDetails details = this.getPatternForItem( item, w ); if( details == null ) { diff --git a/src/main/java/appeng/items/misc/ItemPaintBall.java b/src/main/java/appeng/items/misc/ItemPaintBall.java index dc0fc0ef..edd906da 100644 --- a/src/main/java/appeng/items/misc/ItemPaintBall.java +++ b/src/main/java/appeng/items/misc/ItemPaintBall.java @@ -50,7 +50,7 @@ public class ItemPaintBall extends AEBaseItem @Override @SideOnly(Side.CLIENT) - public void registerIcons( ClientHelper ir, String name ) + public void registerIcons( final ClientHelper ir, final String name ) { final ModelResourceLocation sloc = ir.setIcon( this, name + "Shimmer" ); final ModelResourceLocation loc = ir.setIcon( this, name ); @@ -60,7 +60,7 @@ public class ItemPaintBall extends AEBaseItem @Override public ModelResourceLocation getModelLocation( - ItemStack stack ) + final ItemStack stack ) { if ( isLumen(stack) ) return sloc; @@ -71,32 +71,32 @@ public class ItemPaintBall extends AEBaseItem } @Override - public String getItemStackDisplayName( ItemStack is ) + public String getItemStackDisplayName( final ItemStack is ) { return super.getItemStackDisplayName( is ) + " - " + this.getExtraName( is ); } - public String getExtraName( ItemStack is ) + public String getExtraName( final ItemStack is ) { return ( is.getItemDamage() >= DAMAGE_THRESHOLD ? GuiText.Lumen.getLocal() + ' ' : "" ) + this.getColor( is ); } @Override public int getColorFromItemStack( - ItemStack stack, - int renderPass ) + final ItemStack stack, + final int renderPass ) { - AEColor col = getColor(stack); + final AEColor col = getColor(stack); - int colorValue = stack.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant; - int r = ( colorValue >> 16 ) & 0xff; - int g = ( colorValue >> 8 ) & 0xff; - int b = ( colorValue ) & 0xff; + final int colorValue = stack.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant; + final int r = ( colorValue >> 16 ) & 0xff; + final int g = ( colorValue >> 8 ) & 0xff; + final int b = ( colorValue ) & 0xff; if( stack.getItemDamage() >= 20 ) { - float fail = 0.7f; - int full = (int) ( 255 * 0.3 ); + final float fail = 0.7f; + final int full = (int) ( 255 * 0.3 ); return (int)( full + r * fail ) << 16 | (int)( full + g * fail ) << 8 | (int)( full + b * fail ) | 0xff << 24; } else @@ -105,7 +105,7 @@ public class ItemPaintBall extends AEBaseItem } } - public AEColor getColor( ItemStack is ) + public AEColor getColor( final ItemStack is ) { int dmg = is.getItemDamage(); if( dmg >= DAMAGE_THRESHOLD ) @@ -122,9 +122,9 @@ public class ItemPaintBall extends AEBaseItem } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { - for( AEColor c : AEColor.values() ) + for( final AEColor c : AEColor.values() ) { if( c != AEColor.Transparent ) { @@ -132,7 +132,7 @@ public class ItemPaintBall extends AEBaseItem } } - for( AEColor c : AEColor.values() ) + for( final AEColor c : AEColor.values() ) { if( c != AEColor.Transparent ) { @@ -141,9 +141,9 @@ public class ItemPaintBall extends AEBaseItem } } - public boolean isLumen( ItemStack is ) + public boolean isLumen( final ItemStack is ) { - int dmg = is.getItemDamage(); + final int dmg = is.getItemDamage(); return dmg >= DAMAGE_THRESHOLD; } } diff --git a/src/main/java/appeng/items/parts/ItemFacade.java b/src/main/java/appeng/items/parts/ItemFacade.java index 7571bb3b..ccd34bf6 100644 --- a/src/main/java/appeng/items/parts/ItemFacade.java +++ b/src/main/java/appeng/items/parts/ItemFacade.java @@ -68,30 +68,30 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte @Override public boolean onItemUseFirst( - ItemStack is, - EntityPlayer player, - World world, - BlockPos pos, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final ItemStack is, + final EntityPlayer player, + final World world, + final BlockPos pos, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { return AEApi.instance().partHelper().placeBus( is, pos, side, player, world ); } @Override - public String getItemStackDisplayName( ItemStack is ) + public String getItemStackDisplayName( final ItemStack is ) { try { - ItemStack in = this.getTextureItem( is ); + final ItemStack in = this.getTextureItem( is ); if( in != null ) { return super.getItemStackDisplayName( is ) + " - " + in.getDisplayName(); } } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } @@ -100,7 +100,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { this.calculateSubTypes(); itemStacks.addAll( this.subTypes ); @@ -111,25 +111,25 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte if( this.subTypes == null ) { this.subTypes = new ArrayList( 1000 ); - for( Object blk : Block.blockRegistry ) + for( final Object blk : Block.blockRegistry ) { - Block b = (Block) blk; + final Block b = (Block) blk; try { - Item item = Item.getItemFromBlock( b ); + final Item item = Item.getItemFromBlock( b ); - List tmpList = new ArrayList( 100 ); + final List tmpList = new ArrayList( 100 ); b.getSubBlocks( item, b.getCreativeTabToDisplayOn(), tmpList ); - for( ItemStack l : tmpList ) + for( final ItemStack l : tmpList ) { - ItemStack facade = this.createFacadeForItem( l, false ); + final ItemStack facade = this.createFacadeForItem( l, false ); if( facade != null ) { this.subTypes.add( facade ); } } } - catch( Throwable t ) + catch( final Throwable t ) { // just absorb.. } @@ -142,26 +142,26 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } } - public ItemStack createFacadeForItem( ItemStack l, boolean returnItem ) + public ItemStack createFacadeForItem( final ItemStack l, final boolean returnItem ) { if( l == null ) { return null; } - Block b = Block.getBlockFromItem( l.getItem() ); + final Block b = Block.getBlockFromItem( l.getItem() ); if( b == null || l.hasTagCompound() ) { return null; } - int metadata = l.getItem().getMetadata( l.getItemDamage() ); + final int metadata = l.getItem().getMetadata( l.getItemDamage() ); - boolean hasTile = b.hasTileEntity( b.getStateFromMeta( metadata ) ); - boolean enableGlass = b instanceof BlockGlass || b instanceof BlockStainedGlass; - boolean disableOre = b instanceof QuartzOreBlock; + final boolean hasTile = b.hasTileEntity( b.getStateFromMeta( metadata ) ); + final boolean enableGlass = b instanceof BlockGlass || b instanceof BlockStainedGlass; + final boolean disableOre = b instanceof QuartzOreBlock; - boolean defaultValue = ( b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass; + final boolean defaultValue = ( b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass; if( FacadeConfig.instance.checkEnabled( b, metadata, defaultValue ) ) { if( returnItem ) @@ -169,13 +169,13 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte return l; } - ItemStack is = new ItemStack( this ); - NBTTagCompound data = new NBTTagCompound(); - int[] ds = new int[2]; + final ItemStack is = new ItemStack( this ); + final NBTTagCompound data = new NBTTagCompound(); + final int[] ds = new int[2]; ds[0] = Item.getIdFromItem( l.getItem() ); ds[1] = metadata; data.setIntArray( "x", ds ); - UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor( l.getItem() ); + final UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor( l.getItem() ); data.setString( "modid", ui.modId ); data.setString( "itemname", ui.name ); is.setTagCompound( data ); @@ -185,9 +185,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public FacadePart createPartFromItemStack( ItemStack is, AEPartLocation side ) + public FacadePart createPartFromItemStack( final ItemStack is, final AEPartLocation side ) { - ItemStack in = this.getTextureItem( is ); + final ItemStack in = this.getTextureItem( is ); if( in != null ) { return new FacadePart( is, side ); @@ -196,9 +196,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public ItemStack getTextureItem( ItemStack is ) + public ItemStack getTextureItem( final ItemStack is ) { - Block blk = this.getBlock( is ); + final Block blk = this.getBlock( is ); if( blk != null ) { return new ItemStack( blk, 1, this.getMeta( is ) ); @@ -207,12 +207,12 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public int getMeta( ItemStack is ) + public int getMeta( final ItemStack is ) { - NBTTagCompound data = is.getTagCompound(); + final NBTTagCompound data = is.getTagCompound(); if( data != null ) { - int[] blk = data.getIntArray( "x" ); + final int[] blk = data.getIntArray( "x" ); if( blk != null && blk.length == 2 ) { return blk[1]; @@ -222,9 +222,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public Block getBlock( ItemStack is ) + public Block getBlock( final ItemStack is ) { - NBTTagCompound data = is.getTagCompound(); + final NBTTagCompound data = is.getTagCompound(); if( data != null ) { if( data.hasKey( "modid" ) && data.hasKey( "itemname" ) ) @@ -236,7 +236,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } else { - int[] blk = data.getIntArray( "x" ); + final int[] blk = data.getIntArray( "x" ); if( blk != null && blk.length == 2 ) { return Block.getBlockById( blk[0] ); @@ -262,11 +262,11 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte return this.subTypes.get( 0 ); } - public ItemStack createFromIDs( int[] ids ) + public ItemStack createFromIDs( final int[] ids ) { - for( ItemStack facadeStack : AEApi.instance().definitions().items().facade().maybeStack( 1 ).asSet() ) + for( final ItemStack facadeStack : AEApi.instance().definitions().items().facade().maybeStack( 1 ).asSet() ) { - NBTTagCompound facadeTag = new NBTTagCompound(); + final NBTTagCompound facadeTag = new NBTTagCompound(); facadeTag.setIntArray( "x", ids.clone() ); facadeStack.setTagCompound( facadeTag ); @@ -277,16 +277,16 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte } @Override - public boolean useAlphaPass( ItemStack is ) + public boolean useAlphaPass( final ItemStack is ) { - ItemStack out = this.getTextureItem( is ); + final ItemStack out = this.getTextureItem( is ); if( out == null || out.getItem() == null ) { return false; } - Block blk = Block.getBlockFromItem( out.getItem() ); + final Block blk = Block.getBlockFromItem( out.getItem() ); if( blk != null && blk.canRenderInLayer( EnumWorldBlockLayer.TRANSLUCENT ) ) { return true; @@ -297,7 +297,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte @Override public void registerCustomIcon( - TextureMap map ) + final TextureMap map ) { myIcon = new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/ItemFacade" ) )); } diff --git a/src/main/java/appeng/items/parts/ItemMultiPart.java b/src/main/java/appeng/items/parts/ItemMultiPart.java index c98256db..e4011d48 100644 --- a/src/main/java/appeng/items/parts/ItemMultiPart.java +++ b/src/main/java/appeng/items/parts/ItemMultiPart.java @@ -74,7 +74,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG public static ItemMultiPart instance; private final Map registered; - public ItemMultiPart( IPartHelper partHelper ) + public ItemMultiPart( final IPartHelper partHelper ) { Preconditions.checkNotNull( partHelper ); @@ -88,7 +88,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Nonnull - public final ItemStackSrc createPart( PartType mat ) + public final ItemStackSrc createPart( final PartType mat ) { Preconditions.checkNotNull( mat ); @@ -96,7 +96,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Nonnull - public ItemStackSrc createPart( PartType mat, AEColor color ) + public ItemStackSrc createPart( final PartType mat, final AEColor color ) { Preconditions.checkNotNull( mat ); Preconditions.checkNotNull( color ); @@ -107,13 +107,13 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Nonnull - private ItemStackSrc createPart( PartType mat, int varID ) + private ItemStackSrc createPart( final PartType mat, final int varID ) { assert mat != null; assert varID >= 0; // verify - for( PartTypeWithVariant p : this.registered.values() ) + for( final PartTypeWithVariant p : this.registered.values() ) { if( p.part == mat && p.variant == varID ) { @@ -122,12 +122,12 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } boolean enabled = true; - for( AEFeature f : mat.getFeature() ) + for( final AEFeature f : mat.getFeature() ) { enabled = enabled && AEConfig.instance.isFeatureEnabled( f ); } - for( IntegrationType integrationType : mat.getIntegrations() ) + for( final IntegrationType integrationType : mat.getIntegrations() ) { enabled &= IntegrationRegistry.INSTANCE.isEnabled( integrationType ); } @@ -143,7 +143,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG return output; } - private void processMetaOverlap( boolean enabled, int partDamage, PartType mat, PartTypeWithVariant pti ) + private void processMetaOverlap( final boolean enabled, final int partDamage, final PartType mat, final PartTypeWithVariant pti ) { assert partDamage >= 0; assert mat != null; @@ -161,11 +161,11 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } } - public int getDamageByType( PartType t ) + public int getDamageByType( final PartType t ) { Preconditions.checkNotNull( t ); - for( Entry pt : this.registered.entrySet() ) + for( final Entry pt : this.registered.entrySet() ) { if( pt.getValue().part == t ) { @@ -176,7 +176,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Override - public boolean onItemUse( ItemStack is, EntityPlayer player, World w, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ ) + public boolean onItemUse( final ItemStack is, final EntityPlayer player, final World w, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ ) { if( this.getTypeByStack( is ) == PartType.InvalidType ) { @@ -187,7 +187,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Override - public String getUnlocalizedName( ItemStack is ) + public String getUnlocalizedName( final ItemStack is ) { return "item.appliedenergistics2." + this.getName( is ); } @@ -196,16 +196,16 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG @Override @SideOnly(Side.CLIENT) public void registerCustomIcon( - TextureMap map ) + final TextureMap map ) { - for( Entry part : this.registered.entrySet() ) + for( final Entry part : this.registered.entrySet() ) { part.getValue().texture= new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/" + this.getName( new ItemStack( this, 1, part.getKey() ) ) )) ); } } @Override - public IAESprite getIcon( ItemStack is ) + public IAESprite getIcon( final ItemStack is ) { final int dmg = is.getMetadata(); final PartTypeWithVariant registeredType = this.registered.get( dmg ); @@ -218,7 +218,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Override - public String getItemStackDisplayName( ItemStack is ) + public String getItemStackDisplayName( final ItemStack is ) { final PartType pt = this.getTypeByStack( is ); @@ -243,18 +243,18 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { - List> types = new ArrayList>( this.registered.entrySet() ); + final List> types = new ArrayList>( this.registered.entrySet() ); Collections.sort( types, REGISTERED_COMPARATOR ); - for( Entry part : types ) + for( final Entry part : types ) { itemStacks.add( new ItemStack( this, 1, part.getKey() ) ); } } - public String getName( ItemStack is ) + public String getName( final ItemStack is ) { Preconditions.checkNotNull( is ); @@ -265,7 +265,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG } @Nonnull - public PartType getTypeByStack( ItemStack is ) + public PartType getTypeByStack( final ItemStack is ) { Preconditions.checkNotNull( is ); @@ -280,7 +280,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG @Nullable @Override - public IPart createPartFromItemStack( ItemStack is ) + public IPart createPartFromItemStack( final ItemStack is ) { final PartType type = this.getTypeByStack( is ); final Class part = type.getPart(); @@ -298,25 +298,25 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG return type.constructor.newInstance( is ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e ); } - catch( NoSuchMethodException e ) + catch( final NoSuchMethodException e ) { throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e ); } } - public int variantOf( int itemDamage ) + public int variantOf( final int itemDamage ) { final PartTypeWithVariant registeredPartType = this.registered.get( itemDamage ); if( registeredPartType != null ) @@ -329,19 +329,19 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG @Nullable @Override - public String getUnlocalizedGroupName( Set others, ItemStack is ) + public String getUnlocalizedGroupName( final Set others, final ItemStack is ) { boolean importBus = false; boolean exportBus = false; boolean group = false; - PartType u = this.getTypeByStack( is ); + final PartType u = this.getTypeByStack( is ); - for( ItemStack stack : others ) + for( final ItemStack stack : others ) { if( stack.getItem() == this ) { - PartType pt = this.getTypeByStack( stack ); + final PartType pt = this.getTypeByStack( stack ); switch( pt ) { case ImportBus: @@ -379,7 +379,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG @SideOnly(Side.CLIENT) public IAESprite texture = null; - private PartTypeWithVariant( PartType part, int variant ) + private PartTypeWithVariant( final PartType part, final int variant ) { assert part != null; assert variant >= 0; @@ -401,7 +401,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG private static final class RegisteredComparator implements Comparator> { @Override - public int compare( Entry o1, Entry o2 ) + public int compare( final Entry o1, final Entry o2 ) { return o1.getValue().part.name().compareTo( o2.getValue().part.name() ); } diff --git a/src/main/java/appeng/items/parts/PartType.java b/src/main/java/appeng/items/parts/PartType.java index 01c0e99f..adaa1d13 100644 --- a/src/main/java/appeng/items/parts/PartType.java +++ b/src/main/java/appeng/items/parts/PartType.java @@ -167,12 +167,12 @@ public enum PartType private final GuiText extraName; public Constructor constructor; - PartType( int baseMetaValue, Set features, Set integrations, Class c ) + PartType( final int baseMetaValue, final Set features, final Set integrations, final Class c ) { this( baseMetaValue, features, integrations, c, null ); } - PartType( int baseMetaValue, Set features, Set integrations, Class c, GuiText en ) + PartType( final int baseMetaValue, final Set features, final Set integrations, final Class c, final GuiText en ) { this.features = Collections.unmodifiableSet( features ); this.integrations = Collections.unmodifiableSet( integrations ); diff --git a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java index 4df7d7a4..a6dbe3b6 100644 --- a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java @@ -64,7 +64,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe private final int perType; private final double idleDrain; - public ItemBasicStorageCell( MaterialType whichCell, int kilobytes ) + public ItemBasicStorageCell( final MaterialType whichCell, final int kilobytes ) { super( Optional.of( kilobytes + "k" ) ); @@ -98,14 +98,14 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( inventory instanceof ICellInventoryHandler ) { - ICellInventoryHandler handler = (ICellInventoryHandler) inventory; - ICellInventory cellInventory = handler.getCellInv(); + final ICellInventoryHandler handler = (ICellInventoryHandler) inventory; + final ICellInventory cellInventory = handler.getCellInv(); if( cellInventory != null ) { @@ -115,7 +115,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe if( handler.isPreformatted() ) { - String list = ( handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded ).getLocal(); + final String list = ( handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded ).getLocal(); if( handler.isFuzzy() ) { @@ -131,25 +131,25 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public int getBytes( ItemStack cellItem ) + public int getBytes( final ItemStack cellItem ) { return this.totalBytes; } @Override - public int getBytesPerType( ItemStack cellItem ) + public int getBytesPerType( final ItemStack cellItem ) { return this.perType; } @Override - public int getTotalTypes( ItemStack cellItem ) + public int getTotalTypes( final ItemStack cellItem ) { return 63; } @Override - public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition ) + public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition ) { return false; } @@ -161,7 +161,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public boolean isStorageCell( ItemStack i ) + public boolean isStorageCell( final ItemStack i ) { return true; } @@ -173,57 +173,57 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public String getUnlocalizedGroupName( Set others, ItemStack is ) + public String getUnlocalizedGroupName( final Set others, final ItemStack is ) { return GuiText.StorageCells.getUnlocalized(); } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 2 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } @Override - public ItemStack onItemRightClick( ItemStack stack, World world, EntityPlayer player ) + public ItemStack onItemRightClick( final ItemStack stack, final World world, final EntityPlayer player ) { this.disassembleDrive( stack, world, player ); return stack; } - private boolean disassembleDrive( ItemStack stack, World world, EntityPlayer player ) + private boolean disassembleDrive( final ItemStack stack, final World world, final EntityPlayer player ) { if( player.isSneaking() ) { @@ -232,18 +232,18 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe return false; } - InventoryPlayer playerInventory = player.inventory; - IMEInventoryHandler inv = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final InventoryPlayer playerInventory = player.inventory; + final IMEInventoryHandler inv = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( inv != null && playerInventory.getCurrentItem() == stack ) { - InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); - IItemList list = inv.getAvailableItems( StorageChannel.ITEMS.createList() ); + final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, EnumFacing.UP ); + final IItemList list = inv.getAvailableItems( StorageChannel.ITEMS.createList() ); if( list.isEmpty() && ia != null ) { playerInventory.setInventorySlotContents( playerInventory.currentItem, null ); // drop core - ItemStack extraB = ia.addItems( this.component.stack( 1 ) ); + final ItemStack extraB = ia.addItems( this.component.stack( 1 ) ); if( extraB != null ) { player.dropPlayerItemWithRandomChoice( extraB, false ); @@ -262,7 +262,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } // drop empty storage cell case - for( ItemStack storageCellStack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() ) + for( final ItemStack storageCellStack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() ) { final ItemStack extraA = ia.addItems( storageCellStack ); if( extraA != null ) @@ -285,22 +285,22 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe @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 ) { return this.disassembleDrive( stack, world, player ); } @Override - public ItemStack getContainerItem( ItemStack itemStack ) + public ItemStack getContainerItem( final ItemStack itemStack ) { - for( ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() ) { return stack; } @@ -309,7 +309,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe } @Override - public boolean hasContainerItem( ItemStack stack ) + public boolean hasContainerItem( final ItemStack stack ) { return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting ); } diff --git a/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java b/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java index 44758a71..fc87b190 100644 --- a/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java @@ -40,31 +40,31 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return null; } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { return FuzzyMode.IGNORE_ALL; } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { } diff --git a/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java b/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java index 75dfc2e3..8076ca19 100644 --- a/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java @@ -45,7 +45,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag { private final int maxRegion; - public ItemSpatialStorageCell( int spatialScale ) + public ItemSpatialStorageCell( final int spatialScale ) { super( Optional.of( spatialScale + "Cubed" ) ); this.setFeature( EnumSet.of( AEFeature.SpatialIO ) ); @@ -54,9 +54,9 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - WorldCoord wc = this.getStoredSize( stack ); + final WorldCoord wc = this.getStoredSize( stack ); if( wc.x > 0 ) { lines.add( GuiText.StoredSize.getLocal() + ": " + wc.x + " x " + wc.y + " x " + wc.z ); @@ -64,24 +64,24 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public boolean isSpatialStorage( ItemStack is ) + public boolean isSpatialStorage( final ItemStack is ) { return true; } @Override - public int getMaxStoredDim( ItemStack is ) + public int getMaxStoredDim( final ItemStack is ) { return this.maxRegion; } @Override - public World getWorld( ItemStack is ) + public World getWorld( final ItemStack is ) { if( is.hasTagCompound() ) { - NBTTagCompound c = is.getTagCompound(); - int dim = c.getInteger( "StorageDim" ); + final NBTTagCompound c = is.getTagCompound(); + final int dim = c.getInteger( "StorageDim" ); World w = DimensionManager.getWorld( dim ); if( w == null ) { @@ -101,14 +101,14 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public WorldCoord getStoredSize( ItemStack is ) + public WorldCoord getStoredSize( final ItemStack is ) { if( is.hasTagCompound() ) { - NBTTagCompound c = is.getTagCompound(); + final NBTTagCompound c = is.getTagCompound(); if( Platform.isServer() ) { - int dim = c.getInteger( "StorageDim" ); + final int dim = c.getInteger( "StorageDim" ); return WorldData.instance().dimensionData().getStoredSize( dim ); } else @@ -120,12 +120,12 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public WorldCoord getMin( ItemStack is ) + public WorldCoord getMin( final ItemStack is ) { - World w = this.getWorld( is ); + final World w = this.getWorld( is ); if( w != null ) { - NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" ); + final NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" ); if( info != null ) { return new WorldCoord( info.getInteger( "minX" ), info.getInteger( "minY" ), info.getInteger( "minZ" ) ); @@ -135,12 +135,12 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public WorldCoord getMax( ItemStack is ) + public WorldCoord getMax( final ItemStack is ) { - World w = this.getWorld( is ); + final World w = this.getWorld( is ); if( w != null ) { - NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" ); + final NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" ); if( info != null ) { return new WorldCoord( info.getInteger( "maxX" ), info.getInteger( "maxY" ), info.getInteger( "maxZ" ) ); @@ -150,14 +150,14 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag } @Override - public TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition ) + public TransitionResult doSpatialTransition( final ItemStack is, final World w, final WorldCoord min, final WorldCoord max, final boolean doTransition ) { - WorldCoord scale = this.getStoredSize( is ); + final WorldCoord scale = this.getStoredSize( is ); - int targetX = max.x - min.x - 1; - int targetY = max.y - min.y - 1; - int targetZ = max.z - min.z - 1; - int maxSize = this.getMaxStoredDim( is ); + final int targetX = max.x - min.x - 1; + final int targetY = max.y - min.y - 1; + final int targetZ = max.z - min.z - 1; + final int maxSize = this.getMaxStoredDim( is ); World destination = this.getWorld( is ); @@ -170,7 +170,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag destination = this.createNewWorld( is ); } - int floorBuffer = 64; + final int floorBuffer = 64; StorageHelper.getInstance().swapRegions( w, destination, min.x + 1, min.y + 1, min.z + 1, 1, floorBuffer + 1, 1, targetX - 1, targetY - 1, targetZ - 1 ); this.setStoredSize( is, targetX, targetY, targetZ ); @@ -181,22 +181,22 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag return new TransitionResult( false, 0 ); } - public World createNewWorld( ItemStack is ) + public World createNewWorld( final ItemStack is ) { - NBTTagCompound c = Platform.openNbtData( is ); - int newDim = DimensionManager.getNextFreeDimId(); + final NBTTagCompound c = Platform.openNbtData( is ); + final int newDim = DimensionManager.getNextFreeDimId(); c.setInteger( "StorageDim", newDim ); WorldData.instance().dimensionData().addStorageCell( newDim ); DimensionManager.initDimension( newDim ); return DimensionManager.getWorld( newDim ); } - private void setStoredSize( ItemStack is, int targetX, int targetY, int targetZ ) + private void setStoredSize( final ItemStack is, final int targetX, final int targetY, final int targetZ ) { if( is.hasTagCompound() ) { - NBTTagCompound c = is.getTagCompound(); - int dim = c.getInteger( "StorageDim" ); + final NBTTagCompound c = is.getTagCompound(); + final int dim = c.getInteger( "StorageDim" ); c.setInteger( "sizeX", targetX ); c.setInteger( "sizeY", targetY ); c.setInteger( "sizeZ", targetZ ); diff --git a/src/main/java/appeng/items/storage/ItemViewCell.java b/src/main/java/appeng/items/storage/ItemViewCell.java index f4fe94f6..db08cea8 100644 --- a/src/main/java/appeng/items/storage/ItemViewCell.java +++ b/src/main/java/appeng/items/storage/ItemViewCell.java @@ -50,13 +50,13 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem this.setMaxStackSize( 1 ); } - public static IPartitionList createFilter( ItemStack[] list ) + public static IPartitionList createFilter( final ItemStack[] list ) { IPartitionList myPartitionList = null; - MergedPriorityList myMergedList = new MergedPriorityList(); + final MergedPriorityList myMergedList = new MergedPriorityList(); - for( ItemStack currentViewCell : list ) + for( final ItemStack currentViewCell : list ) { if( currentViewCell == null ) { @@ -65,22 +65,22 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem if( ( currentViewCell.getItem() instanceof ItemViewCell ) ) { - IItemList priorityList = AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); - ICellWorkbenchItem vc = (ICellWorkbenchItem) currentViewCell.getItem(); - IInventory upgrades = vc.getUpgradesInventory( currentViewCell ); - IInventory config = vc.getConfigInventory( currentViewCell ); - FuzzyMode fzMode = vc.getFuzzyMode( currentViewCell ); + final ICellWorkbenchItem vc = (ICellWorkbenchItem) currentViewCell.getItem(); + final IInventory upgrades = vc.getUpgradesInventory( currentViewCell ); + final IInventory config = vc.getConfigInventory( currentViewCell ); + final FuzzyMode fzMode = vc.getFuzzyMode( currentViewCell ); boolean hasInverter = false; boolean hasFuzzy = false; for( int x = 0; x < upgrades.getSizeInventory(); x++ ) { - ItemStack is = upgrades.getStackInSlot( x ); + final ItemStack is = upgrades.getStackInSlot( x ); if( is != null && is.getItem() instanceof IUpgradeModule ) { - Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is ); + final Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is ); if( u != null ) { switch( u ) @@ -99,7 +99,7 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem for( int x = 0; x < config.getSizeInventory(); x++ ) { - ItemStack is = config.getStackInSlot( x ); + final ItemStack is = config.getStackInSlot( x ); if( is != null ) { priorityList.add( AEItemStack.create( is ) ); @@ -126,39 +126,39 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 2 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } diff --git a/src/main/java/appeng/items/tools/ToolBiometricCard.java b/src/main/java/appeng/items/tools/ToolBiometricCard.java index 258b7093..667d195d 100644 --- a/src/main/java/appeng/items/tools/ToolBiometricCard.java +++ b/src/main/java/appeng/items/tools/ToolBiometricCard.java @@ -56,7 +56,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public ItemStack onItemRightClick( ItemStack is, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack is, final World w, final EntityPlayer p ) { if( p.isSneaking() ) { @@ -69,7 +69,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public boolean itemInteractionForEntity( ItemStack is, EntityPlayer par2EntityPlayer, EntityLivingBase target ) + public boolean itemInteractionForEntity( ItemStack is, final EntityPlayer par2EntityPlayer, final EntityLivingBase target ) { if( target instanceof EntityPlayer && !par2EntityPlayer.isSneaking() ) { @@ -85,15 +85,15 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public String getItemStackDisplayName( ItemStack is ) + public String getItemStackDisplayName( final ItemStack is ) { - GameProfile username = this.getProfile( is ); + final GameProfile username = this.getProfile( is ); return username != null ? super.getItemStackDisplayName( is ) + " - " + username.getName() : super.getItemStackDisplayName( is ); } - private void encode( ItemStack is, EntityPlayer p ) + private void encode( final ItemStack is, final EntityPlayer p ) { - GameProfile username = this.getProfile( is ); + final GameProfile username = this.getProfile( is ); if( username != null && username.equals( p.getGameProfile() ) ) { @@ -106,13 +106,13 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public void setProfile( ItemStack itemStack, GameProfile profile ) + public void setProfile( final ItemStack itemStack, final GameProfile profile ) { - NBTTagCompound tag = Platform.openNbtData( itemStack ); + final NBTTagCompound tag = Platform.openNbtData( itemStack ); if( profile != null ) { - NBTTagCompound pNBT = new NBTTagCompound(); + final NBTTagCompound pNBT = new NBTTagCompound(); NBTUtil.writeGameProfile( pNBT, profile ); tag.setTag( "profile", pNBT ); } @@ -123,9 +123,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public GameProfile getProfile( ItemStack is ) + public GameProfile getProfile( final ItemStack is ) { - NBTTagCompound tag = Platform.openNbtData( is ); + final NBTTagCompound tag = Platform.openNbtData( is ); if( tag.hasKey( "profile" ) ) { return NBTUtil.readGameProfileFromNBT( tag.getCompoundTag( "profile" ) ); @@ -134,12 +134,12 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public EnumSet getPermissions( ItemStack is ) + public EnumSet getPermissions( final ItemStack is ) { - NBTTagCompound tag = Platform.openNbtData( is ); - EnumSet result = EnumSet.noneOf( SecurityPermissions.class ); + final NBTTagCompound tag = Platform.openNbtData( is ); + final EnumSet result = EnumSet.noneOf( SecurityPermissions.class ); - for( SecurityPermissions sp : SecurityPermissions.values() ) + for( final SecurityPermissions sp : SecurityPermissions.values() ) { if( tag.getBoolean( sp.name() ) ) { @@ -151,16 +151,16 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public boolean hasPermission( ItemStack is, SecurityPermissions permission ) + public boolean hasPermission( final ItemStack is, final SecurityPermissions permission ) { - NBTTagCompound tag = Platform.openNbtData( is ); + final NBTTagCompound tag = Platform.openNbtData( is ); return tag.getBoolean( permission.name() ); } @Override - public void removePermission( ItemStack itemStack, SecurityPermissions permission ) + public void removePermission( final ItemStack itemStack, final SecurityPermissions permission ) { - NBTTagCompound tag = Platform.openNbtData( itemStack ); + final NBTTagCompound tag = Platform.openNbtData( itemStack ); if( tag.hasKey( permission.name() ) ) { tag.removeTag( permission.name() ); @@ -168,22 +168,22 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard } @Override - public void addPermission( ItemStack itemStack, SecurityPermissions permission ) + public void addPermission( final ItemStack itemStack, final SecurityPermissions permission ) { - NBTTagCompound tag = Platform.openNbtData( itemStack ); + final NBTTagCompound tag = Platform.openNbtData( itemStack ); tag.setBoolean( permission.name(), true ); } @Override - public void registerPermissions( ISecurityRegistry register, IPlayerRegistry pr, ItemStack is ) + public void registerPermissions( final ISecurityRegistry register, final IPlayerRegistry pr, final ItemStack is ) { register.addPlayer( pr.getID( this.getProfile( is ) ), this.getPermissions( is ) ); } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - EnumSet perms = this.getPermissions( stack ); + final EnumSet perms = this.getPermissions( stack ); if( perms.isEmpty() ) { lines.add( GuiText.NoPermissions.getLocal() ); @@ -192,7 +192,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard { String msg = null; - for( SecurityPermissions sp : perms ) + for( final SecurityPermissions sp : perms ) { if( msg == null ) { diff --git a/src/main/java/appeng/items/tools/ToolMemoryCard.java b/src/main/java/appeng/items/tools/ToolMemoryCard.java index 534943c1..e2fba587 100644 --- a/src/main/java/appeng/items/tools/ToolMemoryCard.java +++ b/src/main/java/appeng/items/tools/ToolMemoryCard.java @@ -47,11 +47,11 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { lines.add( this.getLocalizedName( this.getSettingsName( stack ) + ".name", this.getSettingsName( stack ) ) ); - NBTTagCompound data = this.getData( stack ); + final NBTTagCompound data = this.getData( stack ); if( data.hasKey( "tooltip" ) ) { lines.add( StatCollector.translateToLocal( this.getLocalizedName( data.getString( "tooltip" ) + ".name", data.getString( "tooltip" ) ) ) ); @@ -65,18 +65,18 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard * * @return localized name */ - private String getLocalizedName( String... name ) + private String getLocalizedName( final String... name ) { - for( String n : name ) + for( final String n : name ) { - String l = StatCollector.translateToLocal( n ); + final String l = StatCollector.translateToLocal( n ); if( !l.equals( n ) ) { return l; } } - for( String n : name ) + for( final String n : name ) { return n; } @@ -85,25 +85,25 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard } @Override - public void setMemoryCardContents( ItemStack is, String settingsName, NBTTagCompound data ) + public void setMemoryCardContents( final ItemStack is, final String settingsName, final NBTTagCompound data ) { - NBTTagCompound c = Platform.openNbtData( is ); + final NBTTagCompound c = Platform.openNbtData( is ); c.setString( "Config", settingsName ); c.setTag( "Data", data ); } @Override - public String getSettingsName( ItemStack is ) + public String getSettingsName( final ItemStack is ) { - NBTTagCompound c = Platform.openNbtData( is ); - String name = c.getString( "Config" ); + final NBTTagCompound c = Platform.openNbtData( is ); + final String name = c.getString( "Config" ); return name == null || name.isEmpty() ? GuiText.Blank.getUnlocalized() : name; } @Override - public NBTTagCompound getData( ItemStack is ) + public NBTTagCompound getData( final ItemStack is ) { - NBTTagCompound c = Platform.openNbtData( is ); + final NBTTagCompound c = Platform.openNbtData( is ); NBTTagCompound o = c.getCompoundTag( "Data" ); if( o == null ) { @@ -113,7 +113,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard } @Override - public void notifyUser( EntityPlayer player, MemoryCardMessages msg ) + public void notifyUser( final EntityPlayer player, final MemoryCardMessages msg ) { if( Platform.isClient() ) { @@ -140,18 +140,18 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard @Override public boolean onItemUse( - ItemStack is, - EntityPlayer player, - World w, - BlockPos pos, - EnumFacing side, - float hx, - float hy, - float hz ) + final ItemStack is, + final EntityPlayer player, + final World w, + final BlockPos pos, + final EnumFacing side, + final float hx, + final float hy, + final float hz ) { if( player.isSneaking() && !w.isRemote ) { - IMemoryCard mem = (IMemoryCard) is.getItem(); + final IMemoryCard mem = (IMemoryCard) is.getItem(); mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED ); is.setTagCompound( null ); return true; @@ -164,9 +164,9 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard @Override public boolean doesSneakBypassUse( - World world, - BlockPos pos, - EntityPlayer player ) + final World world, + final BlockPos pos, + final EntityPlayer player ) { return true; } diff --git a/src/main/java/appeng/items/tools/ToolNetworkTool.java b/src/main/java/appeng/items/tools/ToolNetworkTool.java index b40779ed..297bf392 100644 --- a/src/main/java/appeng/items/tools/ToolNetworkTool.java +++ b/src/main/java/appeng/items/tools/ToolNetworkTool.java @@ -68,18 +68,18 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench / } @Override - public IGuiItemObject getGuiObject( ItemStack is, World world, BlockPos pos ) + public IGuiItemObject getGuiObject( final ItemStack is, final World world, final BlockPos pos ) { - TileEntity te = world.getTileEntity( pos ); + final TileEntity te = world.getTileEntity( pos ); return new NetworkToolViewer( is, (IGridHost) ( te instanceof IGridHost ? te : null ) ); } @Override - public ItemStack onItemRightClick( ItemStack it, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack it, final World w, final EntityPlayer p ) { if( Platform.isClient() ) { - MovingObjectPosition mop = ClientHelper.proxy.getMOP(); + final MovingObjectPosition mop = ClientHelper.proxy.getMOP(); if( mop == null ) { @@ -99,20 +99,20 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench / @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 ) { - MovingObjectPosition mop = new MovingObjectPosition( new Vec3( hitX, hitY, hitZ ), side, pos ); - TileEntity te = world.getTileEntity( pos ); + final MovingObjectPosition mop = new MovingObjectPosition( new Vec3( hitX, hitY, hitZ ), side, pos ); + final TileEntity te = world.getTileEntity( pos ); if( te instanceof IPartHost ) { - SelectedPart part = ( (IPartHost) te ).selectPart( mop.hitVec ); + final SelectedPart part = ( (IPartHost) te ).selectPart( mop.hitVec ); if( part.part != null ) { if( part.part instanceof INetworkToolAgent && !( (INetworkToolAgent) part.part ).showNetworkInfo( mop ) ) @@ -135,14 +135,14 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench / @Override public boolean doesSneakBypassUse( - World world, - BlockPos pos, - EntityPlayer player ) + final World world, + final BlockPos pos, + final EntityPlayer player ) { return true; } - public boolean serverSideToolLogic( ItemStack is, EntityPlayer p, World w, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ ) + public boolean serverSideToolLogic( final ItemStack is, final EntityPlayer p, final World w, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ ) { if( side != null ) { @@ -151,10 +151,10 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench / return false; } - Block b = w.getBlockState( pos ).getBlock(); + final Block b = w.getBlockState( pos ).getBlock(); if( b != null && !p.isSneaking() ) { - TileEntity te = w.getTileEntity( pos ); + final TileEntity te = w.getTileEntity( pos ); if( !( te instanceof IGridHost ) ) { if( b.rotateBlock( w, pos, side ) ) @@ -173,7 +173,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench / return true; } - TileEntity te = w.getTileEntity( pos ); + final TileEntity te = w.getTileEntity( pos ); if( te instanceof IGridHost ) { @@ -201,9 +201,9 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench / @Override public boolean canWrench( - ItemStack wrench, - EntityPlayer player, - BlockPos pos ) + final ItemStack wrench, + final EntityPlayer player, + final BlockPos pos ) { return true; } diff --git a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java index 395ac6bd..17cbcf9a 100644 --- a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java +++ b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java @@ -46,7 +46,7 @@ public class ToolChargedStaff extends AEBasePoweredItem } @Override - public boolean hitEntity( ItemStack item, EntityLivingBase target, EntityLivingBase hitter ) + public boolean hitEntity( final ItemStack item, final EntityLivingBase target, final EntityLivingBase hitter ) { if( this.getAECurrentPower( item ) > 300 ) { @@ -56,9 +56,9 @@ public class ToolChargedStaff extends AEBasePoweredItem for( int x = 0; x < 2; x++ ) { final AxisAlignedBB entityBoundingBox = target.getEntityBoundingBox(); - float dx = (float) ( Platform.getRandomFloat() * target.width + entityBoundingBox.minX ); - float dy = (float) ( Platform.getRandomFloat() * target.height + entityBoundingBox.minY ); - float dz = (float) ( Platform.getRandomFloat() * target.width + entityBoundingBox.minZ ); + final float dx = (float) ( Platform.getRandomFloat() * target.width + entityBoundingBox.minX ); + final float dy = (float) ( Platform.getRandomFloat() * target.height + entityBoundingBox.minY ); + final float dz = (float) ( Platform.getRandomFloat() * target.width + entityBoundingBox.minZ ); ServerHelper.proxy.sendToAllNearExcept( null, dx, dy, dz, 32.0, target.worldObj, new PacketLightning( dx, dy, dz ) ); } } diff --git a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java index e8f6a459..8afc9bca 100644 --- a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java +++ b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java @@ -93,7 +93,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe static { - for( AEColor col : AEColor.values() ) + for( final AEColor col : AEColor.values() ) { if( col == AEColor.Transparent ) { @@ -123,23 +123,23 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe @Override public boolean onItemUse( - ItemStack is, - EntityPlayer p, - World w, - BlockPos pos, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final ItemStack is, + final EntityPlayer p, + final World w, + final BlockPos pos, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { - Block blk = w.getBlockState( pos ).getBlock(); + final Block blk = w.getBlockState( pos ).getBlock(); ItemStack paintBall = this.getColor( is ); - IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); + final IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); if( inv != null ) { - IAEItemStack option = inv.extractItems( AEItemStack.create( paintBall ), Actionable.SIMULATE, new BaseActionSource() ); + final IAEItemStack option = inv.extractItems( AEItemStack.create( paintBall ), Actionable.SIMULATE, new BaseActionSource() ); if( option != null ) { @@ -156,10 +156,10 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return false; } - double powerPerUse = 100; + final double powerPerUse = 100; if( paintBall != null && paintBall.getItem() instanceof ItemSnowball ) { - TileEntity te = w.getTileEntity( pos ); + final TileEntity te = w.getTileEntity( pos ); // clean cables. if( te instanceof IColorableTile ) { @@ -175,8 +175,8 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } // clean paint balls.. - Block testBlk = w.getBlockState( pos.offset( side ) ).getBlock(); - TileEntity painted = w.getTileEntity( pos.offset( side ) ); + final Block testBlk = w.getBlockState( pos.offset( side ) ).getBlock(); + final TileEntity painted = w.getTileEntity( pos.offset( side ) ); if( this.getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint ) { inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() ); @@ -187,7 +187,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } else if( paintBall != null ) { - AEColor color = this.getColorFromItem( paintBall ); + final AEColor color = this.getColorFromItem( paintBall ); if( color != null && this.getAECurrentPower( is ) > powerPerUse ) { @@ -210,11 +210,11 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public String getItemStackDisplayName( ItemStack par1ItemStack ) + public String getItemStackDisplayName( final ItemStack par1ItemStack ) { String extra = GuiText.Empty.getLocal(); - AEColor selected = this.getActiveColor( par1ItemStack ); + final AEColor selected = this.getActiveColor( par1ItemStack ); if( selected != null && Platform.isClient() ) { @@ -224,12 +224,12 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return super.getItemStackDisplayName( par1ItemStack ) + " - " + extra; } - public AEColor getActiveColor( ItemStack tol ) + public AEColor getActiveColor( final ItemStack tol ) { return this.getColorFromItem( this.getColor( tol ) ); } - public AEColor getColorFromItem( ItemStack paintBall ) + public AEColor getColorFromItem( final ItemStack paintBall ) { if( paintBall == null ) { @@ -243,14 +243,14 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe if( paintBall.getItem() instanceof ItemPaintBall ) { - ItemPaintBall ipb = (ItemPaintBall) paintBall.getItem(); + final ItemPaintBall ipb = (ItemPaintBall) paintBall.getItem(); return ipb.getColor( paintBall ); } else { - int[] id = OreDictionary.getOreIDs( paintBall ); + final int[] id = OreDictionary.getOreIDs( paintBall ); - for( int oreID : id ) + for( final int oreID : id ) { if( ORE_TO_COLOR.containsKey( oreID ) ) { @@ -262,13 +262,13 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return null; } - public ItemStack getColor( ItemStack is ) + public ItemStack getColor( final ItemStack is ) { - NBTTagCompound c = is.getTagCompound(); + final NBTTagCompound c = is.getTagCompound(); if( c != null && c.hasKey( "color" ) ) { - NBTTagCompound color = c.getCompoundTag( "color" ); - ItemStack oldColor = ItemStack.loadItemStackFromNBT( color ); + final NBTTagCompound color = c.getCompoundTag( "color" ); + final ItemStack oldColor = ItemStack.loadItemStackFromNBT( color ); if( oldColor != null ) { return oldColor; @@ -278,17 +278,17 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return this.findNextColor( is, null, 0 ); } - private ItemStack findNextColor( ItemStack is, ItemStack anchor, int scrollOffset ) + private ItemStack findNextColor( final ItemStack is, final ItemStack anchor, final int scrollOffset ) { ItemStack newColor = null; - IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); + final IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS ); if( inv != null ) { - IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() ); + final IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() ); if( anchor == null ) { - IAEItemStack firstItem = itemList.getFirstItem(); + final IAEItemStack firstItem = itemList.getFirstItem(); if( firstItem != null ) { newColor = firstItem.getItemStack(); @@ -296,9 +296,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } else { - LinkedList list = new LinkedList(); + final LinkedList list = new LinkedList(); - for( IAEItemStack i : itemList ) + for( final IAEItemStack i : itemList ) { list.add( i ); } @@ -307,7 +307,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe { @Override - public int compare( IAEItemStack a, IAEItemStack b ) + public int compare( final IAEItemStack a, final IAEItemStack b ) { return ItemSorters.compareInt( a.getItemDamage(), b.getItemDamage() ); } @@ -350,28 +350,28 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return newColor; } - public void setColor( ItemStack is, ItemStack newColor ) + public void setColor( final ItemStack is, final ItemStack newColor ) { - NBTTagCompound data = Platform.openNbtData( is ); + final NBTTagCompound data = Platform.openNbtData( is ); if( newColor == null ) { data.removeTag( "color" ); } else { - NBTTagCompound color = new NBTTagCompound(); + final NBTTagCompound color = new NBTTagCompound(); newColor.writeToNBT( color ); data.setTag( "color", color ); } } - private boolean recolourBlock( Block blk, EnumFacing side, World w, BlockPos pos, EnumFacing orientation, AEColor newColor, EntityPlayer p ) + private boolean recolourBlock( final Block blk, final EnumFacing side, final World w, final BlockPos pos, final EnumFacing orientation, final AEColor newColor, final EntityPlayer p ) { - IBlockState state = w.getBlockState( pos ); + final IBlockState state = w.getBlockState( pos ); if( blk instanceof BlockColored ) { - EnumDyeColor color = ( EnumDyeColor ) state.getValue( BlockColored.COLOR ); + final EnumDyeColor color = ( EnumDyeColor ) state.getValue( BlockColored.COLOR ); if( newColor.dye == color ) { @@ -388,7 +388,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe if( blk == Blocks.stained_glass ) { - EnumDyeColor color = ( EnumDyeColor ) state.getValue( BlockStainedGlass.COLOR ); + final EnumDyeColor color = ( EnumDyeColor ) state.getValue( BlockStainedGlass.COLOR ); if( newColor.dye == color ) { @@ -405,7 +405,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe if( blk == Blocks.stained_glass_pane ) { - EnumDyeColor color = ( EnumDyeColor ) state.getValue( BlockStainedGlassPane.COLOR ); + final EnumDyeColor color = ( EnumDyeColor ) state.getValue( BlockStainedGlassPane.COLOR ); if( newColor.dye == color ) { @@ -428,7 +428,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return blk.recolorBlock( w, pos, side, newColor.dye ); } - public void cycleColors( ItemStack is, ItemStack paintBall, int i ) + public void cycleColors( final ItemStack is, final ItemStack paintBall, final int i ) { if( paintBall == null ) { @@ -441,15 +441,15 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); - IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( cdi instanceof CellInventoryHandler ) { - ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); + final ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); if( cd != null ) { lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() ); @@ -459,31 +459,31 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public int getBytes( ItemStack cellItem ) + public int getBytes( final ItemStack cellItem ) { return 512; } @Override - public int getBytesPerType( ItemStack cellItem ) + public int getBytesPerType( final ItemStack cellItem ) { return 8; } @Override - public int getTotalTypes( ItemStack cellItem ) + public int getTotalTypes( final ItemStack cellItem ) { return 27; } @Override - public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition ) + public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition ) { if( requestedAddition != null ) { - int[] id = OreDictionary.getOreIDs( requestedAddition.getItemStack() ); + final int[] id = OreDictionary.getOreIDs( requestedAddition.getItemStack() ); - for( int x : id ) + for( final int x : id ) { if( ORE_TO_COLOR.containsKey( x ) ) { @@ -508,7 +508,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public boolean isStorageCell( ItemStack i ) + public boolean isStorageCell( final ItemStack i ) { return true; } @@ -520,51 +520,51 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe } @Override - public String getUnlocalizedGroupName( Set others, ItemStack is ) + public String getUnlocalizedGroupName( final Set others, final ItemStack is ) { return GuiText.StorageCells.getUnlocalized(); } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 2 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } @Override - public void onWheel( ItemStack is, boolean up ) + public void onWheel( final ItemStack is, final boolean up ) { this.cycleColors( is, this.getColor( is ), up ? 1 : -1 ); } diff --git a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java index 933a4098..1204c4a4 100644 --- a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java +++ b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java @@ -75,7 +75,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT this.coolDown.put( new InWorldToolOperationIngredient( Blocks.flowing_lava, true ), new InWorldToolOperationResult( new ItemStack( Blocks.obsidian ) ) ); this.coolDown.put( new InWorldToolOperationIngredient( Blocks.grass, true ), new InWorldToolOperationResult( new ItemStack( Blocks.dirt ) ) ); - List snowBalls = new ArrayList(); + final List snowBalls = new ArrayList(); snowBalls.add( new ItemStack( Items.snowball ) ); this.coolDown.put( new InWorldToolOperationIngredient( Blocks.flowing_water, true ), new InWorldToolOperationResult( null, snowBalls ) ); this.coolDown.put( new InWorldToolOperationIngredient( Blocks.water, true ), new InWorldToolOperationResult( new ItemStack( Blocks.ice ) ) ); @@ -98,15 +98,15 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT private final IBlockState state; private boolean blockOnly; - public InWorldToolOperationIngredient( IBlockState state ) + public InWorldToolOperationIngredient( final IBlockState state ) { this.state = state; blockOnly = false; } public InWorldToolOperationIngredient( - Block blk, - boolean b ) + final Block blk, + final boolean b ) { state = blk.getDefaultState(); blockOnly = b; @@ -119,7 +119,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -129,12 +129,12 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT { return false; } - InWorldToolOperationIngredient other = (InWorldToolOperationIngredient) obj; + final InWorldToolOperationIngredient other = (InWorldToolOperationIngredient) obj; return state == other.state && ( blockOnly && state.getBlock() == other.state.getBlock() ); } } - private void heat( IBlockState state, World w, BlockPos pos ) + private void heat( final IBlockState state, final World w, final BlockPos pos ) { InWorldToolOperationResult r = this.heatUp.get( new InWorldToolOperationIngredient( state ) ); @@ -145,7 +145,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT if( r.BlockItem != null ) { - Block blk = Block.getBlockFromItem( r.BlockItem.getItem() ); + final Block blk = Block.getBlockFromItem( r.BlockItem.getItem() ); w.setBlockState( pos, blk.getStateFromMeta( r.BlockItem.getItemDamage() ), 3 ); } else @@ -159,7 +159,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } } - private boolean canHeat( IBlockState state ) + private boolean canHeat( final IBlockState state ) { InWorldToolOperationResult r = this.heatUp.get( new InWorldToolOperationIngredient( state ) ); @@ -171,7 +171,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT return r != null; } - private void cool( IBlockState state, World w, BlockPos pos ) + private void cool( final IBlockState state, final World w, final BlockPos pos ) { InWorldToolOperationResult r = this.coolDown.get( new InWorldToolOperationIngredient( state ) ); @@ -182,7 +182,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT if( r.BlockItem != null ) { - Block blk = Block.getBlockFromItem( r.BlockItem.getItem() ); + final Block blk = Block.getBlockFromItem( r.BlockItem.getItem() ); w.setBlockState( pos, blk.getStateFromMeta( r.BlockItem.getItemDamage() ), 3 ); } else @@ -196,7 +196,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } } - private boolean canCool( IBlockState state ) + private boolean canCool( final IBlockState state ) { InWorldToolOperationResult r = this.coolDown.get( new InWorldToolOperationIngredient( state ) ); @@ -209,7 +209,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } @Override - public boolean hitEntity( ItemStack item, EntityLivingBase target, EntityLivingBase hitter ) + public boolean hitEntity( final ItemStack item, final EntityLivingBase target, final EntityLivingBase hitter ) { if( this.getAECurrentPower( item ) > 1600 ) { @@ -221,9 +221,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } @Override - public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer p ) { - MovingObjectPosition target = this.getMovingObjectPositionFromPlayer( w, p, true ); + final MovingObjectPosition target = this.getMovingObjectPositionFromPlayer( w, p, true ); if( target == null ) { @@ -248,14 +248,14 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT @Override public boolean onItemUse( - ItemStack item, - EntityPlayer p, - World w, - BlockPos pos, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final ItemStack item, + final EntityPlayer p, + final World w, + final BlockPos pos, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( this.getAECurrentPower( item ) > 1600 ) { @@ -264,8 +264,8 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT return false; } - IBlockState state = w.getBlockState( pos ); - Block blockID = state.getBlock(); + final IBlockState state = w.getBlockState( pos ); + final Block blockID = state.getBlock(); if( p.isSneaking() ) { @@ -299,14 +299,14 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT return true; } - ItemStack[] stack = Platform.getBlockDrops( w, pos ); - List out = new ArrayList(); + final ItemStack[] stack = Platform.getBlockDrops( w, pos ); + final List out = new ArrayList(); boolean hasFurnaceable = false; boolean canFurnaceable = true; - for( ItemStack i : stack ) + for( final ItemStack i : stack ) { - ItemStack result = FurnaceRecipes.instance().getSmeltingResult( i ); + final ItemStack result = FurnaceRecipes.instance().getSmeltingResult( i ); if( result != null ) { @@ -330,7 +330,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT if( hasFurnaceable && canFurnaceable ) { this.extractAEPower( item, 1600 ); - InWorldToolOperationResult or = InWorldToolOperationResult.getBlockOperationResult( out.toArray( new ItemStack[out.size()] ) ); + final InWorldToolOperationResult or = InWorldToolOperationResult.getBlockOperationResult( out.toArray( new ItemStack[out.size()] ) ); w.playSoundEffect( pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F ); if( or.BlockItem == null ) @@ -339,7 +339,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } else { - Block blk = Block.getBlockFromItem( or.BlockItem.getItem() ); + final Block blk = Block.getBlockFromItem( or.BlockItem.getItem() ); w.setBlockState( pos, blk.getStateFromMeta( or.BlockItem.getItemDamage() ), 3 ); } @@ -352,7 +352,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT } else { - BlockPos offsetPos = pos.offset( side ); + final BlockPos offsetPos = pos.offset( side ); if( !p.canPlayerEdit( offsetPos, side, item ) ) { diff --git a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java index c1276e31..445d12e1 100644 --- a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java +++ b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java @@ -96,15 +96,15 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); - IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( cdi instanceof CellInventoryHandler ) { - ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); + final ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); if( cd != null ) { lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() ); @@ -114,22 +114,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } @Override - public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer p ) { if( this.getAECurrentPower( item ) > 1600 ) { int shots = 1; - CellUpgrades cu = (CellUpgrades) this.getUpgradesInventory( item ); + final CellUpgrades cu = (CellUpgrades) this.getUpgradesInventory( item ); if( cu != null ) { shots += cu.getInstalledUpgrades( Upgrades.SPEED ); } - IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( item, null, StorageChannel.ITEMS ); + final IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( item, null, StorageChannel.ITEMS ); if( inv != null ) { - IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() ); + final IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() ); IAEStack aeAmmo = itemList.getFirstItem(); if( aeAmmo instanceof IAEItemStack ) { @@ -144,7 +144,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } aeAmmo.setStackSize( 1 ); - ItemStack ammo = ( (IAEItemStack) aeAmmo ).getItemStack(); + final ItemStack ammo = ( (IAEItemStack) aeAmmo ).getItemStack(); if( ammo == null ) { return item; @@ -157,21 +157,21 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell return item; } - LookDirection dir = Platform.getPlayerRay( p, p.getEyeHeight() ); + final LookDirection dir = Platform.getPlayerRay( p, p.getEyeHeight() ); - Vec3 vec3 = dir.a; - Vec3 vec31 = dir.b; - Vec3 direction = vec31.subtract( vec3 ); + final Vec3 vec3 = dir.a; + final Vec3 vec31 = dir.b; + final Vec3 direction = vec31.subtract( vec3 ); direction.normalize(); - double d0 = vec3.xCoord; - double d1 = vec3.yCoord; - double d2 = vec3.zCoord; + final double d0 = vec3.xCoord; + final double d1 = vec3.yCoord; + final double d2 = vec3.zCoord; - float penetration = AEApi.instance().registries().matterCannon().getPenetration( ammo ); // 196.96655f; + final float penetration = AEApi.instance().registries().matterCannon().getPenetration( ammo ); // 196.96655f; if( penetration <= 0 ) { - ItemStack type = ( (IAEItemStack) aeAmmo ).getItemStack(); + final ItemStack type = ( (IAEItemStack) aeAmmo ).getItemStack(); if( type.getItem() instanceof ItemPaintBall ) { this.shootPaintBalls( type, w, p, vec3, vec31, direction, d0, d1, d2 ); @@ -197,17 +197,17 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell return item; } - private void shootPaintBalls( ItemStack type, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2 ) + private void shootPaintBalls( final ItemStack type, final World w, final EntityPlayer p, final Vec3 vec3, final Vec3 vec31, final Vec3 direction, final double d0, final double d1, final double d2 ) { - AxisAlignedBB bb = AxisAlignedBB.fromBounds( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); + final AxisAlignedBB bb = AxisAlignedBB.fromBounds( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); Entity entity = null; - List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); + final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); double closest = 9999999.0D; for( int l = 0; l < list.size(); ++l ) { - Entity entity1 = (Entity) list.get( l ); + final Entity entity1 = (Entity) list.get( l ); if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) ) { @@ -219,14 +219,14 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell continue; } - float f1 = 0.3F; + final float f1 = 0.3F; - AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 ); - MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); + final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 ); + final MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); if( movingObjectPosition != null ) { - double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); + final double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); if( nd < closest ) { @@ -240,7 +240,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell MovingObjectPosition pos = w.rayTraceBlocks( vec3, vec31, false ); - Vec3 vec = new Vec3( d0, d1, d2 ); + final Vec3 vec = new Vec3( d0, d1, d2 ); if( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest ) { pos = new MovingObjectPosition( entity ); @@ -254,27 +254,27 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell { CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.xCoord, (float) direction.yCoord, (float) direction.zCoord, (byte) ( pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1 ) ) ); } - catch( Exception err ) + catch( final Exception err ) { AELog.error( err ); } if( pos != null && type != null && type.getItem() instanceof ItemPaintBall ) { - ItemPaintBall ipb = (ItemPaintBall) type.getItem(); + final ItemPaintBall ipb = (ItemPaintBall) type.getItem(); - AEColor col = ipb.getColor( type ); + final AEColor col = ipb.getColor( type ); // boolean lit = ipb.isLumen( type ); if( pos.typeOfHit == MovingObjectType.ENTITY ) { - int id = pos.entityHit.getEntityId(); - PlayerColor marker = new PlayerColor( id, col, 20 * 30 ); + final int id = pos.entityHit.getEntityId(); + final PlayerColor marker = new PlayerColor( id, col, 20 * 30 ); TickHandler.INSTANCE.getPlayerColors().put( id, marker ); if( pos.entityHit instanceof EntitySheep ) { - EntitySheep sh = (EntitySheep) pos.entityHit; + final EntitySheep sh = (EntitySheep) pos.entityHit; sh.setFleeceColor( col.dye ); } @@ -283,49 +283,49 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } else if( pos.typeOfHit == MovingObjectType.BLOCK ) { - EnumFacing side = pos.sideHit; - BlockPos hitPos = pos.getBlockPos().offset( side ); + final EnumFacing side = pos.sideHit; + final BlockPos hitPos = pos.getBlockPos().offset( side ); if( !Platform.hasPermissions( new DimensionalCoord( w, hitPos ), p ) ) { return; } - Block whatsThere = w.getBlockState( hitPos ).getBlock(); + final Block whatsThere = w.getBlockState( hitPos ).getBlock(); if( whatsThere.isReplaceable( w, hitPos ) && w.isAirBlock( hitPos ) ) { - for( Block paintBlock : AEApi.instance().definitions().blocks().paint().maybeBlock().asSet() ) + for( final Block paintBlock : AEApi.instance().definitions().blocks().paint().maybeBlock().asSet() ) { w.setBlockState( hitPos, paintBlock.getDefaultState(), 3 ); } } - TileEntity te = w.getTileEntity( hitPos ); + final TileEntity te = w.getTileEntity( hitPos ); if( te instanceof TilePaint ) { - Vec3 hp = pos.hitVec.subtract( hitPos.getX(), hitPos.getY(), hitPos.getZ() ); + final Vec3 hp = pos.hitVec.subtract( hitPos.getX(), hitPos.getY(), hitPos.getZ() ); ( (TilePaint) te ).addBlot( type, side.getOpposite(), hp ); } } } } - private void standardAmmo( float penetration, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2 ) + private void standardAmmo( float penetration, final World w, final EntityPlayer p, final Vec3 vec3, final Vec3 vec31, final Vec3 direction, final double d0, final double d1, final double d2 ) { boolean hasDestroyed = true; while( penetration > 0 && hasDestroyed ) { hasDestroyed = false; - AxisAlignedBB bb = AxisAlignedBB.fromBounds( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); + final AxisAlignedBB bb = AxisAlignedBB.fromBounds( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); Entity entity = null; - List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); + final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); double closest = 9999999.0D; for( int l = 0; l < list.size(); ++l ) { - Entity entity1 = (Entity) list.get( l ); + final Entity entity1 = (Entity) list.get( l ); if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) ) { @@ -337,14 +337,14 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell continue; } - float f1 = 0.3F; + final float f1 = 0.3F; - AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 ); - MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); + final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 ); + final MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); if( movingObjectPosition != null ) { - double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); + final double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); if( nd < closest ) { @@ -356,7 +356,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } } - Vec3 vec = new Vec3( d0, d1, d2 ); + final Vec3 vec = new Vec3( d0, d1, d2 ); MovingObjectPosition pos = w.rayTraceBlocks( vec3, vec31, true ); if( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest ) { @@ -371,22 +371,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell { CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.xCoord, (float) direction.yCoord, (float) direction.zCoord, (byte) ( pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1 ) ) ); } - catch( Exception err ) + catch( final Exception err ) { AELog.error( err ); } if( pos != null ) { - DamageSource dmgSrc = DamageSource.causePlayerDamage( p ); + final DamageSource dmgSrc = DamageSource.causePlayerDamage( p ); dmgSrc.damageType = "masscannon"; if( pos.typeOfHit == MovingObjectType.ENTITY ) { - int dmg = (int) Math.ceil( penetration / 20.0f ); + final int dmg = (int) Math.ceil( penetration / 20.0f ); if( pos.entityHit instanceof EntityLivingBase ) { - EntityLivingBase el = (EntityLivingBase) pos.entityHit; + final EntityLivingBase el = (EntityLivingBase) pos.entityHit; penetration -= dmg; el.knockBack( p, 0, -direction.xCoord, -direction.zCoord ); // el.knockBack( p, 0, vec3.xCoord, @@ -415,11 +415,11 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } else { - Block b = w.getBlockState( pos.getBlockPos() ).getBlock(); + final Block b = w.getBlockState( pos.getBlockPos() ).getBlock(); // int meta = w.getBlockMetadata( // pos.blockX, pos.blockY, pos.blockZ ); - float hardness = b.getBlockHardness( w, pos.getBlockPos() ) * 9.0f; + final float hardness = b.getBlockHardness( w, pos.getBlockPos() ) * 9.0f; if( hardness >= 0.0 ) { if( penetration > hardness && Platform.hasPermissions( new DimensionalCoord( w, pos.getBlockPos() ), p ) ) @@ -437,65 +437,65 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 4 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } @Override - public int getBytes( ItemStack cellItem ) + public int getBytes( final ItemStack cellItem ) { return 512; } @Override - public int getBytesPerType( ItemStack cellItem ) + public int getBytesPerType( final ItemStack cellItem ) { return 8; } @Override - public int getTotalTypes( ItemStack cellItem ) + public int getTotalTypes( final ItemStack cellItem ) { return 1; } @Override - public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition ) + public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition ) { - float pen = AEApi.instance().registries().matterCannon().getPenetration( requestedAddition.getItemStack() ); + final float pen = AEApi.instance().registries().matterCannon().getPenetration( requestedAddition.getItemStack() ); if( pen > 0 ) { return false; @@ -516,7 +516,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } @Override - public boolean isStorageCell( ItemStack i ) + public boolean isStorageCell( final ItemStack i ) { return true; } diff --git a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java index ab542c5d..729c8be3 100644 --- a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java +++ b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java @@ -66,7 +66,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer player ) + public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer player ) { Platform.openGUI( player, null, AEPartLocation.INTERNAL, GuiBridge.GUI_PORTABLE_CELL ); return item; @@ -80,15 +80,15 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); - IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); + final IMEInventory cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS ); if( cdi instanceof CellInventoryHandler ) { - ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); + final ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv(); if( cd != null ) { lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() ); @@ -98,25 +98,25 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public int getBytes( ItemStack cellItem ) + public int getBytes( final ItemStack cellItem ) { return 512; } @Override - public int getBytesPerType( ItemStack cellItem ) + public int getBytesPerType( final ItemStack cellItem ) { return 8; } @Override - public int getTotalTypes( ItemStack cellItem ) + public int getTotalTypes( final ItemStack cellItem ) { return 27; } @Override - public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition ) + public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition ) { return false; } @@ -128,7 +128,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public boolean isStorageCell( ItemStack i ) + public boolean isStorageCell( final ItemStack i ) { return true; } @@ -140,51 +140,51 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, } @Override - public String getUnlocalizedGroupName( Set others, ItemStack is ) + public String getUnlocalizedGroupName( final Set others, final ItemStack is ) { return GuiText.StorageCells.getUnlocalized(); } @Override - public boolean isEditable( ItemStack is ) + public boolean isEditable( final ItemStack is ) { return true; } @Override - public IInventory getUpgradesInventory( ItemStack is ) + public IInventory getUpgradesInventory( final ItemStack is ) { return new CellUpgrades( is, 2 ); } @Override - public IInventory getConfigInventory( ItemStack is ) + public IInventory getConfigInventory( final ItemStack is ) { return new CellConfig( is ); } @Override - public FuzzyMode getFuzzyMode( ItemStack is ) + public FuzzyMode getFuzzyMode( final ItemStack is ) { - String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); + final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" ); try { return FuzzyMode.valueOf( fz ); } - catch( Throwable t ) + catch( final Throwable t ) { return FuzzyMode.IGNORE_ALL; } } @Override - public void setFuzzyMode( ItemStack is, FuzzyMode fzMode ) + public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode ) { Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() ); } @Override - public IGuiItemObject getGuiObject( ItemStack is, World w, BlockPos pos ) + public IGuiItemObject getGuiObject( final ItemStack is, final World w, final BlockPos pos ) { return new PortableCellViewer( is, pos.getX() ); } diff --git a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java index b0e314b9..20cd775e 100644 --- a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java +++ b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java @@ -57,7 +57,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless } @Override - public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer player ) + public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer player ) { AEApi.instance().registries().wireless().openWirelessTerminalGui( item, w, player ); return item; @@ -71,16 +71,16 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { super.addCheckedInformation( stack, player, lines, displayMoreInfo ); if( stack.hasTagCompound() ) { - NBTTagCompound tag = Platform.openNbtData( stack ); + final NBTTagCompound tag = Platform.openNbtData( stack ); if( tag != null ) { - String encKey = tag.getString( "encryptionKey" ); + final String encKey = tag.getString( "encryptionKey" ); if( encKey == null || encKey.isEmpty() ) { @@ -99,19 +99,19 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless } @Override - public boolean canHandle( ItemStack is ) + public boolean canHandle( final ItemStack is ) { return AEApi.instance().definitions().items().wirelessTerminal().isSameAs( is ); } @Override - public boolean usePower( EntityPlayer player, double amount, ItemStack is ) + public boolean usePower( final EntityPlayer player, final double amount, final ItemStack is ) { return this.extractAEPower( is, amount ) >= amount - 0.5; } @Override - public boolean hasPower( EntityPlayer player, double amt, ItemStack is ) + public boolean hasPower( final EntityPlayer player, final double amt, final ItemStack is ) { return this.getAECurrentPower( is ) >= amt; } @@ -123,9 +123,9 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless { @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { - NBTTagCompound data = Platform.openNbtData( target ); + final NBTTagCompound data = Platform.openNbtData( target ); manager.writeToNBT( data ); } } ); @@ -139,16 +139,16 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless } @Override - public String getEncryptionKey( ItemStack item ) + public String getEncryptionKey( final ItemStack item ) { - NBTTagCompound tag = Platform.openNbtData( item ); + final NBTTagCompound tag = Platform.openNbtData( item ); return tag.getString( "encryptionKey" ); } @Override - public void setEncryptionKey( ItemStack item, String encKey, String name ) + public void setEncryptionKey( final ItemStack item, final String encKey, final String name ) { - NBTTagCompound tag = Platform.openNbtData( item ); + final NBTTagCompound tag = Platform.openNbtData( item ); tag.setString( "encryptionKey", encKey ); tag.setString( "name", name ); } diff --git a/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java b/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java index 904b1b32..ed6700b7 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java +++ b/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java @@ -24,7 +24,7 @@ import com.google.common.base.Optional; public abstract class AEBasePoweredItem extends AERootPoweredItem { - public AEBasePoweredItem( double powerCapacity, Optional subName ) + public AEBasePoweredItem( final double powerCapacity, final Optional subName ) { super( powerCapacity, subName ); diff --git a/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java b/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java index 6206d5e9..903652e3 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java +++ b/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java @@ -42,7 +42,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow private static final String POWER_NBT_KEY = "internalCurrentPower"; private final double powerCapacity; - public AERootPoweredItem( double powerCapacity, Optional subName ) + public AERootPoweredItem( final double powerCapacity, final Optional subName ) { super( subName ); this.setMaxDamage( 32 ); @@ -53,18 +53,18 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow } @Override - public void addCheckedInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo ) + public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo ) { - NBTTagCompound tag = stack.getTagCompound(); + final NBTTagCompound tag = stack.getTagCompound(); double internalCurrentPower = 0; - double internalMaxPower = this.getAEMaxPower( stack ); + final double internalMaxPower = this.getAEMaxPower( stack ); if( tag != null ) { internalCurrentPower = tag.getDouble( "internalCurrentPower" ); } - double percent = internalCurrentPower / internalMaxPower; + final double percent = internalCurrentPower / internalMaxPower; lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) ); } @@ -76,7 +76,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow } @Override - protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks ) + protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks ) { super.getCheckedSubItems( sameItem, creativeTab, itemStacks ); @@ -95,29 +95,29 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow } @Override - public double getDurabilityForDisplay( ItemStack is ) + public double getDurabilityForDisplay( final ItemStack is ) { return 1 - this.getAECurrentPower( is ) / this.getAEMaxPower( is ); } @Override - public boolean isDamaged( ItemStack stack ) + public boolean isDamaged( final ItemStack stack ) { return true; } @Override - public void setDamage( ItemStack stack, int damage ) + public void setDamage( final ItemStack stack, final int damage ) { } - private double getInternalBattery( ItemStack is, batteryOperation op, double adjustment ) + private double getInternalBattery( final ItemStack is, final batteryOperation op, final double adjustment ) { - NBTTagCompound data = Platform.openNbtData( is ); + final NBTTagCompound data = Platform.openNbtData( is ); double currentStorage = data.getDouble( POWER_NBT_KEY ); - double maxStorage = this.getAEMaxPower( is ); + final double maxStorage = this.getAEMaxPower( is ); switch( op ) { @@ -125,7 +125,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow currentStorage += adjustment; if( currentStorage > maxStorage ) { - double diff = currentStorage - maxStorage; + final double diff = currentStorage - maxStorage; data.setDouble( POWER_NBT_KEY, maxStorage ); return diff; } @@ -150,11 +150,11 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow /** * inject external */ - double injectExternalPower( PowerUnits input, ItemStack is, double amount, boolean simulate ) + double injectExternalPower( final PowerUnits input, final ItemStack is, final double amount, final boolean simulate ) { if( simulate ) { - int requiredEU = (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( is ) - this.getAECurrentPower( is ) ); + final int requiredEU = (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( is ) - this.getAECurrentPower( is ) ); if( amount < requiredEU ) { return 0; @@ -163,37 +163,37 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow } else { - double powerRemainder = this.injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) ); + final double powerRemainder = this.injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) ); return PowerUnits.AE.convertTo( PowerUnits.EU, powerRemainder ); } } @Override - public double injectAEPower( ItemStack is, double amt ) + public double injectAEPower( final ItemStack is, final double amt ) { return this.getInternalBattery( is, batteryOperation.INJECT, amt ); } @Override - public double extractAEPower( ItemStack is, double amt ) + public double extractAEPower( final ItemStack is, final double amt ) { return this.getInternalBattery( is, batteryOperation.EXTRACT, amt ); } @Override - public double getAEMaxPower( ItemStack is ) + public double getAEMaxPower( final ItemStack is ) { return this.powerCapacity; } @Override - public double getAECurrentPower( ItemStack is ) + public double getAECurrentPower( final ItemStack is ) { return this.getInternalBattery( is, batteryOperation.STORAGE, 0 ); } @Override - public AccessRestriction getPowerFlow( ItemStack is ) + public AccessRestriction getPowerFlow( final ItemStack is ) { return AccessRestriction.WRITE; } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java index 1f6879b2..91274093 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java @@ -37,7 +37,7 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature private final AEFeature type; private final IFeatureHandler feature; - public ToolQuartzAxe( AEFeature type ) + public ToolQuartzAxe( final AEFeature type ) { super( ToolMaterial.IRON ); this.feature = new ItemFeatureHandler( EnumSet.of( this.type = type, AEFeature.QuartzAxe ), this, this, Optional.of( type.name() ) ); @@ -56,7 +56,7 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.type, a, b ); } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java index a057da3a..8493284f 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java @@ -42,7 +42,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem { private final AEFeature type; - public ToolQuartzCuttingKnife( AEFeature type ) + public ToolQuartzCuttingKnife( final AEFeature type ) { super( Optional.of( type.name() ) ); @@ -54,14 +54,14 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem @Override public boolean onItemUse( - ItemStack stack, - EntityPlayer p, - World worldIn, - BlockPos pos, - EnumFacing side, - float hitX, - float hitY, - float hitZ ) + final ItemStack stack, + final EntityPlayer p, + final World worldIn, + final BlockPos pos, + final EnumFacing side, + final float hitX, + final float hitY, + final float hitZ ) { if( Platform.isServer() ) { @@ -71,7 +71,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem } @Override - public ItemStack onItemRightClick( ItemStack it, World w, EntityPlayer p ) + public ItemStack onItemRightClick( final ItemStack it, final World w, final EntityPlayer p ) { if( Platform.isServer() ) { @@ -82,7 +82,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.type, a, b ); } @@ -94,20 +94,20 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem } @Override - public ItemStack getContainerItem( ItemStack itemStack ) + public ItemStack getContainerItem( final ItemStack itemStack ) { itemStack.setItemDamage( itemStack.getItemDamage() + 1 ); return itemStack; } @Override - public boolean hasContainerItem( ItemStack stack ) + public boolean hasContainerItem( final ItemStack stack ) { return true; } @Override - public IGuiItemObject getGuiObject( ItemStack is, World world, BlockPos pos ) + public IGuiItemObject getGuiObject( final ItemStack is, final World world, final BlockPos pos ) { return new QuartzKnifeObj( is ); } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java index e20afa00..f2c8a34c 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java @@ -37,7 +37,7 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature private final AEFeature feature; private final IFeatureHandler handler; - public ToolQuartzHoe( AEFeature feature ) + public ToolQuartzHoe( final AEFeature feature ) { super( ToolMaterial.IRON ); @@ -58,7 +58,7 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.feature, a, b ); } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java index b80c06be..2c204538 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java @@ -37,7 +37,7 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature private final AEFeature type; private final IFeatureHandler feature; - public ToolQuartzPickaxe( AEFeature type ) + public ToolQuartzPickaxe( final AEFeature type ) { super( ToolMaterial.IRON ); @@ -58,7 +58,7 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.type, a, b ); } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java index 725d5a21..3515a247 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java @@ -37,7 +37,7 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature private final AEFeature type; private final IFeatureHandler handler; - public ToolQuartzSpade( AEFeature type ) + public ToolQuartzSpade( final AEFeature type ) { super( ToolMaterial.IRON ); @@ -57,7 +57,7 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.type, a, b ); } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java index f9e98736..23f11c9d 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java @@ -37,7 +37,7 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature private final AEFeature type; private final IFeatureHandler feature; - public ToolQuartzSword( AEFeature type ) + public ToolQuartzSword( final AEFeature type ) { super( ToolMaterial.IRON ); this.feature = new ItemFeatureHandler( EnumSet.of( this.type = type, AEFeature.QuartzSword ), this, this, Optional.of( type.name() ) ); @@ -56,7 +56,7 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature } @Override - public boolean getIsRepairable( ItemStack a, ItemStack b ) + public boolean getIsRepairable( final ItemStack a, final ItemStack b ) { return Platform.canRepair( this.type, a, b ); } diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java index c5e4fc6f..0182b2f6 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java @@ -41,7 +41,7 @@ import com.google.common.base.Optional; public class ToolQuartzWrench extends AEBaseItem implements IAEWrench /*, IToolWrench */ { - public ToolQuartzWrench( AEFeature type ) + public ToolQuartzWrench( final AEFeature type ) { super( Optional.of( type.name() ) ); @@ -52,16 +52,16 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench /*, IToolW @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 ) { - Block b = world.getBlockState( pos ).getBlock(); + final Block b = world.getBlockState( pos ).getBlock(); if( b != null && !player.isSneaking() && Platform.hasPermissions( new DimensionalCoord( world, pos ), player ) ) { if( Platform.isClient() ) @@ -81,18 +81,18 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench /*, IToolW @Override public boolean doesSneakBypassUse( - World world, - BlockPos pos, - EntityPlayer player ) + final World world, + final BlockPos pos, + final EntityPlayer player ) { return true; } @Override public boolean canWrench( - ItemStack wrench, - EntityPlayer player, - BlockPos pos ) + final ItemStack wrench, + final EntityPlayer player, + final BlockPos pos ) { return true; } diff --git a/src/main/java/appeng/me/Grid.java b/src/main/java/appeng/me/Grid.java index 80c18318..8bd513f8 100644 --- a/src/main/java/appeng/me/Grid.java +++ b/src/main/java/appeng/me/Grid.java @@ -50,16 +50,16 @@ public class Grid implements IGrid private int priority; // how import is this network? private GridStorage myStorage; - public Grid( GridNode center ) + public Grid( final GridNode center ) { this.pivot = center; - Map, IGridCache> myCaches = AEApi.instance().registries().gridCache().createCacheInstance( this ); - for( Entry, IGridCache> c : myCaches.entrySet() ) + final Map, IGridCache> myCaches = AEApi.instance().registries().gridCache().createCacheInstance( this ); + for( final Entry, IGridCache> c : myCaches.entrySet() ) { - Class key = c.getKey(); - IGridCache value = c.getValue(); - Class valueClass = value.getClass(); + final Class key = c.getKey(); + final IGridCache value = c.getValue(); + final Class valueClass = value.getClass(); this.eventBus.readClass( key, valueClass ); this.caches.put( key, new GridCacheWrapper( value ) ); @@ -94,23 +94,23 @@ public class Grid implements IGrid public int size() { int out = 0; - for( Collection x : this.machines.values() ) + for( final Collection x : this.machines.values() ) { out += x.size(); } return out; } - public void remove( GridNode gridNode ) + public void remove( final GridNode gridNode ) { - for( IGridCache c : this.caches.values() ) + for( final IGridCache c : this.caches.values() ) { - IGridHost machine = gridNode.getMachine(); + final IGridHost machine = gridNode.getMachine(); c.removeNode( gridNode, machine ); } - Class machineClass = gridNode.getMachineClass(); - Set nodes = this.machines.get( machineClass ); + final Class machineClass = gridNode.getMachineClass(); + final Set nodes = this.machines.get( machineClass ); if( nodes != null ) { nodes.remove( gridNode ); @@ -120,7 +120,7 @@ public class Grid implements IGrid if( this.pivot == gridNode ) { - Iterator n = this.getNodes().iterator(); + final Iterator n = this.getNodes().iterator(); if( n.hasNext() ) { this.pivot = (GridNode) n.next(); @@ -134,9 +134,9 @@ public class Grid implements IGrid } } - public void add( GridNode gridNode ) + public void add( final GridNode gridNode ) { - Class mClass = gridNode.getMachineClass(); + final Class mClass = gridNode.getMachineClass(); MachineSet nodes = this.machines.get( mClass ); if( nodes == null ) @@ -149,15 +149,15 @@ public class Grid implements IGrid // handle loading grid storages. if( gridNode.getGridStorage() != null ) { - GridStorage gs = gridNode.getGridStorage(); - IGrid grid = gs.getGrid(); + final GridStorage gs = gridNode.getGridStorage(); + final IGrid grid = gs.getGrid(); if( grid == null ) { this.myStorage = gs; this.myStorage.setGrid( this ); - for( IGridCache gc : this.caches.values() ) + for( final IGridCache gc : this.caches.values() ) { gc.onJoin( this.myStorage ); } @@ -170,17 +170,17 @@ public class Grid implements IGrid this.myStorage.setGrid( this ); } - IGridStorage tmp = new GridStorage(); + final IGridStorage tmp = new GridStorage(); if( !gs.hasDivided( this.myStorage ) ) { gs.addDivided( this.myStorage ); - for( IGridCache gc : ( (Grid) grid ).caches.values() ) + for( final IGridCache gc : ( (Grid) grid ).caches.values() ) { gc.onSplit( tmp ); } - for( IGridCache gc : this.caches.values() ) + for( final IGridCache gc : this.caches.values() ) { gc.onJoin( tmp ); } @@ -199,9 +199,9 @@ public class Grid implements IGrid // track node. nodes.add( gridNode ); - for( IGridCache cache : this.caches.values() ) + for( final IGridCache cache : this.caches.values() ) { - IGridHost machine = gridNode.getMachine(); + final IGridHost machine = gridNode.getMachine(); cache.addNode( gridNode, machine ); } @@ -211,19 +211,19 @@ public class Grid implements IGrid @Override @SuppressWarnings( "unchecked" ) - public C getCache( Class iface ) + public C getCache( final Class iface ) { return (C) this.caches.get( iface ).myCache; } @Override - public MENetworkEvent postEvent( MENetworkEvent ev ) + public MENetworkEvent postEvent( final MENetworkEvent ev ) { return this.eventBus.postEvent( this, ev ); } @Override - public MENetworkEvent postEventTo( IGridNode node, MENetworkEvent ev ) + public MENetworkEvent postEventTo( final IGridNode node, final MENetworkEvent ev ) { return this.eventBus.postEventTo( this, (GridNode) node, ev ); } @@ -231,15 +231,15 @@ public class Grid implements IGrid @Override public IReadOnlyCollection> getMachinesClasses() { - Set> machineKeys = this.machines.keySet(); + final Set> machineKeys = this.machines.keySet(); return new ReadOnlyCollection>( machineKeys ); } @Override - public IMachineSet getMachines( Class c ) + public IMachineSet getMachines( final Class c ) { - MachineSet s = this.machines.get( c ); + final MachineSet s = this.machines.get( c ); if( s == null ) { return new MachineSet( c ); @@ -265,14 +265,14 @@ public class Grid implements IGrid return this.pivot; } - public void setPivot( GridNode pivot ) + public void setPivot( final GridNode pivot ) { this.pivot = pivot; } public void update() { - for( IGridCache gc : this.caches.values() ) + for( final IGridCache gc : this.caches.values() ) { // are there any nodes left? if( this.pivot != null ) @@ -284,15 +284,15 @@ public class Grid implements IGrid public void saveState() { - for( IGridCache c : this.caches.values() ) + for( final IGridCache c : this.caches.values() ) { c.populateGridStorage( this.myStorage ); } } - public void setImportantFlag( int i, boolean publicHasPower ) + public void setImportantFlag( final int i, final boolean publicHasPower ) { - int flag = 1 << i; + final int flag = 1 << i; this.priority = ( this.priority & ~flag ) | ( publicHasPower ? flag : 0 ); } } diff --git a/src/main/java/appeng/me/GridConnection.java b/src/main/java/appeng/me/GridConnection.java index 09fa53af..5e7d3f0d 100644 --- a/src/main/java/appeng/me/GridConnection.java +++ b/src/main/java/appeng/me/GridConnection.java @@ -49,11 +49,11 @@ public class GridConnection implements IGridConnection, IPathItem private AEPartLocation fromAtoB; private GridNode sideB; - public GridConnection( IGridNode aNode, IGridNode bNode, AEPartLocation fromAtoB ) throws FailedConnection + public GridConnection( final IGridNode aNode, final IGridNode bNode, final AEPartLocation fromAtoB ) throws FailedConnection { - GridNode a = (GridNode) aNode; - GridNode b = (GridNode) bNode; + final GridNode a = (GridNode) aNode; + final GridNode b = (GridNode) bNode; if( Platform.securityCheck( a, b ) ) { @@ -93,41 +93,41 @@ public class GridConnection implements IGridConnection, IPathItem { if( a.getMyGrid() == null ) { - GridPropagator gp = new GridPropagator( b.getInternalGrid() ); + final GridPropagator gp = new GridPropagator( b.getInternalGrid() ); a.beginVisit( gp ); } else if( b.getMyGrid() == null ) { - GridPropagator gp = new GridPropagator( a.getInternalGrid() ); + final GridPropagator gp = new GridPropagator( a.getInternalGrid() ); b.beginVisit( gp ); } else if( this.isNetworkABetter( a, b ) ) { - GridPropagator gp = new GridPropagator( a.getInternalGrid() ); + final GridPropagator gp = new GridPropagator( a.getInternalGrid() ); b.beginVisit( gp ); } else { - GridPropagator gp = new GridPropagator( b.getInternalGrid() ); + final GridPropagator gp = new GridPropagator( b.getInternalGrid() ); a.beginVisit( gp ); } } // a connection was destroyed RE-PATH!! - IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); + final IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); p.repath(); this.sideA.addConnection( this ); this.sideB.addConnection( this ); } - private boolean isNetworkABetter( GridNode a, GridNode b ) + private boolean isNetworkABetter( final GridNode a, final GridNode b ) { return a.getMyGrid().getPriority() > b.getMyGrid().getPriority() || a.getMyGrid().size() > b.getMyGrid().size(); } @Override - public IGridNode getOtherSide( IGridNode gridNode ) + public IGridNode getOtherSide( final IGridNode gridNode ) { if( gridNode == this.sideA ) { @@ -142,7 +142,7 @@ public class GridConnection implements IGridConnection, IPathItem } @Override - public AEPartLocation getDirection( IGridNode side ) + public AEPartLocation getDirection( final IGridNode side ) { if( this.fromAtoB == AEPartLocation.INTERNAL ) { @@ -163,7 +163,7 @@ public class GridConnection implements IGridConnection, IPathItem public void destroy() { // a connection was destroyed RE-PATH!! - IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); + final IPathingGrid p = this.sideA.getInternalGrid().getCache( IPathingGrid.class ); p.repath(); this.sideA.removeConnection( this ); @@ -208,7 +208,7 @@ public class GridConnection implements IGridConnection, IPathItem } @Override - public void setControllerRoute( IPathItem fast, boolean zeroOut ) + public void setControllerRoute( final IPathItem fast, final boolean zeroOut ) { if( zeroOut ) { @@ -217,7 +217,7 @@ public class GridConnection implements IGridConnection, IPathItem if( this.sideB == fast ) { - GridNode tmp = this.sideA; + final GridNode tmp = this.sideA; this.sideA = this.sideB; this.sideB = tmp; this.fromAtoB = this.fromAtoB.getOpposite(); @@ -237,7 +237,7 @@ public class GridConnection implements IGridConnection, IPathItem } @Override - public void incrementChannelCount( int usedChannels ) + public void incrementChannelCount( final int usedChannels ) { this.channelData += usedChannels; } diff --git a/src/main/java/appeng/me/GridException.java b/src/main/java/appeng/me/GridException.java index ad236ee7..5a3f418b 100644 --- a/src/main/java/appeng/me/GridException.java +++ b/src/main/java/appeng/me/GridException.java @@ -24,7 +24,7 @@ public class GridException extends RuntimeException private static final long serialVersionUID = -8110077032108243076L; - public GridException( String s ) + public GridException( final String s ) { super( s ); diff --git a/src/main/java/appeng/me/GridNode.java b/src/main/java/appeng/me/GridNode.java index 4917cd2c..81ef4751 100644 --- a/src/main/java/appeng/me/GridNode.java +++ b/src/main/java/appeng/me/GridNode.java @@ -75,7 +75,7 @@ public class GridNode implements IGridNode, IPathItem private int usedChannels = 0; private int lastUsedChannels = 0; - public GridNode( IGridBlock what ) + public GridNode( final IGridBlock what ) { this.gridProxy = what; } @@ -100,7 +100,7 @@ public class GridNode implements IGridNode, IPathItem return this.getMachine().getClass(); } - public void addConnection( IGridConnection gridConnection ) + public void addConnection( final IGridConnection gridConnection ) { this.connections.add( gridConnection ); if( gridConnection.hasDirection() ) @@ -113,7 +113,7 @@ public class GridNode implements IGridNode, IPathItem Collections.sort( this.connections, new ConnectionComparator( gn ) ); } - public void removeConnection( IGridConnection gridConnection ) + public void removeConnection( final IGridConnection gridConnection ) { this.connections.remove( gridConnection ); if( gridConnection.hasDirection() ) @@ -122,9 +122,9 @@ public class GridNode implements IGridNode, IPathItem } } - public boolean hasConnection( IGridNode otherSide ) + public boolean hasConnection( final IGridNode otherSide ) { - for( IGridConnection gc : this.connections ) + for( final IGridConnection gc : this.connections ) { if( gc.a() == otherSide || gc.b() == otherSide ) { @@ -136,11 +136,11 @@ public class GridNode implements IGridNode, IPathItem public void validateGrid() { - GridSplitDetector gsd = new GridSplitDetector( this.getInternalGrid().getPivot() ); + final GridSplitDetector gsd = new GridSplitDetector( this.getInternalGrid().getPivot() ); this.beginVisit( gsd ); if( !gsd.pivotFound ) { - IGridVisitor gp = new GridPropagator( new Grid( this ) ); + final IGridVisitor gp = new GridPropagator( new Grid( this ) ); this.beginVisit( gp ); } } @@ -156,9 +156,9 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void beginVisit( IGridVisitor g ) + public void beginVisit( final IGridVisitor g ) { - Object tracker = new Object(); + final Object tracker = new Object(); LinkedList nextRun = new LinkedList(); nextRun.add( this ); @@ -167,8 +167,8 @@ public class GridNode implements IGridNode, IPathItem if( g instanceof IGridConnectionVisitor ) { - LinkedList nextConn = new LinkedList(); - IGridConnectionVisitor gcv = (IGridConnectionVisitor) g; + final LinkedList nextConn = new LinkedList(); + final IGridConnectionVisitor gcv = (IGridConnectionVisitor) g; while( !nextRun.isEmpty() ) { @@ -177,10 +177,10 @@ public class GridNode implements IGridNode, IPathItem gcv.visitConnection( nextConn.poll() ); } - Iterable thisRun = nextRun; + final Iterable thisRun = nextRun; nextRun = new LinkedList(); - for( GridNode n : thisRun ) + for( final GridNode n : thisRun ) { n.visitorConnection( tracker, g, nextRun, nextConn ); } @@ -190,10 +190,10 @@ public class GridNode implements IGridNode, IPathItem { while( !nextRun.isEmpty() ) { - Iterable thisRun = nextRun; + final Iterable thisRun = nextRun; nextRun = new LinkedList(); - for( GridNode n : thisRun ) + for( final GridNode n : thisRun ) { n.visitorNode( tracker, g, nextRun ); } @@ -204,13 +204,13 @@ public class GridNode implements IGridNode, IPathItem @Override public void updateState() { - EnumSet set = this.gridProxy.getFlags(); + final EnumSet set = this.gridProxy.getFlags(); this.compressedData = set.contains( GridFlags.CANNOT_CARRY ) ? 0 : ( set.contains( GridFlags.DENSE_CAPACITY ) ? 2 : 1 ); this.compressedData |= ( this.gridProxy.getGridColor().ordinal() << 3 ); - for( EnumFacing dir : this.gridProxy.getConnectableSides() ) + for( final EnumFacing dir : this.gridProxy.getConnectableSides() ) { this.compressedData |= ( 1 << ( dir.ordinal() + 8 ) ); } @@ -231,7 +231,7 @@ public class GridNode implements IGridNode, IPathItem return this.myGrid; } - public void setGrid( Grid grid ) + public void setGrid( final Grid grid ) { if( this.myGrid == grid ) { @@ -246,7 +246,7 @@ public class GridNode implements IGridNode, IPathItem { this.myGrid.saveState(); - for( IGridCache c : grid.getCaches().values() ) + for( final IGridCache c : grid.getCaches().values() ) { c.onJoin( this.myGrid.getMyStorage() ); } @@ -268,8 +268,8 @@ public class GridNode implements IGridNode, IPathItem this.setGridStorage( null ); } - IGridConnection c = this.connections.listIterator().next(); - GridNode otherSide = (GridNode) c.getOtherSide( this ); + final IGridConnection c = this.connections.listIterator().next(); + final GridNode otherSide = (GridNode) c.getOtherSide( this ); otherSide.getInternalGrid().setPivot( otherSide ); c.destroy(); } @@ -289,8 +289,8 @@ public class GridNode implements IGridNode, IPathItem @Override public EnumSet getConnectedSides() { - EnumSet set = EnumSet.noneOf( AEPartLocation.class ); - for( IGridConnection gc : this.connections ) + final EnumSet set = EnumSet.noneOf( AEPartLocation.class ); + for( final IGridConnection gc : this.connections ) { set.add( gc.getDirection( this ) ); } @@ -312,22 +312,22 @@ public class GridNode implements IGridNode, IPathItem @Override public boolean isActive() { - IGrid g = this.getGrid(); + final IGrid g = this.getGrid(); if( g != null ) { - IPathingGrid pg = g.getCache( IPathingGrid.class ); - IEnergyGrid eg = g.getCache( IEnergyGrid.class ); + final IPathingGrid pg = g.getCache( IPathingGrid.class ); + final IEnergyGrid eg = g.getCache( IEnergyGrid.class ); return this.meetsChannelRequirements() && eg.isNetworkPowered() && !pg.isNetworkBooting(); } return false; } @Override - public void loadFromNBT( String name, NBTTagCompound nodeData ) + public void loadFromNBT( final String name, final NBTTagCompound nodeData ) { if( this.myGrid == null ) { - NBTTagCompound node = nodeData.getCompoundTag( name ); + final NBTTagCompound node = nodeData.getCompoundTag( name ); this.playerID = node.getInteger( "p" ); this.lastSecurityKey = node.getLong( "k" ); @@ -342,11 +342,11 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void saveToNBT( String name, NBTTagCompound nodeData ) + public void saveToNBT( final String name, final NBTTagCompound nodeData ) { if( this.myStorage != null ) { - NBTTagCompound node = new NBTTagCompound(); + final NBTTagCompound node = new NBTTagCompound(); node.setInteger( "p", this.playerID ); node.setLong( "k", this.lastSecurityKey ); @@ -367,7 +367,7 @@ public class GridNode implements IGridNode, IPathItem } @Override - public boolean hasFlag( GridFlags flag ) + public boolean hasFlag( final GridFlags flag ) { return this.gridProxy.getFlags().contains( flag ); } @@ -379,7 +379,7 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void setPlayerID( int playerID ) + public void setPlayerID( final int playerID ) { if( playerID >= 0 ) { @@ -399,25 +399,25 @@ public class GridNode implements IGridNode, IPathItem return; } - EnumSet newSecurityConnections = EnumSet.noneOf( AEPartLocation.class ); + final EnumSet newSecurityConnections = EnumSet.noneOf( AEPartLocation.class ); - DimensionalCoord dc = this.gridProxy.getLocation(); - for( AEPartLocation f : AEPartLocation.SIDE_LOCATIONS ) + final DimensionalCoord dc = this.gridProxy.getLocation(); + for( final AEPartLocation f : AEPartLocation.SIDE_LOCATIONS ) { - IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.xOffset, dc.y + f.yOffset, dc.z + f.zOffset ); + final IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.xOffset, dc.y + f.yOffset, dc.z + f.zOffset ); if( te != null ) { - GridNode node = (GridNode) te.getGridNode( f.getOpposite() ); + final GridNode node = (GridNode) te.getGridNode( f.getOpposite() ); if( node == null ) { continue; } - boolean isValidConnection = this.canConnect( node, f ) && node.canConnect( this, f.getOpposite() ); + final boolean isValidConnection = this.canConnect( node, f ) && node.canConnect( this, f.getOpposite() ); IGridConnection con = null; // find the connection for this // direction.. - for( IGridConnection c : this.getConnections() ) + for( final IGridConnection c : this.getConnections() ) { if( c.getDirection( this ) == f ) { @@ -428,7 +428,7 @@ public class GridNode implements IGridNode, IPathItem if( con != null ) { - IGridNode os = con.getOtherSide( this ); + final IGridNode os = con.getOtherSide( this ); if( os == node ) { // if this connection is no longer valid, destroy it. @@ -456,7 +456,7 @@ public class GridNode implements IGridNode, IPathItem { new GridConnection( node, this, f.getOpposite() ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { TickHandler.INSTANCE.addCallable( node.getWorld(), new MachineSecurityBreak( this ) ); @@ -467,12 +467,12 @@ public class GridNode implements IGridNode, IPathItem } } - for( AEPartLocation f : newSecurityConnections ) + for( final AEPartLocation f : newSecurityConnections ) { - IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.xOffset, dc.y + f.yOffset, dc.z + f.zOffset ); + final IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.xOffset, dc.y + f.yOffset, dc.z + f.zOffset ); if( te != null ) { - GridNode node = (GridNode) te.getGridNode( f.getOpposite() ); + final GridNode node = (GridNode) te.getGridNode( f.getOpposite() ); if( node == null ) { continue; @@ -483,7 +483,7 @@ public class GridNode implements IGridNode, IPathItem { new GridConnection( node, this, f.getOpposite() ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { TickHandler.INSTANCE.addCallable( node.getWorld(), new MachineSecurityBreak( this ) ); @@ -493,12 +493,12 @@ public class GridNode implements IGridNode, IPathItem } } - private IGridHost findGridHost( World world, int x, int y, int z ) + private IGridHost findGridHost( final World world, final int x, final int y, final int z ) { - BlockPos pos = new BlockPos(x,y,z); + final BlockPos pos = new BlockPos(x,y,z); if( world.isBlockLoaded( pos ) ) { - TileEntity te = world.getTileEntity( pos ); + final TileEntity te = world.getTileEntity( pos ); if( te instanceof IGridHost ) { return (IGridHost) te; @@ -507,7 +507,7 @@ public class GridNode implements IGridNode, IPathItem return null; } - public boolean canConnect( GridNode from, AEPartLocation dir ) + public boolean canConnect( final GridNode from, final AEPartLocation dir ) { if( !this.isValidDirection( dir ) ) { @@ -522,7 +522,7 @@ public class GridNode implements IGridNode, IPathItem return true; } - private boolean isValidDirection( AEPartLocation dir ) + private boolean isValidDirection( final AEPartLocation dir ) { return ( this.compressedData & ( 1 << ( 8 + dir.ordinal() ) ) ) > 0; } @@ -532,14 +532,14 @@ public class GridNode implements IGridNode, IPathItem return AEColor.values()[( this.compressedData >> 3 ) & 0x1F]; } - private void visitorConnection( Object tracker, IGridVisitor g, Deque nextRun, Deque nextConnections ) + private void visitorConnection( final Object tracker, final IGridVisitor g, final Deque nextRun, final Deque nextConnections ) { if( g.visitNode( this ) ) { - for( IGridConnection gc : this.getConnections() ) + for( final IGridConnection gc : this.getConnections() ) { - GridNode gn = (GridNode) gc.getOtherSide( this ); - GridConnection gcc = (GridConnection) gc; + final GridNode gn = (GridNode) gc.getOtherSide( this ); + final GridConnection gcc = (GridConnection) gc; if( gcc.visitorIterationNumber != tracker ) { @@ -559,13 +559,13 @@ public class GridNode implements IGridNode, IPathItem } } - private void visitorNode( Object tracker, IGridVisitor g, Deque nextRun ) + private void visitorNode( final Object tracker, final IGridVisitor g, final Deque nextRun ) { if( g.visitNode( this ) ) { - for( IGridConnection gc : this.getConnections() ) + for( final IGridConnection gc : this.getConnections() ) { - GridNode gn = (GridNode) gc.getOtherSide( this ); + final GridNode gn = (GridNode) gc.getOtherSide( this ); if( tracker == gn.visitorIterationNumber ) { @@ -584,7 +584,7 @@ public class GridNode implements IGridNode, IPathItem return this.myStorage; } - public void setGridStorage( GridStorage s ) + public void setGridStorage( final GridStorage s ) { this.myStorage = s; this.usedChannels = 0; @@ -603,14 +603,14 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void setControllerRoute( IPathItem fast, boolean zeroOut ) + public void setControllerRoute( final IPathItem fast, final boolean zeroOut ) { if( zeroOut ) { this.usedChannels = 0; } - int idx = this.connections.indexOf( fast ); + final int idx = this.connections.indexOf( fast ); if( idx > 0 ) { this.connections.remove( fast ); @@ -636,7 +636,7 @@ public class GridNode implements IGridNode, IPathItem } @Override - public void incrementChannelCount( int usedChannels ) + public void incrementChannelCount( final int usedChannels ) { this.usedChannels += usedChannels; } @@ -675,13 +675,13 @@ public class GridNode implements IGridNode, IPathItem { private final GridNode node; - public MachineSecurityBreak( GridNode node ) + public MachineSecurityBreak( final GridNode node ) { this.node = node; } @Override - public Void call(World world) throws Exception + public Void call( final World world) throws Exception { this.node.getMachine().securityBreak(); @@ -693,16 +693,16 @@ public class GridNode implements IGridNode, IPathItem { private final IGridNode gn; - public ConnectionComparator( IGridNode gn ) + public ConnectionComparator( final IGridNode gn ) { this.gn = gn; } @Override - public int compare( IGridConnection o1, IGridConnection o2 ) + public int compare( final IGridConnection o1, final IGridConnection o2 ) { - boolean preferredA = o1.getOtherSide( this.gn ).hasFlag( GridFlags.PREFERRED ); - boolean preferredB = o2.getOtherSide( this.gn ).hasFlag( GridFlags.PREFERRED ); + final boolean preferredA = o1.getOtherSide( this.gn ).hasFlag( GridFlags.PREFERRED ); + final boolean preferredB = o2.getOtherSide( this.gn ).hasFlag( GridFlags.PREFERRED ); return preferredA == preferredB ? 0 : ( preferredA ? -1 : 1 ); } diff --git a/src/main/java/appeng/me/GridNodeCollection.java b/src/main/java/appeng/me/GridNodeCollection.java index 4895b4e3..e0a8515b 100644 --- a/src/main/java/appeng/me/GridNodeCollection.java +++ b/src/main/java/appeng/me/GridNodeCollection.java @@ -32,7 +32,7 @@ public class GridNodeCollection implements IReadOnlyCollection { private final Map, MachineSet> machines; - public GridNodeCollection( Map, MachineSet> machines ) + public GridNodeCollection( final Map, MachineSet> machines ) { this.machines = machines; } @@ -48,7 +48,7 @@ public class GridNodeCollection implements IReadOnlyCollection { int size = 0; - for( Set o : this.machines.values() ) + for( final Set o : this.machines.values() ) { size += o.size(); } @@ -59,7 +59,7 @@ public class GridNodeCollection implements IReadOnlyCollection @Override public boolean isEmpty() { - for( Set o : this.machines.values() ) + for( final Set o : this.machines.values() ) { if( !o.isEmpty() ) { @@ -71,17 +71,17 @@ public class GridNodeCollection implements IReadOnlyCollection } @Override - public boolean contains( Object maybeGridNode ) + public boolean contains( final Object maybeGridNode ) { final boolean doesContainNode; if( maybeGridNode instanceof IGridNode ) { final IGridNode node = (IGridNode) maybeGridNode; - IGridHost machine = node.getMachine(); - Class machineClass = machine.getClass(); + final IGridHost machine = node.getMachine(); + final Class machineClass = machine.getClass(); - MachineSet machineSet = this.machines.get( machineClass ); + final MachineSet machineSet = this.machines.get( machineClass ); doesContainNode = machineSet != null && machineSet.contains( maybeGridNode ); } diff --git a/src/main/java/appeng/me/GridNodeIterator.java b/src/main/java/appeng/me/GridNodeIterator.java index ede34600..5a460ab7 100644 --- a/src/main/java/appeng/me/GridNodeIterator.java +++ b/src/main/java/appeng/me/GridNodeIterator.java @@ -37,7 +37,7 @@ public class GridNodeIterator implements Iterator private final Iterator outerIterator; private Iterator innerIterator; - public GridNodeIterator( Map, MachineSet> machines ) + public GridNodeIterator( final Map, MachineSet> machines ) { this.outerIterator = machines.values().iterator(); this.innerHasNext(); diff --git a/src/main/java/appeng/me/GridPropagator.java b/src/main/java/appeng/me/GridPropagator.java index 65d2e17a..4bc6c99f 100644 --- a/src/main/java/appeng/me/GridPropagator.java +++ b/src/main/java/appeng/me/GridPropagator.java @@ -27,15 +27,15 @@ public class GridPropagator implements IGridVisitor { private final Grid g; - public GridPropagator( Grid g ) + public GridPropagator( final Grid g ) { this.g = g; } @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { - GridNode gn = (GridNode) n; + final GridNode gn = (GridNode) n; if( gn.getMyGrid() != this.g || this.g.getPivot() == n ) { gn.setGrid( this.g ); diff --git a/src/main/java/appeng/me/GridSplitDetector.java b/src/main/java/appeng/me/GridSplitDetector.java index 695f83fd..d406c005 100644 --- a/src/main/java/appeng/me/GridSplitDetector.java +++ b/src/main/java/appeng/me/GridSplitDetector.java @@ -29,13 +29,13 @@ class GridSplitDetector implements IGridVisitor final IGridNode pivot; boolean pivotFound; - public GridSplitDetector( IGridNode pivot ) + public GridSplitDetector( final IGridNode pivot ) { this.pivot = pivot; } @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { if( n == this.pivot ) { diff --git a/src/main/java/appeng/me/GridStorage.java b/src/main/java/appeng/me/GridStorage.java index e1a9402f..20e295dc 100644 --- a/src/main/java/appeng/me/GridStorage.java +++ b/src/main/java/appeng/me/GridStorage.java @@ -50,7 +50,7 @@ public class GridStorage implements IGridStorage * @param id ID of grid storage * @param gss grid storage search */ - public GridStorage( long id, GridStorageSearch gss ) + public GridStorage( final long id, final GridStorageSearch gss ) { this.myID = id; this.mySearchEntry = gss; @@ -64,7 +64,7 @@ public class GridStorage implements IGridStorage * @param id ID of grid storage * @param gss grid storage search */ - public GridStorage( String input, long id, GridStorageSearch gss ) + public GridStorage( final String input, final long id, final GridStorageSearch gss ) { this.myID = id; this.mySearchEntry = gss; @@ -72,10 +72,10 @@ public class GridStorage implements IGridStorage try { - byte[] byteData = javax.xml.bind.DatatypeConverter.parseBase64Binary( input ); + final byte[] byteData = javax.xml.bind.DatatypeConverter.parseBase64Binary( input ); myTag = CompressedStreamTools.readCompressed( new ByteArrayInputStream( byteData ) ); } - catch( Throwable t ) + catch( final Throwable t ) { myTag = new NBTTagCompound(); } @@ -97,7 +97,7 @@ public class GridStorage implements IGridStorage { this.isDirty = false; - Grid currentGrid = (Grid) this.getGrid(); + final Grid currentGrid = (Grid) this.getGrid(); if( currentGrid != null ) { currentGrid.saveState(); @@ -105,11 +105,11 @@ public class GridStorage implements IGridStorage try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); + final ByteArrayOutputStream out = new ByteArrayOutputStream(); CompressedStreamTools.writeCompressed( this.data, out ); return javax.xml.bind.DatatypeConverter.printBase64Binary( out.toByteArray() ); } - catch( IOException e ) + catch( final IOException e ) { AELog.error( e ); } @@ -122,7 +122,7 @@ public class GridStorage implements IGridStorage return this.internalGrid == null ? null : this.internalGrid.get(); } - public void setGrid( Grid grid ) + public void setGrid( final Grid grid ) { this.internalGrid = new WeakReference( grid ); } @@ -144,12 +144,12 @@ public class GridStorage implements IGridStorage this.isDirty = true; } - public void addDivided( GridStorage gs ) + public void addDivided( final GridStorage gs ) { this.divided.put( gs, true ); } - public boolean hasDivided( GridStorage myStorage ) + public boolean hasDivided( final GridStorage myStorage ) { return this.divided.containsKey( myStorage ); } diff --git a/src/main/java/appeng/me/GridStorageSearch.java b/src/main/java/appeng/me/GridStorageSearch.java index dc119b05..a95633e4 100644 --- a/src/main/java/appeng/me/GridStorageSearch.java +++ b/src/main/java/appeng/me/GridStorageSearch.java @@ -33,7 +33,7 @@ public class GridStorageSearch * * @param id ID of grid storage search */ - public GridStorageSearch( long id ) + public GridStorageSearch( final long id ) { this.id = id; } @@ -45,7 +45,7 @@ public class GridStorageSearch } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -56,7 +56,7 @@ public class GridStorageSearch return false; } - GridStorageSearch other = (GridStorageSearch) obj; + final GridStorageSearch other = (GridStorageSearch) obj; if( this.id == other.id ) { return true; diff --git a/src/main/java/appeng/me/MachineSet.java b/src/main/java/appeng/me/MachineSet.java index 8f2f56c6..f35209c5 100644 --- a/src/main/java/appeng/me/MachineSet.java +++ b/src/main/java/appeng/me/MachineSet.java @@ -33,7 +33,7 @@ public class MachineSet extends HashSet implements IMachineSet private final Class machine; - MachineSet( Class m ) + MachineSet( final Class m ) { this.machine = m; } diff --git a/src/main/java/appeng/me/NetworkEventBus.java b/src/main/java/appeng/me/NetworkEventBus.java index c55b740b..5eedb30b 100644 --- a/src/main/java/appeng/me/NetworkEventBus.java +++ b/src/main/java/appeng/me/NetworkEventBus.java @@ -39,7 +39,7 @@ public class NetworkEventBus private static final Collection READ_CLASSES = new HashSet(); private static final Map, Map> EVENTS = new HashMap, Map>(); - public void readClass( Class listAs, Class c ) + public void readClass( final Class listAs, final Class c ) { if( READ_CLASSES.contains( c ) ) { @@ -49,12 +49,12 @@ public class NetworkEventBus try { - for( Method m : c.getMethods() ) + for( final Method m : c.getMethods() ) { - MENetworkEventSubscribe s = m.getAnnotation( MENetworkEventSubscribe.class ); + final MENetworkEventSubscribe s = m.getAnnotation( MENetworkEventSubscribe.class ); if( s != null ) { - Class[] types = m.getParameterTypes(); + final Class[] types = m.getParameterTypes(); if( types.length == 1 ) { if( MENetworkEvent.class.isAssignableFrom( types[0] ) ) @@ -88,32 +88,32 @@ public class NetworkEventBus } } } - catch( Throwable t ) + catch( final Throwable t ) { throw new IllegalStateException( "Error while adding " + c.getName() + " to event bus", t ); } } - public MENetworkEvent postEvent( Grid g, MENetworkEvent e ) + public MENetworkEvent postEvent( final Grid g, final MENetworkEvent e ) { - Map subscribers = EVENTS.get( e.getClass() ); + final Map subscribers = EVENTS.get( e.getClass() ); int x = 0; try { if( subscribers != null ) { - for( Entry subscriber : subscribers.entrySet() ) + for( final Entry subscriber : subscribers.entrySet() ) { - MENetworkEventInfo target = subscriber.getValue(); - GridCacheWrapper cache = g.getCaches().get( subscriber.getKey() ); + final MENetworkEventInfo target = subscriber.getValue(); + final GridCacheWrapper cache = g.getCaches().get( subscriber.getKey() ); if( cache != null ) { x++; target.invoke( cache.myCache, e ); } - for( IGridNode obj : g.getMachines( subscriber.getKey() ) ) + for( final IGridNode obj : g.getMachines( subscriber.getKey() ) ) { x++; target.invoke( obj.getMachine(), e ); @@ -121,7 +121,7 @@ public class NetworkEventBus } } } - catch( NetworkEventDone done ) + catch( final NetworkEventDone done ) { // Early out. } @@ -130,16 +130,16 @@ public class NetworkEventBus return e; } - public MENetworkEvent postEventTo( Grid grid, GridNode node, MENetworkEvent e ) + public MENetworkEvent postEventTo( final Grid grid, final GridNode node, final MENetworkEvent e ) { - Map subscribers = EVENTS.get( e.getClass() ); + final Map subscribers = EVENTS.get( e.getClass() ); int x = 0; try { if( subscribers != null ) { - MENetworkEventInfo target = subscribers.get( node.getMachineClass() ); + final MENetworkEventInfo target = subscribers.get( node.getMachineClass() ); if( target != null ) { x++; @@ -147,7 +147,7 @@ public class NetworkEventBus } } } - catch( NetworkEventDone done ) + catch( final NetworkEventDone done ) { // Early out. } @@ -170,20 +170,20 @@ public class NetworkEventBus public final Method objMethod; public final Class objEvent; - public EventMethod( Class Event, Class ObjClass, Method ObjMethod ) + public EventMethod( final Class Event, final Class ObjClass, final Method ObjMethod ) { this.objClass = ObjClass; this.objMethod = ObjMethod; this.objEvent = Event; } - public void invoke( Object obj, MENetworkEvent e ) throws NetworkEventDone + public void invoke( final Object obj, final MENetworkEvent e ) throws NetworkEventDone { try { this.objMethod.invoke( obj, e ); } - catch( Throwable e1 ) + catch( final Throwable e1 ) { AELog.severe( "[AppEng] Network Event caused exception:" ); AELog.severe( "Offending Class: " + obj.getClass().getName() ); @@ -205,14 +205,14 @@ public class NetworkEventBus private final List methods = new ArrayList(); - public void Add( Class Event, Class ObjClass, Method ObjMethod ) + public void Add( final Class Event, final Class ObjClass, final Method ObjMethod ) { this.methods.add( new EventMethod( Event, ObjClass, ObjMethod ) ); } - public void invoke( Object obj, MENetworkEvent e ) throws NetworkEventDone + public void invoke( final Object obj, final MENetworkEvent e ) throws NetworkEventDone { - for( EventMethod em : this.methods ) + for( final EventMethod em : this.methods ) { em.invoke( obj, e ); } diff --git a/src/main/java/appeng/me/NetworkList.java b/src/main/java/appeng/me/NetworkList.java index 95a01255..166bf240 100644 --- a/src/main/java/appeng/me/NetworkList.java +++ b/src/main/java/appeng/me/NetworkList.java @@ -43,7 +43,7 @@ public class NetworkList implements Collection } @Override - public boolean contains( Object o ) + public boolean contains( final Object o ) { return this.networks.contains( o ); } @@ -61,47 +61,47 @@ public class NetworkList implements Collection } @Override - public T[] toArray( T[] a ) + public T[] toArray( final T[] a ) { return this.networks.toArray( a ); } @Override - public boolean add( Grid e ) + public boolean add( final Grid e ) { this.copy(); return this.networks.add( e ); } @Override - public boolean remove( Object o ) + public boolean remove( final Object o ) { this.copy(); return this.networks.remove( o ); } @Override - public boolean containsAll( Collection c ) + public boolean containsAll( final Collection c ) { return this.networks.containsAll( c ); } @Override - public boolean addAll( Collection c ) + public boolean addAll( final Collection c ) { this.copy(); return this.networks.addAll( c ); } @Override - public boolean removeAll( Collection c ) + public boolean removeAll( final Collection c ) { this.copy(); return this.networks.removeAll( c ); } @Override - public boolean retainAll( Collection c ) + public boolean retainAll( final Collection c ) { this.copy(); return this.networks.retainAll( c ); @@ -115,7 +115,7 @@ public class NetworkList implements Collection private void copy() { - List old = this.networks; + final List old = this.networks; this.networks = new LinkedList(); this.networks.addAll( old ); } diff --git a/src/main/java/appeng/me/cache/CraftingGridCache.java b/src/main/java/appeng/me/cache/CraftingGridCache.java index b9936320..5bbb3fc2 100644 --- a/src/main/java/appeng/me/cache/CraftingGridCache.java +++ b/src/main/java/appeng/me/cache/CraftingGridCache.java @@ -92,7 +92,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper static final Comparator COMPARATOR = new Comparator() { @Override - public int compare( ICraftingPatternDetails firstDetail, ICraftingPatternDetails nextDetail ) + public int compare( final ICraftingPatternDetails firstDetail, final ICraftingPatternDetails nextDetail ) { return nextDetail.getPriority() - firstDetail.getPriority(); } @@ -100,11 +100,11 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper static { - ThreadFactory factory = new ThreadFactory() + final ThreadFactory factory = new ThreadFactory() { @Override - public Thread newThread( Runnable ar ) + public Thread newThread( final Runnable ar ) { return new Thread( ar, "AE Crafting Calculator" ); } @@ -127,13 +127,13 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper private IEnergyGrid energyGrid; private boolean updateList = false; - public CraftingGridCache( IGrid grid ) + public CraftingGridCache( final IGrid grid ) { this.grid = grid; } @MENetworkEventSubscribe - public void afterCacheConstruction( MENetworkPostCacheConstruction cacheConstruction ) + public void afterCacheConstruction( final MENetworkPostCacheConstruction cacheConstruction ) { this.storageGrid = this.grid.getCache( IStorageGrid.class ); this.energyGrid = this.grid.getCache( IEnergyGrid.class ); @@ -150,7 +150,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper this.updateCPUClusters(); } - Iterator craftingLinkIterator = this.craftingLinks.values().iterator(); + final Iterator craftingLinkIterator = this.craftingLinks.values().iterator(); while( craftingLinkIterator.hasNext() ) { if( craftingLinkIterator.next().isDead( this.grid, this ) ) @@ -159,18 +159,18 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } } - for( CraftingCPUCluster cpu : this.craftingCPUClusters ) + for( final CraftingCPUCluster cpu : this.craftingCPUClusters ) { cpu.updateCraftingLogic( this.grid, this.energyGrid, this ); } } @Override - public void removeNode( IGridNode gridNode, IGridHost machine ) + public void removeNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof ICraftingWatcherHost ) { - ICraftingWatcher craftingWatcher = this.craftingWatchers.get( machine ); + final ICraftingWatcher craftingWatcher = this.craftingWatchers.get( machine ); if( craftingWatcher != null ) { craftingWatcher.clear(); @@ -180,7 +180,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper if( machine instanceof ICraftingRequester ) { - for( CraftingLinkNexus link : this.craftingLinks.values() ) + for( final CraftingLinkNexus link : this.craftingLinks.values() ) { if( link.isMachine( machine ) ) { @@ -202,19 +202,19 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public void addNode( IGridNode gridNode, IGridHost machine ) + public void addNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof ICraftingWatcherHost ) { - ICraftingWatcherHost watcherHost = (ICraftingWatcherHost) machine; - CraftingWatcher watcher = new CraftingWatcher( this, watcherHost ); + final ICraftingWatcherHost watcherHost = (ICraftingWatcherHost) machine; + final CraftingWatcher watcher = new CraftingWatcher( this, watcherHost ); this.craftingWatchers.put( gridNode, watcher ); watcherHost.updateWatcher( watcher ); } if( machine instanceof ICraftingRequester ) { - for( ICraftingLink link : ( (ICraftingRequester) machine ).getRequestedJobs() ) + for( final ICraftingLink link : ( (ICraftingRequester) machine ).getRequestedJobs() ) { if( link instanceof CraftingLink ) { @@ -236,25 +236,25 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public void onSplit( IGridStorage destinationStorage ) + public void onSplit( final IGridStorage destinationStorage ) { // nothing! } @Override - public void onJoin( IGridStorage sourceStorage ) + public void onJoin( final IGridStorage sourceStorage ) { // nothing! } @Override - public void populateGridStorage( IGridStorage destinationStorage ) + public void populateGridStorage( final IGridStorage destinationStorage ) { // nothing! } private void updatePatterns() { - Map> oldItems = this.craftableItems; + final Map> oldItems = this.craftableItems; // erase list. this.craftingMethods.clear(); @@ -265,15 +265,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper this.storageGrid.postAlterationOfStoredItems( StorageChannel.ITEMS, oldItems.keySet(), new BaseActionSource() ); // re-create list.. - for( ICraftingProvider provider : this.craftingProviders ) + for( final ICraftingProvider provider : this.craftingProviders ) { provider.provideCrafting( this ); } - Map> tmpCraft = new HashMap>(); + final Map> tmpCraft = new HashMap>(); // new craftables! - for( ICraftingPatternDetails details : this.craftingMethods.keySet() ) + for( final ICraftingPatternDetails details : this.craftingMethods.keySet() ) { for( IAEItemStack out : details.getOutputs() ) { @@ -293,7 +293,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } // make them immutable - for( Entry> e : tmpCraft.entrySet() ) + for( final Entry> e : tmpCraft.entrySet() ) { this.craftableItems.put( e.getKey(), ImmutableList.copyOf( e.getValue() ) ); } @@ -305,10 +305,10 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper { this.craftingCPUClusters.clear(); - for( IGridNode cst : this.grid.getMachines( TileCraftingStorageTile.class ) ) + for( final IGridNode cst : this.grid.getMachines( TileCraftingStorageTile.class ) ) { - TileCraftingStorageTile tile = (TileCraftingStorageTile) cst.getMachine(); - CraftingCPUCluster cluster = (CraftingCPUCluster) tile.getCluster(); + final TileCraftingStorageTile tile = (TileCraftingStorageTile) cst.getMachine(); + final CraftingCPUCluster cluster = (CraftingCPUCluster) tile.getCluster(); if( cluster != null ) { this.craftingCPUClusters.add( cluster ); @@ -321,7 +321,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } } - public void addLink( CraftingLink link ) + public void addLink( final CraftingLink link ) { if( link.isStandalone() ) { @@ -338,19 +338,19 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @MENetworkEventSubscribe - public void updateCPUClusters( MENetworkCraftingCpuChange c ) + public void updateCPUClusters( final MENetworkCraftingCpuChange c ) { this.updateList = true; } @MENetworkEventSubscribe - public void updateCPUClusters( MENetworkCraftingPatternChange c ) + public void updateCPUClusters( final MENetworkCraftingPatternChange c ) { this.updatePatterns(); } @Override - public void addCraftingOption( ICraftingMedium medium, ICraftingPatternDetails api ) + public void addCraftingOption( final ICraftingMedium medium, final ICraftingPatternDetails api ) { List details = this.craftingMethods.get( api ); if( details == null ) @@ -366,15 +366,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public void setEmitable( IAEItemStack someItem ) + public void setEmitable( final IAEItemStack someItem ) { this.emitableItems.add( someItem.copy() ); } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { - List list = new ArrayList( 1 ); + final List list = new ArrayList( 1 ); if( channel == StorageChannel.ITEMS ) { @@ -397,15 +397,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public boolean isPrioritized( IAEStack input ) + public boolean isPrioritized( final IAEStack input ) { return true; } @Override - public boolean canAccept( IAEStack input ) + public boolean canAccept( final IAEStack input ) { - for( CraftingCPUCluster cpu : this.craftingCPUClusters ) + for( final CraftingCPUCluster cpu : this.craftingCPUClusters ) { if( cpu.canAccept( input ) ) { @@ -423,15 +423,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return i == 1; } @Override - public IAEStack injectItems( IAEStack input, Actionable type, BaseActionSource src ) + public IAEStack injectItems( IAEStack input, final Actionable type, final BaseActionSource src ) { - for( CraftingCPUCluster cpu : this.craftingCPUClusters ) + for( final CraftingCPUCluster cpu : this.craftingCPUClusters ) { input = cpu.injectItems( input, type, src ); } @@ -440,21 +440,21 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public IAEStack extractItems( IAEStack request, Actionable mode, BaseActionSource src ) + public IAEStack extractItems( final IAEStack request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { // add craftable items! - for( IAEItemStack stack : this.craftableItems.keySet() ) + for( final IAEItemStack stack : this.craftableItems.keySet() ) { out.addCrafting( stack ); } - for( IAEItemStack st : this.emitableItems ) + for( final IAEItemStack st : this.emitableItems ) { out.addCrafting( st ); } @@ -469,15 +469,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public ImmutableCollection getCraftingFor( IAEItemStack whatToCraft, ICraftingPatternDetails details, int slotIndex, World world ) + public ImmutableCollection getCraftingFor( final IAEItemStack whatToCraft, final ICraftingPatternDetails details, final int slotIndex, final World world ) { - ImmutableList res = this.craftableItems.get( whatToCraft ); + final ImmutableList res = this.craftableItems.get( whatToCraft ); if( res == null ) { if( details != null && details.isCraftable() ) { - for( IAEItemStack ais : this.craftableItems.keySet() ) + for( final IAEItemStack ais : this.craftableItems.keySet() ) { if( ais.getItem() == whatToCraft.getItem() && ( !ais.getItem().getHasSubtypes() || ais.getItemDamage() == whatToCraft.getItemDamage() ) ) { @@ -496,20 +496,20 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public Future beginCraftingJob( World world, IGrid grid, BaseActionSource actionSrc, IAEItemStack slotItem, ICraftingCallback cb ) + public Future beginCraftingJob( final World world, final IGrid grid, final BaseActionSource actionSrc, final IAEItemStack slotItem, final ICraftingCallback cb ) { if( world == null || grid == null || actionSrc == null || slotItem == null ) { throw new IllegalArgumentException( "Invalid Crafting Job Request" ); } - CraftingJob job = new CraftingJob( world, grid, actionSrc, slotItem, cb ); + final CraftingJob job = new CraftingJob( world, grid, actionSrc, slotItem, cb ); return CRAFTING_POOL.submit( job, (ICraftingJob) job ); } @Override - public ICraftingLink submitJob( ICraftingJob job, ICraftingRequester requestingMachine, ICraftingCPU target, final boolean prioritizePower, BaseActionSource src ) + public ICraftingLink submitJob( final ICraftingJob job, final ICraftingRequester requestingMachine, final ICraftingCPU target, final boolean prioritizePower, final BaseActionSource src ) { if( job.isSimulation() ) { @@ -525,8 +525,8 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper if( target == null ) { - List validCpusClusters = new ArrayList(); - for( CraftingCPUCluster cpu : this.craftingCPUClusters ) + final List validCpusClusters = new ArrayList(); + for( final CraftingCPUCluster cpu : this.craftingCPUClusters ) { if( cpu.isActive() && !cpu.isBusy() && cpu.getAvailableStorage() >= job.getByteTotal() ) { @@ -537,11 +537,11 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper Collections.sort( validCpusClusters, new Comparator() { @Override - public int compare( CraftingCPUCluster firstCluster, CraftingCPUCluster nextCluster ) + public int compare( final CraftingCPUCluster firstCluster, final CraftingCPUCluster nextCluster ) { if( prioritizePower ) { - int comparison = ItemSorters.compareLong( nextCluster.getCoProcessors(), firstCluster.getCoProcessors() ); + final int comparison = ItemSorters.compareLong( nextCluster.getCoProcessors(), firstCluster.getCoProcessors() ); if( comparison != 0 ) { return comparison; @@ -549,7 +549,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper return ItemSorters.compareLong( nextCluster.getAvailableStorage(), firstCluster.getAvailableStorage() ); } - int comparison = ItemSorters.compareLong( firstCluster.getCoProcessors(), nextCluster.getCoProcessors() ); + final int comparison = ItemSorters.compareLong( firstCluster.getCoProcessors(), nextCluster.getCoProcessors() ); if( comparison != 0 ) { return comparison; @@ -579,15 +579,15 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper } @Override - public boolean canEmitFor( IAEItemStack someItem ) + public boolean canEmitFor( final IAEItemStack someItem ) { return this.emitableItems.contains( someItem ); } @Override - public boolean isRequesting( IAEItemStack what ) + public boolean isRequesting( final IAEItemStack what ) { - for( CraftingCPUCluster cluster : this.craftingCPUClusters ) + for( final CraftingCPUCluster cluster : this.craftingCPUClusters ) { if( cluster.isMaking( what ) ) { @@ -598,7 +598,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper return false; } - public List getMediums( ICraftingPatternDetails key ) + public List getMediums( final ICraftingPatternDetails key ) { List mediums = this.craftingMethods.get( key ); @@ -610,7 +610,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper return mediums; } - public boolean hasCpu( ICraftingCPU cpu ) + public boolean hasCpu( final ICraftingCPU cpu ) { return this.craftingCPUClusters.contains( cpu ); } @@ -621,7 +621,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper private final Iterator iterator; private CraftingCPUCluster cpuCluster; - public ActiveCpuIterator( Collection o ) + public ActiveCpuIterator( final Collection o ) { this.iterator = o.iterator(); this.cpuCluster = null; diff --git a/src/main/java/appeng/me/cache/EnergyGridCache.java b/src/main/java/appeng/me/cache/EnergyGridCache.java index 805ef61f..0e31e502 100644 --- a/src/main/java/appeng/me/cache/EnergyGridCache.java +++ b/src/main/java/appeng/me/cache/EnergyGridCache.java @@ -95,33 +95,33 @@ public class EnergyGridCache implements IEnergyGrid PathGridCache pgc; double lastStoredPower = -1; - public EnergyGridCache( IGrid g ) + public EnergyGridCache( final IGrid g ) { this.myGrid = g; } @MENetworkEventSubscribe - public void postInit( MENetworkPostCacheConstruction pcc ) + public void postInit( final MENetworkPostCacheConstruction pcc ) { this.pgc = this.myGrid.getCache( IPathingGrid.class ); } @MENetworkEventSubscribe - public void EnergyNodeChanges( MENetworkPowerIdleChange ev ) + public void EnergyNodeChanges( final MENetworkPowerIdleChange ev ) { // update power usage based on event. - GridNode node = (GridNode) ev.node; - IGridBlock gb = node.getGridBlock(); + final GridNode node = (GridNode) ev.node; + final IGridBlock gb = node.getGridBlock(); - double newDraw = gb.getIdlePowerUsage(); - double diffDraw = newDraw - node.previousDraw; + final double newDraw = gb.getIdlePowerUsage(); + final double diffDraw = newDraw - node.previousDraw; node.previousDraw = newDraw; this.drainPerTick += diffDraw; } @MENetworkEventSubscribe - public void EnergyNodeChanges( MENetworkPowerStorage ev ) + public void EnergyNodeChanges( final MENetworkPowerStorage ev ) { if( ev.storage.isAEPublicPowerStorage() ) { @@ -152,12 +152,12 @@ public class EnergyGridCache implements IEnergyGrid { if( !this.interests.isEmpty() ) { - double oldPower = this.lastStoredPower; + final double oldPower = this.lastStoredPower; this.lastStoredPower = this.getStoredPower(); - EnergyThreshold low = new EnergyThreshold( Math.min( oldPower, this.lastStoredPower ), null ); - EnergyThreshold high = new EnergyThreshold( Math.max( oldPower, this.lastStoredPower ), null ); - for( EnergyThreshold th : this.interests.subSet( low, true, high, true ) ) + final EnergyThreshold low = new EnergyThreshold( Math.min( oldPower, this.lastStoredPower ), null ); + final EnergyThreshold high = new EnergyThreshold( Math.max( oldPower, this.lastStoredPower ), null ); + for( final EnergyThreshold th : this.interests.subSet( low, true, high, true ) ) { ( (EnergyWatcher) th.watcher ).post( this ); } @@ -177,7 +177,7 @@ public class EnergyGridCache implements IEnergyGrid if( this.drainPerTick > 0.0001 ) { - double drained = this.extractAEPower( this.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); + final double drained = this.extractAEPower( this.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); currentlyHasPower = drained >= this.drainPerTick - 0.001; } else @@ -212,7 +212,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier pm ) + public double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier pm ) { this.localSeen.clear(); return pm.divide( this.extractAEPower( pm.multiply( amt ), mode, this.localSeen ) ); @@ -224,7 +224,7 @@ public class EnergyGridCache implements IEnergyGrid return this.drainPerTick + this.pgc.channelPowerUsage; } - private void publicPowerState( boolean newState, IGrid grid ) + private void publicPowerState( final boolean newState, final IGrid grid ) { if( this.publicHasPower == newState ) { @@ -243,14 +243,14 @@ public class EnergyGridCache implements IEnergyGrid { this.availableTicksSinceUpdate = 0; this.globalAvailablePower = 0; - for( IAEPowerStorage p : this.providers ) + for( final IAEPowerStorage p : this.providers ) { this.globalAvailablePower += p.getAECurrentPower(); } } @Override - public double extractAEPower( double amt, Actionable mode, Set seen ) + public double extractAEPower( final double amt, final Actionable mode, final Set seen ) { if( !seen.add( this ) ) { @@ -265,7 +265,7 @@ public class EnergyGridCache implements IEnergyGrid if( extractedPower < amt ) { - Iterator i = this.energyGridProviders.iterator(); + final Iterator i = this.energyGridProviders.iterator(); while( extractedPower < amt && i.hasNext() ) { extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen ); @@ -292,7 +292,7 @@ public class EnergyGridCache implements IEnergyGrid if( extractedPower < amt ) { - Iterator i = this.energyGridProviders.iterator(); + final Iterator i = this.energyGridProviders.iterator(); while( extractedPower < amt && i.hasNext() ) { extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen ); @@ -306,26 +306,26 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double injectAEPower( double amt, Actionable mode, Set seen ) + public double injectAEPower( double amt, final Actionable mode, final Set seen ) { if( !seen.add( this ) ) { return 0; } - double ignore = this.extra; + final double ignore = this.extra; amt += this.extra; if( mode == Actionable.SIMULATE ) { - Iterator it = this.requesters.iterator(); + final Iterator it = this.requesters.iterator(); while( amt > 0 && it.hasNext() ) { - IAEPowerStorage node = it.next(); + final IAEPowerStorage node = it.next(); amt = node.injectAEPower( amt, Actionable.SIMULATE ); } - Iterator i = this.energyGridProviders.iterator(); + final Iterator i = this.energyGridProviders.iterator(); while( amt > 0 && i.hasNext() ) { amt = i.next().injectAEPower( amt, mode, seen ); @@ -338,7 +338,7 @@ public class EnergyGridCache implements IEnergyGrid while( amt > 0 && !this.requesters.isEmpty() ) { - IAEPowerStorage node = this.getFirstRequester(); + final IAEPowerStorage node = this.getFirstRequester(); amt = node.injectAEPower( amt, Actionable.MODULATE ); if( amt > 0 ) @@ -348,14 +348,14 @@ public class EnergyGridCache implements IEnergyGrid } } - Iterator i = this.energyGridProviders.iterator(); + final Iterator i = this.energyGridProviders.iterator(); while( amt > 0 && i.hasNext() ) { - IEnergyGridProvider what = i.next(); - Set listCopy = new HashSet(); + final IEnergyGridProvider what = i.next(); + final Set listCopy = new HashSet(); listCopy.addAll( seen ); - double cannotHold = what.injectAEPower( amt, Actionable.SIMULATE, listCopy ); + final double cannotHold = what.injectAEPower( amt, Actionable.SIMULATE, listCopy ); what.injectAEPower( amt - cannotHold, mode, seen ); amt = cannotHold; @@ -368,7 +368,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double getEnergyDemand( double maxRequired, Set seen ) + public double getEnergyDemand( final double maxRequired, final Set seen ) { if( !seen.add( this ) ) { @@ -377,50 +377,50 @@ public class EnergyGridCache implements IEnergyGrid double required = this.buffer() - this.extra; - Iterator it = this.requesters.iterator(); + final Iterator it = this.requesters.iterator(); while( required < maxRequired && it.hasNext() ) { - IAEPowerStorage node = it.next(); + final IAEPowerStorage node = it.next(); if( node.getPowerFlow() != AccessRestriction.READ ) { required += Math.max( 0.0, node.getAEMaxPower() - node.getAECurrentPower() ); } } - Iterator ix = this.energyGridProviders.iterator(); + final Iterator ix = this.energyGridProviders.iterator(); while( required < maxRequired && ix.hasNext() ) { - IEnergyGridProvider node = ix.next(); + final IEnergyGridProvider node = ix.next(); required += node.getEnergyDemand( maxRequired - required, seen ); } return required; } - private double simulateExtract( double extractedPower, double amt ) + private double simulateExtract( double extractedPower, final double amt ) { - Iterator it = this.providers.iterator(); + final Iterator it = this.providers.iterator(); while( extractedPower < amt && it.hasNext() ) { - IAEPowerStorage node = it.next(); + final IAEPowerStorage node = it.next(); - double req = amt - extractedPower; - double newPower = node.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.ONE ); + final double req = amt - extractedPower; + final double newPower = node.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.ONE ); extractedPower += newPower; } return extractedPower; } - private double doExtract( double extractedPower, double amt ) + private double doExtract( double extractedPower, final double amt ) { while( extractedPower < amt && !this.providers.isEmpty() ) { - IAEPowerStorage node = this.getFirstProvider(); + final IAEPowerStorage node = this.getFirstProvider(); - double req = amt - extractedPower; - double newPower = node.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.ONE ); + final double req = amt - extractedPower; + final double newPower = node.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.ONE ); extractedPower += newPower; if( newPower < req ) @@ -438,7 +438,7 @@ public class EnergyGridCache implements IEnergyGrid { if( this.lastProvider == null ) { - Iterator i = this.providers.iterator(); + final Iterator i = this.providers.iterator(); this.lastProvider = i.hasNext() ? i.next() : null; } @@ -464,7 +464,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double injectPower( double amt, Actionable mode ) + public double injectPower( final double amt, final Actionable mode ) { this.localSeen.clear(); return this.injectAEPower( amt, mode, this.localSeen ); @@ -474,7 +474,7 @@ public class EnergyGridCache implements IEnergyGrid { if( this.lastRequester == null ) { - Iterator i = this.requesters.iterator(); + final Iterator i = this.requesters.iterator(); this.lastRequester = i.hasNext() ? i.next() : null; } @@ -504,14 +504,14 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public double getEnergyDemand( double maxRequired ) + public double getEnergyDemand( final double maxRequired ) { this.localSeen.clear(); return this.getEnergyDemand( maxRequired, this.localSeen ); } @Override - public void removeNode( IGridNode node, IGridHost machine ) + public void removeNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof IEnergyGridProvider ) { @@ -519,13 +519,13 @@ public class EnergyGridCache implements IEnergyGrid } // idle draw. - GridNode gridNode = (GridNode) node; + final GridNode gridNode = (GridNode) node; this.drainPerTick -= gridNode.previousDraw; // power storage. if( machine instanceof IAEPowerStorage ) { - IAEPowerStorage ps = (IAEPowerStorage) machine; + final IAEPowerStorage ps = (IAEPowerStorage) machine; if( ps.isAEPublicPowerStorage() ) { if( ps.getPowerFlow() != AccessRestriction.WRITE ) @@ -551,7 +551,7 @@ public class EnergyGridCache implements IEnergyGrid if( machine instanceof IStackWatcherHost ) { - IEnergyWatcher myWatcher = this.watchers.get( machine ); + final IEnergyWatcher myWatcher = this.watchers.get( machine ); if( myWatcher != null ) { myWatcher.clear(); @@ -561,7 +561,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public void addNode( IGridNode node, IGridHost machine ) + public void addNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof IEnergyGridProvider ) { @@ -569,19 +569,19 @@ public class EnergyGridCache implements IEnergyGrid } // idle draw... - GridNode gridNode = (GridNode) node; - IGridBlock gb = gridNode.getGridBlock(); + final GridNode gridNode = (GridNode) node; + final IGridBlock gb = gridNode.getGridBlock(); gridNode.previousDraw = gb.getIdlePowerUsage(); this.drainPerTick += gridNode.previousDraw; // power storage if( machine instanceof IAEPowerStorage ) { - IAEPowerStorage ps = (IAEPowerStorage) machine; + final IAEPowerStorage ps = (IAEPowerStorage) machine; if( ps.isAEPublicPowerStorage() ) { - double max = ps.getAEMaxPower(); - double current = ps.getAECurrentPower(); + final double max = ps.getAEMaxPower(); + final double current = ps.getAECurrentPower(); if( ps.getPowerFlow() != AccessRestriction.WRITE ) { @@ -603,8 +603,8 @@ public class EnergyGridCache implements IEnergyGrid if( machine instanceof IEnergyWatcherHost ) { - IEnergyWatcherHost swh = (IEnergyWatcherHost) machine; - EnergyWatcher iw = new EnergyWatcher( this, swh ); + final IEnergyWatcherHost swh = (IEnergyWatcherHost) machine; + final EnergyWatcher iw = new EnergyWatcher( this, swh ); this.watchers.put( node, iw ); swh.updateWatcher( iw ); } @@ -613,20 +613,20 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { this.extra /= 2; storageB.dataObject().setDouble( "extraEnergy", this.extra ); } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { this.extra += storageB.dataObject().getDouble( "extraEnergy" ); } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { storage.dataObject().setDouble( "extraEnergy", this.extra ); } diff --git a/src/main/java/appeng/me/cache/GridStorageCache.java b/src/main/java/appeng/me/cache/GridStorageCache.java index 4b318ed6..c155da8c 100644 --- a/src/main/java/appeng/me/cache/GridStorageCache.java +++ b/src/main/java/appeng/me/cache/GridStorageCache.java @@ -69,7 +69,7 @@ public class GridStorageCache implements IStorageGrid private NetworkInventoryHandler myItemNetwork; private NetworkInventoryHandler myFluidNetwork; - public GridStorageCache( IGrid g ) + public GridStorageCache( final IGrid g ) { this.myGrid = g; } @@ -82,11 +82,11 @@ public class GridStorageCache implements IStorageGrid } @Override - public void removeNode( IGridNode node, IGridHost machine ) + public void removeNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof ICellContainer ) { - ICellContainer cc = (ICellContainer) machine; + final ICellContainer cc = (ICellContainer) machine; this.myGrid.postEvent( new MENetworkCellArrayUpdate() ); this.removeCellProvider( cc, new CellChangeTracker() ).applyChanges(); @@ -95,7 +95,7 @@ public class GridStorageCache implements IStorageGrid if( machine instanceof IStackWatcherHost ) { - IStackWatcher myWatcher = this.watchers.get( machine ); + final IStackWatcher myWatcher = this.watchers.get( machine ); if( myWatcher != null ) { myWatcher.clear(); @@ -105,11 +105,11 @@ public class GridStorageCache implements IStorageGrid } @Override - public void addNode( IGridNode node, IGridHost machine ) + public void addNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof ICellContainer ) { - ICellContainer cc = (ICellContainer) machine; + final ICellContainer cc = (ICellContainer) machine; this.inactiveCellProviders.add( cc ); this.myGrid.postEvent( new MENetworkCellArrayUpdate() ); @@ -121,32 +121,32 @@ public class GridStorageCache implements IStorageGrid if( machine instanceof IStackWatcherHost ) { - IStackWatcherHost swh = (IStackWatcherHost) machine; - ItemWatcher iw = new ItemWatcher( this, swh ); + final IStackWatcherHost swh = (IStackWatcherHost) machine; + final ItemWatcher iw = new ItemWatcher( this, swh ); this.watchers.put( node, iw ); swh.updateWatcher( iw ); } } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } - public CellChangeTracker addCellProvider( ICellProvider cc, CellChangeTracker tracker ) + public CellChangeTracker addCellProvider( final ICellProvider cc, final CellChangeTracker tracker ) { if( this.inactiveCellProviders.contains( cc ) ) { @@ -159,12 +159,12 @@ public class GridStorageCache implements IStorageGrid actionSrc = new MachineSource( (IActionHost) cc ); } - for( IMEInventoryHandler h : cc.getCellArray( StorageChannel.ITEMS ) ) + for( final IMEInventoryHandler h : cc.getCellArray( StorageChannel.ITEMS ) ) { tracker.postChanges( StorageChannel.ITEMS, 1, h, actionSrc ); } - for( IMEInventoryHandler h : cc.getCellArray( StorageChannel.FLUIDS ) ) + for( final IMEInventoryHandler h : cc.getCellArray( StorageChannel.FLUIDS ) ) { tracker.postChanges( StorageChannel.FLUIDS, 1, h, actionSrc ); } @@ -173,7 +173,7 @@ public class GridStorageCache implements IStorageGrid return tracker; } - public CellChangeTracker removeCellProvider( ICellProvider cc, CellChangeTracker tracker ) + public CellChangeTracker removeCellProvider( final ICellProvider cc, final CellChangeTracker tracker ) { if( this.activeCellProviders.contains( cc ) ) { @@ -186,12 +186,12 @@ public class GridStorageCache implements IStorageGrid actionSrc = new MachineSource( (IActionHost) cc ); } - for( IMEInventoryHandler h : cc.getCellArray( StorageChannel.ITEMS ) ) + for( final IMEInventoryHandler h : cc.getCellArray( StorageChannel.ITEMS ) ) { tracker.postChanges( StorageChannel.ITEMS, -1, h, actionSrc ); } - for( IMEInventoryHandler h : cc.getCellArray( StorageChannel.FLUIDS ) ) + for( final IMEInventoryHandler h : cc.getCellArray( StorageChannel.FLUIDS ) ) { tracker.postChanges( StorageChannel.FLUIDS, -1, h, actionSrc ); } @@ -201,24 +201,24 @@ public class GridStorageCache implements IStorageGrid } @MENetworkEventSubscribe - public void cellUpdate( MENetworkCellArrayUpdate ev ) + public void cellUpdate( final MENetworkCellArrayUpdate ev ) { this.myItemNetwork = null; this.myFluidNetwork = null; - LinkedList ll = new LinkedList(); + final LinkedList ll = new LinkedList(); ll.addAll( this.inactiveCellProviders ); ll.addAll( this.activeCellProviders ); - CellChangeTracker tracker = new CellChangeTracker(); + final CellChangeTracker tracker = new CellChangeTracker(); - for( ICellProvider cc : ll ) + for( final ICellProvider cc : ll ) { boolean Active = true; if( cc instanceof IActionHost ) { - IGridNode node = ( (IActionHost) cc ).getActionableNode(); + final IGridNode node = ( (IActionHost) cc ).getActionableNode(); if( node != null && node.isActive() ) { Active = true; @@ -245,7 +245,7 @@ public class GridStorageCache implements IStorageGrid tracker.applyChanges(); } - private void postChangesToNetwork( StorageChannel chan, int upOrDown, IItemList availableItems, BaseActionSource src ) + private void postChangesToNetwork( final StorageChannel chan, final int upOrDown, final IItemList availableItems, final BaseActionSource src ) { switch( chan ) { @@ -268,17 +268,17 @@ public class GridStorageCache implements IStorageGrid return this.myItemNetwork; } - private void buildNetworkStorage( StorageChannel chan ) + private void buildNetworkStorage( final StorageChannel chan ) { - SecurityCache security = this.myGrid.getCache( ISecurityGrid.class ); + final SecurityCache security = this.myGrid.getCache( ISecurityGrid.class ); switch( chan ) { case FLUIDS: this.myFluidNetwork = new NetworkInventoryHandler( StorageChannel.FLUIDS, security ); - for( ICellProvider cc : this.activeCellProviders ) + for( final ICellProvider cc : this.activeCellProviders ) { - for( IMEInventoryHandler h : cc.getCellArray( chan ) ) + for( final IMEInventoryHandler h : cc.getCellArray( chan ) ) { this.myFluidNetwork.addNewStorage( h ); } @@ -286,9 +286,9 @@ public class GridStorageCache implements IStorageGrid break; case ITEMS: this.myItemNetwork = new NetworkInventoryHandler( StorageChannel.ITEMS, security ); - for( ICellProvider cc : this.activeCellProviders ) + for( final ICellProvider cc : this.activeCellProviders ) { - for( IMEInventoryHandler h : cc.getCellArray( chan ) ) + for( final IMEInventoryHandler h : cc.getCellArray( chan ) ) { this.myItemNetwork.addNewStorage( h ); } @@ -308,7 +308,7 @@ public class GridStorageCache implements IStorageGrid } @Override - public void postAlterationOfStoredItems( StorageChannel chan, Iterable input, BaseActionSource src ) + public void postAlterationOfStoredItems( final StorageChannel chan, final Iterable input, final BaseActionSource src ) { if( chan == StorageChannel.ITEMS ) { @@ -321,14 +321,14 @@ public class GridStorageCache implements IStorageGrid } @Override - public void registerCellProvider( ICellProvider provider ) + public void registerCellProvider( final ICellProvider provider ) { this.inactiveCellProviders.add( provider ); this.addCellProvider( provider, new CellChangeTracker() ).applyChanges(); } @Override - public void unregisterCellProvider( ICellProvider provider ) + public void unregisterCellProvider( final ICellProvider provider ) { this.removeCellProvider( provider, new CellChangeTracker() ).applyChanges(); this.inactiveCellProviders.remove( provider ); @@ -354,7 +354,7 @@ public class GridStorageCache implements IStorageGrid final IItemList list; final BaseActionSource src; - public CellChangeTrackerRecord( StorageChannel channel, int i, IMEInventoryHandler h, BaseActionSource actionSrc ) + public CellChangeTrackerRecord( final StorageChannel channel, final int i, final IMEInventoryHandler h, final BaseActionSource actionSrc ) { this.channel = channel; this.up_or_down = i; @@ -386,14 +386,14 @@ public class GridStorageCache implements IStorageGrid final List data = new LinkedList(); - public void postChanges( StorageChannel channel, int i, IMEInventoryHandler h, BaseActionSource actionSrc ) + public void postChanges( final StorageChannel channel, final int i, final IMEInventoryHandler h, final BaseActionSource actionSrc ) { this.data.add( new CellChangeTrackerRecord( channel, i, h, actionSrc ) ); } public void applyChanges() { - for( CellChangeTrackerRecord rec : this.data ) + for( final CellChangeTrackerRecord rec : this.data ) { rec.applyChanges(); } diff --git a/src/main/java/appeng/me/cache/NetworkMonitor.java b/src/main/java/appeng/me/cache/NetworkMonitor.java index 9b704ec1..8b0c1cd4 100644 --- a/src/main/java/appeng/me/cache/NetworkMonitor.java +++ b/src/main/java/appeng/me/cache/NetworkMonitor.java @@ -44,7 +44,7 @@ public class NetworkMonitor> extends MEMonitorHandler private final StorageChannel myChannel; boolean sendEvent = false; - public NetworkMonitor( GridStorageCache cache, StorageChannel chan ) + public NetworkMonitor( final GridStorageCache cache, final StorageChannel chan ) { super( null, chan ); this.myGridCache = cache; @@ -55,11 +55,11 @@ public class NetworkMonitor> extends MEMonitorHandler { this.hasChanged = true; - Iterator, Object>> i = this.getListeners(); + final Iterator, Object>> i = this.getListeners(); while( i.hasNext() ) { - Entry, Object> o = i.next(); - IMEMonitorHandlerReceiver receiver = o.getKey(); + final Entry, Object> o = i.next(); + final IMEMonitorHandlerReceiver receiver = o.getKey(); if( receiver.isValid( o.getValue() ) ) { @@ -96,12 +96,12 @@ public class NetworkMonitor> extends MEMonitorHandler } @Override - protected void postChangesToListeners( Iterable changes, BaseActionSource src ) + protected void postChangesToListeners( final Iterable changes, final BaseActionSource src ) { this.postChange( true, changes, src ); } - protected void postChange( boolean add, Iterable changes, BaseActionSource src ) + protected void postChange( final boolean add, final Iterable changes, final BaseActionSource src ) { if( DEPTH.contains( this ) ) { @@ -113,9 +113,9 @@ public class NetworkMonitor> extends MEMonitorHandler this.sendEvent = true; this.notifyListenersOfChange( changes, src ); - IItemList myStorageList = this.getStorageList(); + final IItemList myStorageList = this.getStorageList(); - for( T changedItem : changes ) + for( final T changedItem : changes ) { T difference = changedItem; @@ -126,7 +126,7 @@ public class NetworkMonitor> extends MEMonitorHandler if( this.myGridCache.interestManager.containsKey( changedItem ) ) { - Collection list = this.myGridCache.interestManager.get( changedItem ); + final Collection list = this.myGridCache.interestManager.get( changedItem ); if( !list.isEmpty() ) { IAEStack fullStack = myStorageList.findPrecise( changedItem ); @@ -138,7 +138,7 @@ public class NetworkMonitor> extends MEMonitorHandler this.myGridCache.interestManager.enableTransactions(); - for( ItemWatcher iw : list ) + for( final ItemWatcher iw : list ) { iw.getHost().onStackChange( myStorageList, fullStack, difference, src, this.getChannel() ); } diff --git a/src/main/java/appeng/me/cache/P2PCache.java b/src/main/java/appeng/me/cache/P2PCache.java index 203c480f..3af3a030 100644 --- a/src/main/java/appeng/me/cache/P2PCache.java +++ b/src/main/java/appeng/me/cache/P2PCache.java @@ -47,16 +47,16 @@ public class P2PCache implements IGridCache private final Multimap outputs = LinkedHashMultimap.create(); private final TunnelCollection NullColl = new TunnelCollection( null, null ); - public P2PCache( IGrid g ) + public P2PCache( final IGrid g ) { this.myGrid = g; } @MENetworkEventSubscribe - public void bootComplete( MENetworkBootingStatusChange bootStatus ) + public void bootComplete( final MENetworkBootingStatusChange bootStatus ) { - ITickManager tm = this.myGrid.getCache( ITickManager.class ); - for( PartP2PTunnel me : this.inputs.values() ) + final ITickManager tm = this.myGrid.getCache( ITickManager.class ); + for( final PartP2PTunnel me : this.inputs.values() ) { if( me instanceof PartP2PTunnelME ) { @@ -66,10 +66,10 @@ public class P2PCache implements IGridCache } @MENetworkEventSubscribe - public void bootComplete( MENetworkPowerStatusChange power ) + public void bootComplete( final MENetworkPowerStatusChange power ) { - ITickManager tm = this.myGrid.getCache( ITickManager.class ); - for( PartP2PTunnel me : this.inputs.values() ) + final ITickManager tm = this.myGrid.getCache( ITickManager.class ); + for( final PartP2PTunnel me : this.inputs.values() ) { if( me instanceof PartP2PTunnelME ) { @@ -85,7 +85,7 @@ public class P2PCache implements IGridCache } @Override - public void removeNode( IGridNode node, IGridHost machine ) + public void removeNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof PartP2PTunnel ) { @@ -97,7 +97,7 @@ public class P2PCache implements IGridCache } } - PartP2PTunnel t = (PartP2PTunnel) machine; + final PartP2PTunnel t = (PartP2PTunnel) machine; // AELog.info( "rmv-" + (t.output ? "output: " : "input: ") + t.freq // ); @@ -115,7 +115,7 @@ public class P2PCache implements IGridCache } @Override - public void addNode( IGridNode node, IGridHost machine ) + public void addNode( final IGridNode node, final IGridHost machine ) { if( machine instanceof PartP2PTunnel ) { @@ -127,7 +127,7 @@ public class P2PCache implements IGridCache } } - PartP2PTunnel t = (PartP2PTunnel) machine; + final PartP2PTunnel t = (PartP2PTunnel) machine; // AELog.info( "add-" + (t.output ? "output: " : "input: ") + t.freq // ); @@ -145,26 +145,26 @@ public class P2PCache implements IGridCache } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } - private void updateTunnel( long freq, boolean updateOutputs, boolean configChange ) + private void updateTunnel( final long freq, final boolean updateOutputs, final boolean configChange ) { - for( PartP2PTunnel p : this.outputs.get( freq ) ) + for( final PartP2PTunnel p : this.outputs.get( freq ) ) { if( configChange ) { @@ -173,7 +173,7 @@ public class P2PCache implements IGridCache p.onTunnelNetworkChange(); } - PartP2PTunnel in = this.inputs.get( freq ); + final PartP2PTunnel in = this.inputs.get( freq ); if( in != null ) { if( configChange ) @@ -184,7 +184,7 @@ public class P2PCache implements IGridCache } } - public void updateFreq( PartP2PTunnel t, long newFrequency ) + public void updateFreq( final PartP2PTunnel t, final long newFrequency ) { if( this.outputs.containsValue( t ) ) { @@ -213,15 +213,15 @@ public class P2PCache implements IGridCache this.updateTunnel( t.freq, !t.output, true ); } - public TunnelCollection getOutputs( long freq, Class c ) + public TunnelCollection getOutputs( final long freq, final Class c ) { - PartP2PTunnel in = this.inputs.get( freq ); + final PartP2PTunnel in = this.inputs.get( freq ); if( in == null ) { return this.NullColl; } - TunnelCollection out = this.inputs.get( freq ).getCollection( this.outputs.get( freq ), c ); + final TunnelCollection out = this.inputs.get( freq ).getCollection( this.outputs.get( freq ), c ); if( out == null ) { return this.NullColl; @@ -230,7 +230,7 @@ public class P2PCache implements IGridCache return out; } - public PartP2PTunnel getInput( long freq ) + public PartP2PTunnel getInput( final long freq ) { return this.inputs.get( freq ); } diff --git a/src/main/java/appeng/me/cache/PathGridCache.java b/src/main/java/appeng/me/cache/PathGridCache.java index 87e201d9..5f80dcc9 100644 --- a/src/main/java/appeng/me/cache/PathGridCache.java +++ b/src/main/java/appeng/me/cache/PathGridCache.java @@ -76,7 +76,7 @@ public class PathGridCache implements IPathingGrid int lastChannels = 0; private HashSet semiOpen = new HashSet(); - public PathGridCache( IGrid g ) + public PathGridCache( final IGrid g ) { this.myGrid = g; } @@ -103,9 +103,9 @@ public class PathGridCache implements IPathingGrid if( !AEConfig.instance.isFeatureEnabled( AEFeature.Channels ) ) { - int used = this.calculateRequiredChannels(); + final int used = this.calculateRequiredChannels(); - int nodes = this.myGrid.getNodes().size(); + final int nodes = this.myGrid.getNodes().size(); this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); this.channelsByBlocks = nodes * used; this.channelPowerUsage = this.channelsByBlocks / 128.0; @@ -114,14 +114,14 @@ public class PathGridCache implements IPathingGrid } else if( this.controllerState == ControllerState.NO_CONTROLLER ) { - int requiredChannels = this.calculateRequiredChannels(); + final int requiredChannels = this.calculateRequiredChannels(); int used = requiredChannels; if( requiredChannels > 8 ) { used = 0; } - int nodes = this.myGrid.getNodes().size(); + final int nodes = this.myGrid.getNodes().size(); this.channelsInUse = used; this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); @@ -137,22 +137,22 @@ public class PathGridCache implements IPathingGrid } else { - int nodes = this.myGrid.getNodes().size(); + final int nodes = this.myGrid.getNodes().size(); this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 ); - HashSet closedList = new HashSet(); + final HashSet closedList = new HashSet(); this.semiOpen = new HashSet(); // myGrid.getPivot().beginVisit( new AdHocChannelUpdater( 0 ) // ); - for( IGridNode node : this.myGrid.getMachines( TileController.class ) ) + for( final IGridNode node : this.myGrid.getMachines( TileController.class ) ) { closedList.add( (IPathItem) node ); - for( IGridConnection gcc : node.getConnections() ) + for( final IGridConnection gcc : node.getConnections() ) { - GridConnection gc = (GridConnection) gcc; + final GridConnection gc = (GridConnection) gcc; if( !( gc.getOtherSide( node ).getMachine() instanceof TileController ) ) { - List open = new LinkedList(); + final List open = new LinkedList(); closedList.add( gc ); open.add( gc ); gc.setControllerRoute( (GridNode) node, true ); @@ -165,10 +165,10 @@ public class PathGridCache implements IPathingGrid if( !this.active.isEmpty() || this.ticksUntilReady > 0 ) { - Iterator i = this.active.iterator(); + final Iterator i = this.active.iterator(); while( i.hasNext() ) { - PathSegment pat = i.next(); + final PathSegment pat = i.next(); if( pat.step() ) { pat.isDead = true; @@ -201,7 +201,7 @@ public class PathGridCache implements IPathingGrid } @Override - public void removeNode( IGridNode gridNode, IGridHost machine ) + public void removeNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof TileController ) { @@ -209,7 +209,7 @@ public class PathGridCache implements IPathingGrid this.recalculateControllerNextTick = true; } - EnumSet flags = gridNode.getGridBlock().getFlags(); + final EnumSet flags = gridNode.getGridBlock().getFlags(); if( flags.contains( GridFlags.REQUIRE_CHANNEL ) ) { @@ -225,7 +225,7 @@ public class PathGridCache implements IPathingGrid } @Override - public void addNode( IGridNode gridNode, IGridHost machine ) + public void addNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof TileController ) { @@ -233,7 +233,7 @@ public class PathGridCache implements IPathingGrid this.recalculateControllerNextTick = true; } - EnumSet flags = gridNode.getGridBlock().getFlags(); + final EnumSet flags = gridNode.getGridBlock().getFlags(); if( flags.contains( GridFlags.REQUIRE_CHANNEL ) ) { @@ -249,19 +249,19 @@ public class PathGridCache implements IPathingGrid } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } @@ -269,7 +269,7 @@ public class PathGridCache implements IPathingGrid private void recalcController() { this.recalculateControllerNextTick = false; - ControllerState old = this.controllerState; + final ControllerState old = this.controllerState; if( this.controllers.isEmpty() ) { @@ -277,15 +277,15 @@ public class PathGridCache implements IPathingGrid } else { - IGridNode startingNode = this.controllers.iterator().next().getGridNode( AEPartLocation.INTERNAL ); + final IGridNode startingNode = this.controllers.iterator().next().getGridNode( AEPartLocation.INTERNAL ); if( startingNode == null ) { this.controllerState = ControllerState.CONTROLLER_CONFLICT; return; } - DimensionalCoord dc = startingNode.getGridBlock().getLocation(); - ControllerValidator cv = new ControllerValidator( dc.x, dc.y, dc.z ); + final DimensionalCoord dc = startingNode.getGridBlock().getLocation(); + final ControllerValidator cv = new ControllerValidator( dc.x, dc.y, dc.z ); startingNode.beginVisit( cv ); @@ -310,12 +310,12 @@ public class PathGridCache implements IPathingGrid this.semiOpen.clear(); int depth = 0; - for( IGridNode nodes : this.requireChannels ) + for( final IGridNode nodes : this.requireChannels ) { if( !this.semiOpen.contains( nodes ) ) { - IGridBlock gb = nodes.getGridBlock(); - EnumSet flags = gb.getFlags(); + final IGridBlock gb = nodes.getGridBlock(); + final EnumSet flags = gb.getFlags(); if( flags.contains( GridFlags.COMPRESSED_CHANNEL ) && !this.blockDense.isEmpty() ) { @@ -326,8 +326,8 @@ public class PathGridCache implements IPathingGrid if( flags.contains( GridFlags.MULTIBLOCK ) ) { - IGridMultiblock gmb = (IGridMultiblock) gb; - Iterator i = gmb.getMultiblockNodes(); + final IGridMultiblock gmb = (IGridMultiblock) gb; + final Iterator i = gmb.getMultiblockNodes(); while( i.hasNext() ) { this.semiOpen.add( (IPathItem) i.next() ); @@ -343,17 +343,17 @@ public class PathGridCache implements IPathingGrid { if( this.lastChannels != this.channelsInUse && AEConfig.instance.isFeatureEnabled( AEFeature.Channels ) ) { - Achievements currentBracket = this.getAchievementBracket( this.channelsInUse ); - Achievements lastBracket = this.getAchievementBracket( this.lastChannels ); + final Achievements currentBracket = this.getAchievementBracket( this.channelsInUse ); + final Achievements lastBracket = this.getAchievementBracket( this.lastChannels ); if( currentBracket != lastBracket && currentBracket != null ) { - Set players = new HashSet(); - for( IGridNode n : this.requireChannels ) + final Set players = new HashSet(); + for( final IGridNode n : this.requireChannels ) { players.add( n.getPlayerID() ); } - for( int id : players ) + for( final int id : players ) { Platform.addStat( id, currentBracket.getAchievement() ); } @@ -362,7 +362,7 @@ public class PathGridCache implements IPathingGrid this.lastChannels = this.channelsInUse; } - private Achievements getAchievementBracket( int ch ) + private Achievements getAchievementBracket( final int ch ) { if( ch < 8 ) { @@ -383,9 +383,9 @@ public class PathGridCache implements IPathingGrid } @MENetworkEventSubscribe - void updateNodReq( MENetworkChannelChanged ev ) + void updateNodReq( final MENetworkChannelChanged ev ) { - IGridNode gridNode = ev.node; + final IGridNode gridNode = ev.node; if( gridNode.getGridBlock().getFlags().contains( GridFlags.REQUIRE_CHANNEL ) ) { diff --git a/src/main/java/appeng/me/cache/SecurityCache.java b/src/main/java/appeng/me/cache/SecurityCache.java index 125571d7..863bbf2b 100644 --- a/src/main/java/appeng/me/cache/SecurityCache.java +++ b/src/main/java/appeng/me/cache/SecurityCache.java @@ -49,13 +49,13 @@ public class SecurityCache implements ISecurityGrid private final HashMap> playerPerms = new HashMap>(); private long securityKey = -1; - public SecurityCache( IGrid g ) + public SecurityCache( final IGrid g ) { this.myGrid = g; } @MENetworkEventSubscribe - public void updatePermissions( MENetworkSecurityChange ev ) + public void updatePermissions( final MENetworkSecurityChange ev ) { this.playerPerms.clear(); if( this.securityProvider.isEmpty() ) @@ -78,7 +78,7 @@ public class SecurityCache implements ISecurityGrid } @Override - public void removeNode( IGridNode gridNode, IGridHost machine ) + public void removeNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof ISecurityProvider ) { @@ -89,7 +89,7 @@ public class SecurityCache implements ISecurityGrid private void updateSecurityKey() { - long lastCode = this.securityKey; + final long lastCode = this.securityKey; if( this.securityProvider.size() == 1 ) { @@ -103,7 +103,7 @@ public class SecurityCache implements ISecurityGrid if( lastCode != this.securityKey ) { this.myGrid.postEvent( new MENetworkSecurityChange() ); - for( IGridNode n : this.myGrid.getNodes() ) + for( final IGridNode n : this.myGrid.getNodes() ) { ( (GridNode) n ).lastSecurityKey = this.securityKey; } @@ -111,7 +111,7 @@ public class SecurityCache implements ISecurityGrid } @Override - public void addNode( IGridNode gridNode, IGridHost machine ) + public void addNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof ISecurityProvider ) { @@ -125,19 +125,19 @@ public class SecurityCache implements ISecurityGrid } @Override - public void onSplit( IGridStorage destinationStorage ) + public void onSplit( final IGridStorage destinationStorage ) { } @Override - public void onJoin( IGridStorage sourceStorage ) + public void onJoin( final IGridStorage sourceStorage ) { } @Override - public void populateGridStorage( IGridStorage destinationStorage ) + public void populateGridStorage( final IGridStorage destinationStorage ) { } @Override @@ -149,7 +149,7 @@ public class SecurityCache implements ISecurityGrid @Override - public boolean hasPermission( EntityPlayer player, SecurityPermissions perm ) + public boolean hasPermission( final EntityPlayer player, final SecurityPermissions perm ) { Preconditions.checkNotNull( player ); Preconditions.checkNotNull( perm ); @@ -161,11 +161,11 @@ public class SecurityCache implements ISecurityGrid } @Override - public boolean hasPermission( int playerID, SecurityPermissions perm ) + public boolean hasPermission( final int playerID, final SecurityPermissions perm ) { if( this.isAvailable() ) { - EnumSet perms = this.playerPerms.get( playerID ); + final EnumSet perms = this.playerPerms.get( playerID ); if( perms == null ) { diff --git a/src/main/java/appeng/me/cache/SpatialPylonCache.java b/src/main/java/appeng/me/cache/SpatialPylonCache.java index 3f61905e..564eb8eb 100644 --- a/src/main/java/appeng/me/cache/SpatialPylonCache.java +++ b/src/main/java/appeng/me/cache/SpatialPylonCache.java @@ -51,34 +51,34 @@ public class SpatialPylonCache implements ISpatialCache HashMap clusters = new HashMap(); boolean needsUpdate = false; - public SpatialPylonCache( IGrid g ) + public SpatialPylonCache( final IGrid g ) { this.myGrid = g; } @MENetworkEventSubscribe - public void bootingRender( MENetworkBootingStatusChange c ) + public void bootingRender( final MENetworkBootingStatusChange c ) { this.reset( this.myGrid ); } - public void reset( IGrid grid ) + public void reset( final IGrid grid ) { this.clusters = new HashMap(); this.ioPorts = new LinkedList(); - for( IGridNode gm : grid.getMachines( TileSpatialIOPort.class ) ) + for( final IGridNode gm : grid.getMachines( TileSpatialIOPort.class ) ) { this.ioPorts.add( (TileSpatialIOPort) gm.getMachine() ); } - IReadOnlyCollection set = grid.getMachines( TileSpatialPylon.class ); - for( IGridNode gm : set ) + final IReadOnlyCollection set = grid.getMachines( TileSpatialPylon.class ); + for( final IGridNode gm : set ) { if( gm.meetsChannelRequirements() ) { - SpatialPylonCluster c = ( (TileSpatialPylon) gm.getMachine() ).getCluster(); + final SpatialPylonCluster c = ( (TileSpatialPylon) gm.getMachine() ).getCluster(); if( c != null ) { this.clusters.put( c, c ); @@ -91,7 +91,7 @@ public class SpatialPylonCache implements ISpatialCache this.isValid = true; int pylonBlocks = 0; - for( SpatialPylonCluster cl : this.clusters.values() ) + for( final SpatialPylonCluster cl : this.clusters.values() ) { if( this.captureMax == null ) { @@ -119,7 +119,7 @@ public class SpatialPylonCache implements ISpatialCache { this.isValid = this.captureMax.x - this.captureMin.x > 1 && this.captureMax.y - this.captureMin.y > 1 && this.captureMax.z - this.captureMin.z > 1; - for( SpatialPylonCluster cl : this.clusters.values() ) + for( final SpatialPylonCluster cl : this.clusters.values() ) { switch( cl.currentAxis ) { @@ -144,10 +144,10 @@ public class SpatialPylonCache implements ISpatialCache } } - int reqX = this.captureMax.x - this.captureMin.x; - int reqY = this.captureMax.y - this.captureMin.y; - int reqZ = this.captureMax.z - this.captureMin.z; - int requirePylonBlocks = Math.max( 6, ( ( reqX * reqZ + reqX * reqY + reqY * reqZ ) * 3 ) / 8 ); + final int reqX = this.captureMax.x - this.captureMin.x; + final int reqY = this.captureMax.y - this.captureMin.y; + final int reqZ = this.captureMax.z - this.captureMin.z; + final int requirePylonBlocks = Math.max( 6, ( ( reqX * reqZ + reqX * reqY + reqY * reqZ ) * 3 ) / 8 ); this.efficiency = (double) pylonBlocks / (double) requirePylonBlocks; @@ -164,12 +164,12 @@ public class SpatialPylonCache implements ISpatialCache maxPower = Math.pow( minPower, AEConfig.instance.spatialPowerExponent ); } - double affective_efficiency = Math.pow( this.efficiency, 0.25 ); + final double affective_efficiency = Math.pow( this.efficiency, 0.25 ); this.powerRequired = (long) ( affective_efficiency * minPower + ( 1.0 - affective_efficiency ) * maxPower ); - for( SpatialPylonCluster cl : this.clusters.values() ) + for( final SpatialPylonCluster cl : this.clusters.values() ) { - boolean myWasValid = cl.isValid; + final boolean myWasValid = cl.isValid; cl.isValid = this.isValid; if( myWasValid != this.isValid ) { @@ -220,31 +220,31 @@ public class SpatialPylonCache implements ISpatialCache } @Override - public void removeNode( IGridNode node, IGridHost machine ) + public void removeNode( final IGridNode node, final IGridHost machine ) { } @Override - public void addNode( IGridNode node, IGridHost machine ) + public void addNode( final IGridNode node, final IGridHost machine ) { } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } diff --git a/src/main/java/appeng/me/cache/TickManagerCache.java b/src/main/java/appeng/me/cache/TickManagerCache.java index 468ea22b..e609bdab 100644 --- a/src/main/java/appeng/me/cache/TickManagerCache.java +++ b/src/main/java/appeng/me/cache/TickManagerCache.java @@ -46,7 +46,7 @@ public class TickManagerCache implements ITickManager final PriorityQueue upcomingTicks = new PriorityQueue(); private long currentTick = 0; - public TickManagerCache( IGrid g ) + public TickManagerCache( final IGrid g ) { this.myGrid = g; } @@ -56,7 +56,7 @@ public class TickManagerCache implements ITickManager return this.currentTick; } - public long getAvgNanoTime( IGridNode node ) + public long getAvgNanoTime( final IGridNode node ) { TickTracker tt = this.awake.get( node ); @@ -83,12 +83,12 @@ public class TickManagerCache implements ITickManager while( !this.upcomingTicks.isEmpty() ) { tt = this.upcomingTicks.peek(); - int diff = (int) ( this.currentTick - tt.lastTick ); + final int diff = (int) ( this.currentTick - tt.lastTick ); if( diff >= tt.current_rate ) { // remove tt.. this.upcomingTicks.poll(); - TickRateModulation mod = tt.gt.tickingRequest( tt.node, diff ); + final TickRateModulation mod = tt.gt.tickingRequest( tt.node, diff ); switch( mod ) { @@ -124,23 +124,23 @@ public class TickManagerCache implements ITickManager } } } - catch( Throwable t ) + catch( final Throwable t ) { - CrashReport crashreport = CrashReport.makeCrashReport( t, "Ticking GridNode" ); - CrashReportCategory crashreportcategory = crashreport.makeCategory( tt.gt.getClass().getSimpleName() + " being ticked." ); + final CrashReport crashreport = CrashReport.makeCrashReport( t, "Ticking GridNode" ); + final CrashReportCategory crashreportcategory = crashreport.makeCategory( tt.gt.getClass().getSimpleName() + " being ticked." ); tt.addEntityCrashInfo( crashreportcategory ); throw new ReportedException( crashreport ); } } - private void addToQueue( TickTracker tt ) + private void addToQueue( final TickTracker tt ) { tt.lastTick = this.currentTick; this.upcomingTicks.add( tt ); } @Override - public void removeNode( IGridNode gridNode, IGridHost machine ) + public void removeNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof IGridTickable ) { @@ -151,14 +151,14 @@ public class TickManagerCache implements ITickManager } @Override - public void addNode( IGridNode gridNode, IGridHost machine ) + public void addNode( final IGridNode gridNode, final IGridHost machine ) { if( machine instanceof IGridTickable ) { - TickingRequest tr = ( (IGridTickable) machine ).getTickingRequest( gridNode ); + final TickingRequest tr = ( (IGridTickable) machine ).getTickingRequest( gridNode ); if( tr != null ) { - TickTracker tt = new TickTracker( tr, gridNode, (IGridTickable) machine, this.currentTick, this ); + final TickTracker tt = new TickTracker( tr, gridNode, (IGridTickable) machine, this.currentTick, this ); if( tr.canBeAlerted ) { @@ -179,27 +179,27 @@ public class TickManagerCache implements ITickManager } @Override - public void onSplit( IGridStorage storageB ) + public void onSplit( final IGridStorage storageB ) { } @Override - public void onJoin( IGridStorage storageB ) + public void onJoin( final IGridStorage storageB ) { } @Override - public void populateGridStorage( IGridStorage storage ) + public void populateGridStorage( final IGridStorage storage ) { } @Override - public boolean alertDevice( IGridNode node ) + public boolean alertDevice( final IGridNode node ) { - TickTracker tt = this.alertable.get( node ); + final TickTracker tt = this.alertable.get( node ); if( tt == null ) { return false; @@ -223,11 +223,11 @@ public class TickManagerCache implements ITickManager } @Override - public boolean sleepDevice( IGridNode node ) + public boolean sleepDevice( final IGridNode node ) { if( this.awake.containsKey( node ) ) { - TickTracker gt = this.awake.get( node ); + final TickTracker gt = this.awake.get( node ); this.awake.remove( node ); this.sleeping.put( node, gt ); @@ -238,11 +238,11 @@ public class TickManagerCache implements ITickManager } @Override - public boolean wakeDevice( IGridNode node ) + public boolean wakeDevice( final IGridNode node ) { if( this.sleeping.containsKey( node ) ) { - TickTracker gt = this.sleeping.get( node ); + final TickTracker gt = this.sleeping.get( node ); this.sleeping.remove( node ); this.awake.put( node, gt ); this.addToQueue( gt ); diff --git a/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java b/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java index 760bf5d9..514f50fc 100644 --- a/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java +++ b/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java @@ -27,7 +27,7 @@ public class ConnectionWrapper public IGridConnection connection; - public ConnectionWrapper( IGridConnection gc ) + public ConnectionWrapper( final IGridConnection gc ) { this.connection = gc; } diff --git a/src/main/java/appeng/me/cache/helpers/Connections.java b/src/main/java/appeng/me/cache/helpers/Connections.java index f99db2b9..02f7846c 100644 --- a/src/main/java/appeng/me/cache/helpers/Connections.java +++ b/src/main/java/appeng/me/cache/helpers/Connections.java @@ -36,13 +36,13 @@ public class Connections implements IWorldCallable public boolean create = false; public boolean destroy = false; - public Connections( PartP2PTunnelME o ) + public Connections( final PartP2PTunnelME o ) { this.me = o; } @Override - public Void call( World world ) throws Exception + public Void call( final World world ) throws Exception { this.me.updateConnections( this ); diff --git a/src/main/java/appeng/me/cache/helpers/TickTracker.java b/src/main/java/appeng/me/cache/helpers/TickTracker.java index c8947ee9..89b07031 100644 --- a/src/main/java/appeng/me/cache/helpers/TickTracker.java +++ b/src/main/java/appeng/me/cache/helpers/TickTracker.java @@ -43,7 +43,7 @@ public class TickTracker implements Comparable public long lastTick; public int current_rate; - public TickTracker( TickingRequest req, IGridNode node, IGridTickable gt, long currentTick, TickManagerCache tickManagerCache ) + public TickTracker( final TickingRequest req, final IGridNode node, final IGridTickable gt, final long currentTick, final TickManagerCache tickManagerCache ) { this.request = req; this.gt = gt; @@ -58,7 +58,7 @@ public class TickTracker implements Comparable return ( this.LastFiveTicksTime / 5 ); } - public void setRate( int rate ) + public void setRate( final int rate ) { this.current_rate = rate; @@ -74,18 +74,18 @@ public class TickTracker implements Comparable } @Override - public int compareTo( @Nonnull TickTracker t ) + public int compareTo( @Nonnull final TickTracker t ) { - int nextTick = (int) ( ( this.lastTick - this.host.getCurrentTick() ) + this.current_rate ); - int ts_nextTick = (int) ( ( t.lastTick - this.host.getCurrentTick() ) + t.current_rate ); + final int nextTick = (int) ( ( this.lastTick - this.host.getCurrentTick() ) + this.current_rate ); + final int ts_nextTick = (int) ( ( t.lastTick - this.host.getCurrentTick() ) + t.current_rate ); return nextTick - ts_nextTick; } - public void addEntityCrashInfo( CrashReportCategory crashreportcategory ) + public void addEntityCrashInfo( final CrashReportCategory crashreportcategory ) { if( this.gt instanceof AEBasePart ) { - AEBasePart part = (AEBasePart) this.gt; + final AEBasePart part = (AEBasePart) this.gt; part.addEntityCrashInfo( crashreportcategory ); } @@ -96,7 +96,7 @@ public class TickTracker implements Comparable crashreportcategory.addCrashSection( "GridBlockType", this.node.getGridBlock().getClass().getName() ); crashreportcategory.addCrashSection( "ConnectedSides", this.node.getConnectedSides() ); - DimensionalCoord dc = this.node.getGridBlock().getLocation(); + final DimensionalCoord dc = this.node.getGridBlock().getLocation(); if( dc != null ) { crashreportcategory.addCrashSection( "Location", dc ); diff --git a/src/main/java/appeng/me/cache/helpers/TunnelCollection.java b/src/main/java/appeng/me/cache/helpers/TunnelCollection.java index f6f2f850..88763bbb 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelCollection.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelCollection.java @@ -32,13 +32,13 @@ public class TunnelCollection implements Iterable final Class clz; Collection tunnelSources; - public TunnelCollection( Collection src, Class c ) + public TunnelCollection( final Collection src, final Class c ) { this.tunnelSources = src; this.clz = c; } - public void setSource( Collection c ) + public void setSource( final Collection c ) { this.tunnelSources = c; } @@ -58,7 +58,7 @@ public class TunnelCollection implements Iterable return new TunnelIterator( this.tunnelSources, this.clz ); } - public boolean matches( Class c ) + public boolean matches( final Class c ) { return this.clz == c; } diff --git a/src/main/java/appeng/me/cache/helpers/TunnelConnection.java b/src/main/java/appeng/me/cache/helpers/TunnelConnection.java index f1762baa..388ab370 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelConnection.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelConnection.java @@ -29,7 +29,7 @@ public class TunnelConnection public final PartP2PTunnelME tunnel; public final IGridConnection c; - public TunnelConnection( PartP2PTunnelME t, IGridConnection con ) + public TunnelConnection( final PartP2PTunnelME t, final IGridConnection con ) { this.tunnel = t; this.c = con; diff --git a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java index 89436df1..bfe6a669 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java @@ -32,7 +32,7 @@ public class TunnelIterator implements Iterator final Class targetType; T Next; - public TunnelIterator( Collection tunnelSources, Class clz ) + public TunnelIterator( final Collection tunnelSources, final Class clz ) { this.wrapped = tunnelSources.iterator(); this.targetType = clz; @@ -61,7 +61,7 @@ public class TunnelIterator implements Iterator @Override public T next() { - T tmp = this.Next; + final T tmp = this.Next; this.Next = null; return tmp; } diff --git a/src/main/java/appeng/me/cluster/MBCalculator.java b/src/main/java/appeng/me/cluster/MBCalculator.java index 54924bc5..3fb73068 100644 --- a/src/main/java/appeng/me/cluster/MBCalculator.java +++ b/src/main/java/appeng/me/cluster/MBCalculator.java @@ -33,12 +33,12 @@ public abstract class MBCalculator private final IAEMultiBlock target; - public MBCalculator( IAEMultiBlock t ) + public MBCalculator( final IAEMultiBlock t ) { this.target = t; } - public void calculateMultiblock( World world, WorldCoord loc ) + public void calculateMultiblock( final World world, final WorldCoord loc ) { if( Platform.isClient() ) { @@ -47,8 +47,8 @@ public abstract class MBCalculator try { - WorldCoord min = loc.copy(); - WorldCoord max = loc.copy(); + final WorldCoord min = loc.copy(); + final WorldCoord max = loc.copy(); // find size of MB structure... while( this.isValidTileAt( world, min.x - 1, min.y, min.z ) ) @@ -90,14 +90,14 @@ public abstract class MBCalculator return; } } - catch( Exception err ) + catch( final Exception err ) { this.disconnect(); return; } boolean updateGrid = false; - IAECluster cluster = this.target.getCluster(); + final IAECluster cluster = this.target.getCluster(); if( cluster == null ) { this.updateTiles( c, world, min, max ); @@ -114,7 +114,7 @@ public abstract class MBCalculator } } } - catch( Throwable err ) + catch( final Throwable err ) { AELog.error( err ); } @@ -122,7 +122,7 @@ public abstract class MBCalculator this.disconnect(); } - public boolean isValidTileAt( World w, int x, int y, int z ) + public boolean isValidTileAt( final World w, final int x, final int y, final int z ) { return this.isValidTile( w.getTileEntity( new BlockPos( x, y, z ) ) ); } @@ -137,9 +137,9 @@ public abstract class MBCalculator */ public abstract boolean checkMultiblockScale( WorldCoord min, WorldCoord max ); - public boolean verifyUnownedRegion( World w, WorldCoord min, WorldCoord max ) + public boolean verifyUnownedRegion( final World w, final WorldCoord min, final WorldCoord max ) { - for( AEPartLocation side : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS ) { if( this.verifyUnownedRegionInner( w, min.x, min.y, min.z, max.x, max.y, max.z, side ) ) { @@ -187,7 +187,7 @@ public abstract class MBCalculator */ public abstract boolean isValidTile( TileEntity te ); - public boolean verifyUnownedRegionInner( World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, AEPartLocation side ) + public boolean verifyUnownedRegionInner( final World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, final AEPartLocation side ) { switch( side ) { @@ -225,7 +225,7 @@ public abstract class MBCalculator { for( int z = minZ; z <= maxZ; z++ ) { - TileEntity te = w.getTileEntity( new BlockPos( x, y, z ) ); + final TileEntity te = w.getTileEntity( new BlockPos( x, y, z ) ); if( this.isValidTile( te ) ) { return true; diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java index 448229b2..73aefb50 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java @@ -41,14 +41,14 @@ public class CraftingCPUCalculator extends MBCalculator final TileCraftingTile tqb; - public CraftingCPUCalculator( IAEMultiBlock t ) + public CraftingCPUCalculator( final IAEMultiBlock t ) { super( t ); this.tqb = (TileCraftingTile) t; } @Override - public boolean checkMultiblockScale( WorldCoord min, WorldCoord max ) + public boolean checkMultiblockScale( final WorldCoord min, final WorldCoord max ) { if( max.x - min.x > 16 ) { @@ -69,13 +69,13 @@ public class CraftingCPUCalculator extends MBCalculator } @Override - public IAECluster createCluster( World w, WorldCoord min, WorldCoord max ) + public IAECluster createCluster( final World w, final WorldCoord min, final WorldCoord max ) { return new CraftingCPUCluster( min, max ); } @Override - public boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max ) + public boolean verifyInternalStructure( final World w, final WorldCoord min, final WorldCoord max ) { boolean storage = false; @@ -85,7 +85,7 @@ public class CraftingCPUCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) ); + final IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) ); if( !te.isValid() ) { @@ -110,9 +110,9 @@ public class CraftingCPUCalculator extends MBCalculator } @Override - public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max ) + public void updateTiles( final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max ) { - CraftingCPUCluster c = (CraftingCPUCluster) cl; + final CraftingCPUCluster c = (CraftingCPUCluster) cl; for( int x = min.x; x <= max.x; x++ ) { @@ -120,7 +120,7 @@ public class CraftingCPUCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - TileCraftingTile te = (TileCraftingTile) w.getTileEntity( new BlockPos( x, y, z ) ); + final TileCraftingTile te = (TileCraftingTile) w.getTileEntity( new BlockPos( x, y, z ) ); te.updateStatus( c ); c.addTile( te ); } @@ -129,14 +129,14 @@ public class CraftingCPUCalculator extends MBCalculator c.done(); - Iterator i = c.getTiles(); + final Iterator i = c.getTiles(); while( i.hasNext() ) { - IGridHost gh = i.next(); - IGridNode n = gh.getGridNode( AEPartLocation.INTERNAL ); + final IGridHost gh = i.next(); + final IGridNode n = gh.getGridNode( AEPartLocation.INTERNAL ); if( n != null ) { - IGrid g = n.getGrid(); + final IGrid g = n.getGrid(); if( g != null ) { g.postEvent( new MENetworkCraftingCpuChange( n ) ); @@ -147,7 +147,7 @@ public class CraftingCPUCalculator extends MBCalculator } @Override - public boolean isValidTile( TileEntity te ) + public boolean isValidTile( final TileEntity te ) { return te instanceof TileCraftingTile; } diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java index 76132a1f..4b0a8797 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java @@ -112,7 +112,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU private long startItemCount; private long remainingItemCount; - public CraftingCPUCluster( WorldCoord min, WorldCoord max ) + public CraftingCPUCluster( final WorldCoord min, final WorldCoord max ) { this.min = min; this.max = max; @@ -132,7 +132,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU * add a new Listener to the monitor, be sure to properly remove yourself when your done. */ @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { this.listeners.put( l, verificationToken ); } @@ -141,7 +141,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU * remove a Listener to the monitor. */ @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver l ) { this.listeners.remove( l ); } @@ -152,9 +152,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } @Override - public void updateStatus( boolean updateGrid ) + public void updateStatus( final boolean updateGrid ) { - for( TileCraftingTile r : this.tiles ) + for( final TileCraftingTile r : this.tiles ) { r.updateMeta( true ); } @@ -171,7 +171,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU boolean posted = false; - for( TileCraftingTile r : this.tiles ) + for( final TileCraftingTile r : this.tiles ) { final IGridNode n = r.getActionableNode(); if( n != null && !posted ) @@ -194,7 +194,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return (Iterator) this.tiles.iterator(); } - public void addTile( TileCraftingTile te ) + public void addTile( final TileCraftingTile te ) { if( this.machineSrc == null || te.isCoreBlock ) { @@ -220,7 +220,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - public boolean canAccept( IAEStack input ) + public boolean canAccept( final IAEStack input ) { if( input instanceof IAEItemStack ) { @@ -233,7 +233,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return false; } - public IAEStack injectItems( IAEStack input, Actionable type, BaseActionSource src ) + public IAEStack injectItems( final IAEStack input, final Actionable type, final BaseActionSource src ) { if( !( input instanceof IAEItemStack ) ) { @@ -362,7 +362,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return input; } - protected void postChange( IAEItemStack diff, BaseActionSource src ) + protected void postChange( final IAEItemStack diff, final BaseActionSource src ) { final Iterator, Object>> i = this.getListeners(); @@ -394,7 +394,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.getCore().markDirty(); } - public void postCraftingStatusChange( IAEItemStack diff ) + public void postCraftingStatusChange( final IAEItemStack diff ) { if( this.getGrid() == null ) { @@ -409,7 +409,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU if( !list.isEmpty() ) { - for( CraftingWatcher iw : list ) + for( final CraftingWatcher iw : list ) { iw.getHost().onRequestChange( sg, diff ); @@ -442,7 +442,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU send = null; } - for( TileCraftingMonitorTile t : this.status ) + for( final TileCraftingMonitorTile t : this.status ) { t.setJob( send ); } @@ -460,7 +460,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU public IGrid getGrid() { - for( TileCraftingTile r : this.tiles ) + for( final TileCraftingTile r : this.tiles ) { final IGridNode gn = r.getActionableNode(); if( gn != null ) @@ -476,7 +476,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return null; } - private boolean canCraft( ICraftingPatternDetails details, IAEItemStack[] condensedInputs ) + private boolean canCraft( final ICraftingPatternDetails details, final IAEItemStack[] condensedInputs ) { for( IAEItemStack g : condensedInputs ) { @@ -531,9 +531,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.myLastLink.cancel(); } - IItemList list; + final IItemList list; this.getListOfItem( list = AEApi.instance().storage().createItemList(), CraftingItemList.ALL ); - for( IAEItemStack is : list ) + for( final IAEItemStack is : list ) { this.postChange( is, this.machineSrc ); } @@ -546,7 +546,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.waitingFor.resetStatus(); - for( IAEItemStack is : items ) + for( final IAEItemStack is : items ) { this.postCraftingStatusChange( is ); } @@ -557,7 +557,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.storeItems(); // marks dirty } - public void updateCraftingLogic( IGrid grid, IEnergyGrid eg, CraftingGridCache cc ) + public void updateCraftingLogic( final IGrid grid, final IEnergyGrid eg, final CraftingGridCache cc ) { if( !this.getCore().isActive() ) { @@ -612,7 +612,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - private void executeCrafting( IEnergyGrid eg, CraftingGridCache cc ) + private void executeCrafting( final IEnergyGrid eg, final CraftingGridCache cc ) { final Iterator> i = this.tasks.entrySet().iterator(); @@ -632,7 +632,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU { InventoryCrafting ic = null; - for( ICraftingMedium m : cc.getMediums( e.getKey() ) ) + for( final ICraftingMedium m : cc.getMediums( e.getKey() ) ) { if( e.getValue().value <= 0 ) { @@ -646,7 +646,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU final IAEItemStack[] input = details.getInputs(); double sum = 0; - for( IAEItemStack anInput : input ) + for( final IAEItemStack anInput : input ) { if( anInput != null ) { @@ -736,7 +736,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.somethingChanged = true; this.remainingOperations--; - for( IAEItemStack out : details.getCondensedOutputs() ) + for( final IAEItemStack out : details.getCondensedOutputs() ) { this.postChange( out, this.machineSrc ); this.waitingFor.add( out.copy() ); @@ -829,7 +829,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.markDirty(); } - public ICraftingLink submitJob( IGrid g, ICraftingJob job, BaseActionSource src, ICraftingRequester requestingMachine ) + public ICraftingLink submitJob( final IGrid g, final ICraftingJob job, final BaseActionSource src, final ICraftingRequester requestingMachine ) { if( !this.tasks.isEmpty() || !this.waitingFor.isEmpty() ) { @@ -880,7 +880,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU final IItemList list = AEApi.instance().storage().createItemList(); this.getListOfItem( list, CraftingItemList.ALL ); - for( IAEItemStack ge : list ) + for( final IAEItemStack ge : list ) { this.postChange( ge, this.machineSrc ); } @@ -893,7 +893,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.inventory.getItemList().resetStatus(); } } - catch( CraftBranchFailure e ) + catch( final CraftBranchFailure e ) { this.tasks.clear(); this.inventory.getItemList().resetStatus(); @@ -970,7 +970,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return Long.toString( now, Character.MAX_RADIX ) + '-' + Integer.toString( hash, Character.MAX_RADIX ) + '-' + Integer.toString( hmm, Character.MAX_RADIX ); } - private NBTTagCompound generateLinkData( String craftingID, boolean standalone, boolean req ) + private NBTTagCompound generateLinkData( final String craftingID, final boolean standalone, final boolean req ) { final NBTTagCompound tag = new NBTTagCompound(); @@ -983,7 +983,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return tag; } - private void submitLink( ICraftingLink myLastLink2 ) + private void submitLink( final ICraftingLink myLastLink2 ) { if( this.getGrid() != null ) { @@ -992,18 +992,18 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - public void getListOfItem( IItemList list, CraftingItemList whichList ) + public void getListOfItem( final IItemList list, final CraftingItemList whichList ) { switch( whichList ) { case ACTIVE: - for( IAEItemStack ais : this.waitingFor ) + for( final IAEItemStack ais : this.waitingFor ) { list.add( ais ); } break; case PENDING: - for( Entry t : this.tasks.entrySet() ) + for( final Entry t : this.tasks.entrySet() ) { for( IAEItemStack ais : t.getKey().getCondensedOutputs() ) { @@ -1020,12 +1020,12 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU case ALL: this.inventory.getAvailableItems( list ); - for( IAEItemStack ais : this.waitingFor ) + for( final IAEItemStack ais : this.waitingFor ) { list.add( ais ); } - for( Entry t : this.tasks.entrySet() ) + for( final Entry t : this.tasks.entrySet() ) { for( IAEItemStack ais : t.getKey().getCondensedOutputs() ) { @@ -1038,18 +1038,18 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - public void addStorage( IAEItemStack extractItems ) + public void addStorage( final IAEItemStack extractItems ) { this.inventory.injectItems( extractItems, Actionable.MODULATE, null ); } - public void addEmitable( IAEItemStack i ) + public void addEmitable( final IAEItemStack i ) { this.waitingFor.add( i ); this.postCraftingStatusChange( i ); } - public void addCrafting( ICraftingPatternDetails details, long crafts ) + public void addCrafting( final ICraftingPatternDetails details, final long crafts ) { TaskProgress i = this.tasks.get( details ); @@ -1061,7 +1061,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU i.value += crafts; } - public IAEItemStack getItemStack( IAEItemStack what, CraftingItemList storage2 ) + public IAEItemStack getItemStack( final IAEItemStack what, final CraftingItemList storage2 ) { IAEItemStack is; @@ -1078,9 +1078,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU is = what.copy(); is.setStackSize( 0 ); - for( Entry t : this.tasks.entrySet() ) + for( final Entry t : this.tasks.entrySet() ) { - for( IAEItemStack ais : t.getKey().getCondensedOutputs() ) + for( final IAEItemStack ais : t.getKey().getCondensedOutputs() ) { if( ais.equals( is ) ) { @@ -1105,7 +1105,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return is; } - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { data.setTag( "finalOutput", this.writeItem( this.finalOutput ) ); data.setTag( "inventory", this.writeList( this.inventory.getItemList() ) ); @@ -1120,7 +1120,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } final NBTTagList list = new NBTTagList(); - for( Entry e : this.tasks.entrySet() ) + for( final Entry e : this.tasks.entrySet() ) { final NBTTagCompound item = this.writeItem( AEItemStack.create( e.getKey().getPattern() ) ); item.setLong( "craftingProgress", e.getValue().value ); @@ -1135,7 +1135,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU data.setLong( "remainingItemCount", this.getRemainingItemCount() ); } - private NBTTagCompound writeItem( IAEItemStack finalOutput2 ) + private NBTTagCompound writeItem( final IAEItemStack finalOutput2 ) { final NBTTagCompound out = new NBTTagCompound(); @@ -1147,11 +1147,11 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return out; } - private NBTTagList writeList( IItemList myList ) + private NBTTagList writeList( final IItemList myList ) { final NBTTagList out = new NBTTagList(); - for( IAEItemStack ais : myList ) + for( final IAEItemStack ais : myList ) { out.appendTag( this.writeItem( ais ) ); } @@ -1175,10 +1175,10 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.updateName(); } - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { this.finalOutput = AEItemStack.loadItemStackFromNBT( (NBTTagCompound) data.getTag( "finalOutput" ) ); - for( IAEItemStack ais : this.readList( (NBTTagList) data.getTag( "inventory" ) ) ) + for( final IAEItemStack ais : this.readList( (NBTTagList) data.getTag( "inventory" ) ) ) { this.inventory.injectItems( ais, Actionable.MODULATE, this.machineSrc ); } @@ -1212,7 +1212,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } this.waitingFor = this.readList( (NBTTagList) data.getTag( "waitingFor" ) ); - for( IAEItemStack is : this.waitingFor ) + for( final IAEItemStack is : this.waitingFor ) { this.postCraftingStatusChange( is.copy() ); } @@ -1226,7 +1226,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU public void updateName() { this.myName = ""; - for( TileCraftingTile te : this.tiles ) + for( final TileCraftingTile te : this.tiles ) { if( te.hasCustomName() ) @@ -1243,7 +1243,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU } } - private IItemList readList( NBTTagList tag ) + private IItemList readList( final NBTTagList tag ) { final IItemList out = AEApi.instance().storage().createItemList(); @@ -1269,7 +1269,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU return this.getCore().getWorld(); } - public boolean isMaking( IAEItemStack what ) + public boolean isMaking( final IAEItemStack what ) { final IAEItemStack wat = this.waitingFor.findPrecise( what ); return wat != null && wat.getStackSize() > 0; @@ -1296,7 +1296,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.getListOfItem( list, CraftingItemList.PENDING ); int itemCount = 0; - for( IAEItemStack ge : list ) + for( final IAEItemStack ge : list ) { itemCount += ge.getStackSize(); } @@ -1305,7 +1305,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU this.remainingItemCount = itemCount; } - private void updateElapsedTime( IAEItemStack is ) + private void updateElapsedTime( final IAEItemStack is ) { final long nextStartTime = System.nanoTime(); this.elapsedTime = this.getElapsedTime() + nextStartTime - lastTime; diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java index 53649bc8..aafb793b 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java @@ -39,21 +39,21 @@ public class QuantumCalculator extends MBCalculator private final TileQuantumBridge tqb; - public QuantumCalculator( IAEMultiBlock t ) + public QuantumCalculator( final IAEMultiBlock t ) { super( t ); this.tqb = (TileQuantumBridge) t; } @Override - public boolean checkMultiblockScale( WorldCoord min, WorldCoord max ) + public boolean checkMultiblockScale( final WorldCoord min, final WorldCoord max ) { if( ( max.x - min.x + 1 ) * ( max.y - min.y + 1 ) * ( max.z - min.z + 1 ) == 9 ) { - int ones = ( ( max.x - min.x ) == 0 ? 1 : 0 ) + ( ( max.y - min.y ) == 0 ? 1 : 0 ) + ( ( max.z - min.z ) == 0 ? 1 : 0 ); + final int ones = ( ( max.x - min.x ) == 0 ? 1 : 0 ) + ( ( max.y - min.y ) == 0 ? 1 : 0 ) + ( ( max.z - min.z ) == 0 ? 1 : 0 ); - int threes = ( ( max.x - min.x ) == 2 ? 1 : 0 ) + ( ( max.y - min.y ) == 2 ? 1 : 0 ) + ( ( max.z - min.z ) == 2 ? 1 : 0 ); + final int threes = ( ( max.x - min.x ) == 2 ? 1 : 0 ) + ( ( max.y - min.y ) == 2 ? 1 : 0 ) + ( ( max.z - min.z ) == 2 ? 1 : 0 ); return ones == 1 && threes == 2; } @@ -61,13 +61,13 @@ public class QuantumCalculator extends MBCalculator } @Override - public IAECluster createCluster( World w, WorldCoord min, WorldCoord max ) + public IAECluster createCluster( final World w, final WorldCoord min, final WorldCoord max ) { return new QuantumCluster( min, max ); } @Override - public boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max ) + public boolean verifyInternalStructure( final World w, final WorldCoord min, final WorldCoord max ) { byte num = 0; @@ -78,8 +78,8 @@ public class QuantumCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - BlockPos p = new BlockPos( x, y, z ); - IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( p ); + final BlockPos p = new BlockPos( x, y, z ); + final IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( p ); if( !te.isValid() ) { @@ -115,11 +115,11 @@ public class QuantumCalculator extends MBCalculator } @Override - public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max ) + public void updateTiles( final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max ) { byte num = 0; byte ringNum = 0; - QuantumCluster c = (QuantumCluster) cl; + final QuantumCluster c = (QuantumCluster) cl; for( int x = min.x; x <= max.x; x++ ) { @@ -127,10 +127,10 @@ public class QuantumCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( new BlockPos( x, y, z ) ); + final TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( new BlockPos( x, y, z ) ); num++; - byte flags; + final byte flags; if( num == 5 ) { flags = num; @@ -157,14 +157,14 @@ public class QuantumCalculator extends MBCalculator } @Override - public boolean isValidTile( TileEntity te ) + public boolean isValidTile( final TileEntity te ) { return te instanceof TileQuantumBridge; } - private boolean isBlockAtLocation( IBlockAccess w, BlockPos pos, IBlockDefinition def ) + private boolean isBlockAtLocation( final IBlockAccess w, final BlockPos pos, final IBlockDefinition def ) { - for( Block block : def.maybeBlock().asSet() ) + for( final Block block : def.maybeBlock().asSet() ) { return block == w.getBlockState( pos ).getBlock(); } diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java index 27aa7934..70f969e1 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java @@ -57,7 +57,7 @@ public class QuantumCluster implements ILocatable, IAECluster private long otherSide; private TileQuantumBridge center; - public QuantumCluster( WorldCoord min, WorldCoord max ) + public QuantumCluster( final WorldCoord min, final WorldCoord max ) { this.min = min; this.max = max; @@ -65,7 +65,7 @@ public class QuantumCluster implements ILocatable, IAECluster } @SubscribeEvent - public void onUnload( WorldEvent.Unload e ) + public void onUnload( final WorldEvent.Unload e ) { if( this.center.getWorld() == e.world ) { @@ -75,10 +75,10 @@ public class QuantumCluster implements ILocatable, IAECluster } @Override - public void updateStatus( boolean updateGrid ) + public void updateStatus( final boolean updateGrid ) { - long qe = this.center.getQEFrequency(); + final long qe = this.center.getQEFrequency(); if( this.thisSide != qe && this.thisSide != -qe ) { @@ -111,23 +111,23 @@ public class QuantumCluster implements ILocatable, IAECluster } } - ILocatable myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().getLocatableBy( this.otherSide ); + final ILocatable myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().getLocatableBy( this.otherSide ); boolean shutdown = false; if( myOtherSide instanceof QuantumCluster ) { - QuantumCluster sideA = this; - QuantumCluster sideB = (QuantumCluster) myOtherSide; + final QuantumCluster sideA = this; + final QuantumCluster sideB = (QuantumCluster) myOtherSide; if( sideA.isActive() && sideB.isActive() ) { if( this.connection != null && this.connection.connection != null ) { - IGridNode a = this.connection.connection.a(); - IGridNode b = this.connection.connection.b(); - IGridNode sa = sideA.getNode(); - IGridNode sb = sideB.getNode(); + final IGridNode a = this.connection.connection.a(); + final IGridNode b = this.connection.connection.b(); + final IGridNode sa = sideA.getNode(); + final IGridNode sb = sideB.getNode(); if( ( a == sa || b == sa ) && ( a == sb || b == sb ) ) { return; @@ -156,7 +156,7 @@ public class QuantumCluster implements ILocatable, IAECluster sideA.connection = sideB.connection = new ConnectionWrapper( AEApi.instance().createGridConnection( sideA.getNode(), sideB.getNode() ) ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // :( } @@ -182,21 +182,21 @@ public class QuantumCluster implements ILocatable, IAECluster } } - public boolean canUseNode( long qe ) + public boolean canUseNode( final long qe ) { - QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy( qe ); + final QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy( qe ); if( qc != null ) { - World theWorld = qc.center.getWorld(); + final World theWorld = qc.center.getWorld(); if( !qc.isDestroyed ) { - Chunk c = theWorld.getChunkFromBlockCoords( qc.center.getPos() ); + final Chunk c = theWorld.getChunkFromBlockCoords( qc.center.getPos() ); if( c.isLoaded() ) { - int id = theWorld.provider.getDimensionId(); - World cur = DimensionManager.getWorld( id ); + final int id = theWorld.provider.getDimensionId(); + final World cur = DimensionManager.getWorld( id ); - TileEntity te = theWorld.getTileEntity( qc.center.getPos() ); + final TileEntity te = theWorld.getTileEntity( qc.center.getPos() ); return te != qc.center || theWorld != cur; } } @@ -247,7 +247,7 @@ public class QuantumCluster implements ILocatable, IAECluster this.center.updateStatus( null, (byte) -1, this.updateStatus ); - for( TileQuantumBridge r : this.Ring ) + for( final TileQuantumBridge r : this.Ring ) { r.updateStatus( null, (byte) -1, this.updateStatus ); } @@ -262,7 +262,7 @@ public class QuantumCluster implements ILocatable, IAECluster return new ChainedIterator( this.Ring[0], this.Ring[1], this.Ring[2], this.Ring[3], this.Ring[4], this.Ring[5], this.Ring[6], this.Ring[7], this.center ); } - public boolean isCorner( TileQuantumBridge tileQuantumBridge ) + public boolean isCorner( final TileQuantumBridge tileQuantumBridge ) { return this.Ring[0] == tileQuantumBridge || this.Ring[2] == tileQuantumBridge || this.Ring[4] == tileQuantumBridge || this.Ring[6] == tileQuantumBridge; } @@ -278,7 +278,7 @@ public class QuantumCluster implements ILocatable, IAECluster return this.center; } - public void setCenter( TileQuantumBridge c ) + public void setCenter( final TileQuantumBridge c ) { this.registered = true; MinecraftForge.EVENT_BUS.register( this ); diff --git a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java index 19bb10be..0b708806 100644 --- a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java @@ -35,26 +35,26 @@ public class SpatialPylonCalculator extends MBCalculator private final TileSpatialPylon tqb; - public SpatialPylonCalculator( IAEMultiBlock t ) + public SpatialPylonCalculator( final IAEMultiBlock t ) { super( t ); this.tqb = (TileSpatialPylon) t; } @Override - public boolean checkMultiblockScale( WorldCoord min, WorldCoord max ) + public boolean checkMultiblockScale( final WorldCoord min, final 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 IAECluster createCluster( World w, WorldCoord min, WorldCoord max ) + public IAECluster createCluster( final World w, final WorldCoord min, final 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 boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max ) + public boolean verifyInternalStructure( final World w, final WorldCoord min, final WorldCoord max ) { for( int x = min.x; x <= max.x; x++ ) @@ -63,7 +63,7 @@ public class SpatialPylonCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) ); + final IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) ); if( !te.isValid() ) { @@ -83,9 +83,9 @@ public class SpatialPylonCalculator extends MBCalculator } @Override - public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max ) + public void updateTiles( final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max ) { - SpatialPylonCluster c = (SpatialPylonCluster) cl; + final SpatialPylonCluster c = (SpatialPylonCluster) cl; for( int x = min.x; x <= max.x; x++ ) { @@ -93,7 +93,7 @@ public class SpatialPylonCalculator extends MBCalculator { for( int z = min.z; z <= max.z; z++ ) { - TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( new BlockPos( x, y, z ) ); + final TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( new BlockPos( x, y, z ) ); te.updateStatus( c ); c.line.add( ( te ) ); } @@ -102,7 +102,7 @@ public class SpatialPylonCalculator extends MBCalculator } @Override - public boolean isValidTile( TileEntity te ) + public boolean isValidTile( final TileEntity te ) { return te instanceof TileSpatialPylon; } diff --git a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java index 96814786..c33801d9 100644 --- a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java @@ -42,7 +42,7 @@ public class SpatialPylonCluster implements IAECluster public boolean hasPower; public boolean hasChannel; - public SpatialPylonCluster( DimensionalCoord min, DimensionalCoord max ) + public SpatialPylonCluster( final DimensionalCoord min, final DimensionalCoord max ) { this.min = min.copy(); this.max = max.copy(); @@ -66,9 +66,9 @@ public class SpatialPylonCluster implements IAECluster } @Override - public void updateStatus( boolean updateGrid ) + public void updateStatus( final boolean updateGrid ) { - for( TileSpatialPylon r : this.line ) + for( final TileSpatialPylon r : this.line ) { r.recalculateDisplay(); } @@ -84,7 +84,7 @@ public class SpatialPylonCluster implements IAECluster } this.isDestroyed = true; - for( TileSpatialPylon r : this.line ) + for( final TileSpatialPylon r : this.line ) { r.updateStatus( null ); } diff --git a/src/main/java/appeng/me/energy/EnergyThreshold.java b/src/main/java/appeng/me/energy/EnergyThreshold.java index 25d1937c..13522fbe 100644 --- a/src/main/java/appeng/me/energy/EnergyThreshold.java +++ b/src/main/java/appeng/me/energy/EnergyThreshold.java @@ -30,7 +30,7 @@ public class EnergyThreshold implements Comparable public final IEnergyWatcher watcher; final int hash; - public EnergyThreshold( double lim, IEnergyWatcher wat ) + public EnergyThreshold( final double lim, final IEnergyWatcher wat ) { this.Limit = lim; this.watcher = wat; @@ -52,7 +52,7 @@ public class EnergyThreshold implements Comparable } @Override - public int compareTo( EnergyThreshold o ) + public int compareTo( final EnergyThreshold o ) { return ItemSorters.compareDouble( this.Limit, o.Limit ); } diff --git a/src/main/java/appeng/me/energy/EnergyWatcher.java b/src/main/java/appeng/me/energy/EnergyWatcher.java index 63167bf2..c827279d 100644 --- a/src/main/java/appeng/me/energy/EnergyWatcher.java +++ b/src/main/java/appeng/me/energy/EnergyWatcher.java @@ -38,13 +38,13 @@ public class EnergyWatcher implements IEnergyWatcher final IEnergyWatcherHost myObject; final HashSet myInterests = new HashSet(); - public EnergyWatcher( EnergyGridCache cache, IEnergyWatcherHost host ) + public EnergyWatcher( final EnergyGridCache cache, final IEnergyWatcherHost host ) { this.gsc = cache; this.myObject = host; } - public void post( EnergyGridCache energyGridCache ) + public void post( final EnergyGridCache energyGridCache ) { this.myObject.onThresholdPass( energyGridCache ); } @@ -67,7 +67,7 @@ public class EnergyWatcher implements IEnergyWatcher } @Override - public boolean contains( Object o ) + public boolean contains( final Object o ) { return this.myInterests.contains( o ); } @@ -85,42 +85,42 @@ public class EnergyWatcher implements IEnergyWatcher } @Override - public T[] toArray( T[] a ) + public T[] toArray( final T[] a ) { return this.myInterests.toArray( a ); } @Override - public boolean add( Double e ) + public boolean add( final Double e ) { if( this.myInterests.contains( e ) ) { return false; } - EnergyThreshold eh = new EnergyThreshold( e, this ); + final EnergyThreshold eh = new EnergyThreshold( e, this ); return this.gsc.interests.add( eh ) && this.myInterests.add( eh ); } @Override - public boolean remove( Object o ) + public boolean remove( final Object o ) { - EnergyThreshold eh = new EnergyThreshold( (Double) o, this ); + final EnergyThreshold eh = new EnergyThreshold( (Double) o, this ); return this.myInterests.remove( eh ) && this.gsc.interests.remove( eh ); } @Override - public boolean containsAll( Collection c ) + public boolean containsAll( final Collection c ) { return this.myInterests.containsAll( c ); } @Override - public boolean addAll( Collection c ) + public boolean addAll( final Collection c ) { boolean didChange = false; - for( Double o : c ) + for( final Double o : c ) { didChange = this.add( o ) || didChange; } @@ -129,10 +129,10 @@ public class EnergyWatcher implements IEnergyWatcher } @Override - public boolean removeAll( Collection c ) + public boolean removeAll( final Collection c ) { boolean didSomething = false; - for( Object o : c ) + for( final Object o : c ) { didSomething = this.remove( o ) || didSomething; } @@ -140,10 +140,10 @@ public class EnergyWatcher implements IEnergyWatcher } @Override - public boolean retainAll( Collection c ) + public boolean retainAll( final Collection c ) { boolean changed = false; - Iterator i = this.iterator(); + final Iterator i = this.iterator(); while( i.hasNext() ) { @@ -160,7 +160,7 @@ public class EnergyWatcher implements IEnergyWatcher @Override public void clear() { - Iterator i = this.myInterests.iterator(); + final Iterator i = this.myInterests.iterator(); while( i.hasNext() ) { this.gsc.interests.remove( i.next() ); @@ -175,7 +175,7 @@ public class EnergyWatcher implements IEnergyWatcher final Iterator interestIterator; EnergyThreshold myLast; - public EnergyWatcherIterator( EnergyWatcher parent, Iterator i ) + public EnergyWatcherIterator( final EnergyWatcher parent, final Iterator i ) { this.watcher = parent; this.interestIterator = i; diff --git a/src/main/java/appeng/me/helpers/AENetworkProxy.java b/src/main/java/appeng/me/helpers/AENetworkProxy.java index d4f77b2c..7415d327 100644 --- a/src/main/java/appeng/me/helpers/AENetworkProxy.java +++ b/src/main/java/appeng/me/helpers/AENetworkProxy.java @@ -70,7 +70,7 @@ public class AENetworkProxy implements IGridBlock private double idleDraw = 1.0; private EntityPlayer owner; - public AENetworkProxy( IGridProxyable te, String nbtName, ItemStack visual, boolean inWorld ) + public AENetworkProxy( final IGridProxyable te, final String nbtName, final ItemStack visual, final boolean inWorld ) { this.gp = te; this.nbtName = nbtName; @@ -79,12 +79,12 @@ public class AENetworkProxy implements IGridBlock this.validSides = EnumSet.allOf( EnumFacing.class ); } - public void setVisualRepresentation( ItemStack is ) + public void setVisualRepresentation( final ItemStack is ) { this.myRepInstance = is; } - public void writeToNBT( NBTTagCompound tag ) + public void writeToNBT( final NBTTagCompound tag ) { if( this.node != null ) { @@ -92,7 +92,7 @@ public class AENetworkProxy implements IGridBlock } } - public void setValidSides( EnumSet validSides ) + public void setValidSides( final EnumSet validSides ) { this.validSides = validSides; if( this.node != null ) @@ -132,7 +132,7 @@ public class AENetworkProxy implements IGridBlock // send orientation based directionality to the node. if( this.gp instanceof IOrientable ) { - IOrientable ori = (IOrientable) this.gp; + final IOrientable ori = (IOrientable) this.gp; if( ori.canBeRotated() ) { ori.setOrientation( ori.getForward(), ori.getUp() ); @@ -154,7 +154,7 @@ public class AENetworkProxy implements IGridBlock return this.node; } - public void readFromNBT( NBTTagCompound tag ) + public void readFromNBT( final NBTTagCompound tag ) { this.data = tag; if( this.node != null && this.data != null ) @@ -174,12 +174,12 @@ public class AENetworkProxy implements IGridBlock public IPathingGrid getPath() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - IPathingGrid pg = grid.getCache( IPathingGrid.class ); + final IPathingGrid pg = grid.getCache( IPathingGrid.class ); if( pg == null ) { throw new GridAccessException(); @@ -200,7 +200,7 @@ public class AENetworkProxy implements IGridBlock { throw new GridAccessException(); } - IGrid grid = this.node.getGrid(); + final IGrid grid = this.node.getGrid(); if( grid == null ) { throw new GridAccessException(); @@ -210,12 +210,12 @@ public class AENetworkProxy implements IGridBlock public ITickManager getTick() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - ITickManager pg = grid.getCache( ITickManager.class ); + final ITickManager pg = grid.getCache( ITickManager.class ); if( pg == null ) { throw new GridAccessException(); @@ -225,13 +225,13 @@ public class AENetworkProxy implements IGridBlock public IStorageGrid getStorage() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - IStorageGrid pg = grid.getCache( IStorageGrid.class ); + final IStorageGrid pg = grid.getCache( IStorageGrid.class ); if( pg == null ) { @@ -243,13 +243,13 @@ public class AENetworkProxy implements IGridBlock public P2PCache getP2P() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - P2PCache pg = grid.getCache( P2PCache.class ); + final P2PCache pg = grid.getCache( P2PCache.class ); if( pg == null ) { @@ -261,13 +261,13 @@ public class AENetworkProxy implements IGridBlock public ISecurityGrid getSecurity() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - ISecurityGrid sg = grid.getCache( ISecurityGrid.class ); + final ISecurityGrid sg = grid.getCache( ISecurityGrid.class ); if( sg == null ) { @@ -279,13 +279,13 @@ public class AENetworkProxy implements IGridBlock public ICraftingGrid getCrafting() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - ICraftingGrid sg = grid.getCache( ICraftingGrid.class ); + final ICraftingGrid sg = grid.getCache( ICraftingGrid.class ); if( sg == null ) { @@ -326,7 +326,7 @@ public class AENetworkProxy implements IGridBlock } @Override - public void onGridNotification( GridNotification notification ) + public void onGridNotification( final GridNotification notification ) { if( this.gp instanceof PartCable ) { @@ -335,7 +335,7 @@ public class AENetworkProxy implements IGridBlock } @Override - public void setNetworkStatus( IGrid grid, int channelsInUse ) + public void setNetworkStatus( final IGrid grid, final int channelsInUse ) { } @@ -364,16 +364,16 @@ public class AENetworkProxy implements IGridBlock return this.myRepInstance; } - public void setFlags( GridFlags... requireChannel ) + public void setFlags( final GridFlags... requireChannel ) { - EnumSet flags = EnumSet.noneOf( GridFlags.class ); + final EnumSet flags = EnumSet.noneOf( GridFlags.class ); Collections.addAll( flags, requireChannel ); this.flags = flags; } - public void setIdlePowerUsage( double idle ) + public void setIdlePowerUsage( final double idle ) { this.idleDraw = idle; @@ -381,10 +381,10 @@ public class AENetworkProxy implements IGridBlock { try { - IGrid g = this.getGrid(); + final IGrid g = this.getGrid(); g.postEvent( new MENetworkPowerIdleChange( this.node ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // not ready for this yet.. } @@ -412,7 +412,7 @@ public class AENetworkProxy implements IGridBlock { return this.getEnergy().isNetworkPowered(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return false; } @@ -420,12 +420,12 @@ public class AENetworkProxy implements IGridBlock public IEnergyGrid getEnergy() throws GridAccessException { - IGrid grid = this.getGrid(); + final IGrid grid = this.getGrid(); if( grid == null ) { throw new GridAccessException(); } - IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); if( eg == null ) { throw new GridAccessException(); @@ -433,7 +433,7 @@ public class AENetworkProxy implements IGridBlock return eg; } - public void setOwner( EntityPlayer player ) + public void setOwner( final EntityPlayer player ) { this.owner = player; } diff --git a/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java b/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java index 3fca5e35..e7467753 100644 --- a/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java +++ b/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java @@ -33,7 +33,7 @@ import appeng.util.iterators.ProxyNodeIterator; public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMultiblock { - public AENetworkProxyMultiblock( IGridProxyable te, String nbtName, ItemStack itemStack, boolean inWorld ) + public AENetworkProxyMultiblock( final IGridProxyable te, final String nbtName, final ItemStack itemStack, final boolean inWorld ) { super( te, nbtName, itemStack, inWorld ); } diff --git a/src/main/java/appeng/me/helpers/ChannelPowerSrc.java b/src/main/java/appeng/me/helpers/ChannelPowerSrc.java index 1b57baca..9bfff2b9 100644 --- a/src/main/java/appeng/me/helpers/ChannelPowerSrc.java +++ b/src/main/java/appeng/me/helpers/ChannelPowerSrc.java @@ -31,14 +31,14 @@ public class ChannelPowerSrc implements IEnergySource final IGridNode node; final IEnergySource realSrc; - public ChannelPowerSrc( IGridNode networkNode, IEnergySource src ) + public ChannelPowerSrc( final IGridNode networkNode, final IEnergySource src ) { this.node = networkNode; this.realSrc = src; } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier ) + public double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier usePowerMultiplier ) { if( this.node.isActive() ) { diff --git a/src/main/java/appeng/me/helpers/GenericInterestManager.java b/src/main/java/appeng/me/helpers/GenericInterestManager.java index 4590c111..a198a2e2 100644 --- a/src/main/java/appeng/me/helpers/GenericInterestManager.java +++ b/src/main/java/appeng/me/helpers/GenericInterestManager.java @@ -34,7 +34,7 @@ public class GenericInterestManager private LinkedList transactions = null; private int transDepth = 0; - public GenericInterestManager( Multimap interests ) + public GenericInterestManager( final Multimap interests ) { this.container = interests; } @@ -55,10 +55,10 @@ public class GenericInterestManager if( this.transDepth == 0 ) { - LinkedList myActions = this.transactions; + final LinkedList myActions = this.transactions; this.transactions = null; - for( SavedTransactions t : myActions ) + for( final SavedTransactions t : myActions ) { if( t.put ) { @@ -72,7 +72,7 @@ public class GenericInterestManager } } - public boolean put( IAEStack stack, T iw ) + public boolean put( final IAEStack stack, final T iw ) { if( this.transactions != null ) { @@ -85,7 +85,7 @@ public class GenericInterestManager } } - public boolean remove( IAEStack stack, T iw ) + public boolean remove( final IAEStack stack, final T iw ) { if( this.transactions != null ) { @@ -98,12 +98,12 @@ public class GenericInterestManager } } - public boolean containsKey( IAEStack stack ) + public boolean containsKey( final IAEStack stack ) { return this.container.containsKey( stack ); } - public Collection get( IAEStack stack ) + public Collection get( final IAEStack stack ) { return this.container.get( stack ); } @@ -115,7 +115,7 @@ public class GenericInterestManager public final IAEStack stack; public final T iw; - public SavedTransactions( boolean putOperation, IAEStack myStack, T watcher ) + public SavedTransactions( final boolean putOperation, final IAEStack myStack, final T watcher ) { this.put = putOperation; this.stack = myStack; diff --git a/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java b/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java index 987f9ca7..8a0afab1 100644 --- a/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java +++ b/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java @@ -31,15 +31,15 @@ public class AdHocChannelUpdater implements IGridConnectionVisitor private final int usedChannels; - public AdHocChannelUpdater( int used ) + public AdHocChannelUpdater( final int used ) { this.usedChannels = used; } @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { - GridNode gn = (GridNode) n; + final GridNode gn = (GridNode) n; gn.setControllerRoute( null, true ); gn.incrementChannelCount( this.usedChannels ); gn.finalizeChannels(); @@ -47,9 +47,9 @@ public class AdHocChannelUpdater implements IGridConnectionVisitor } @Override - public void visitConnection( IGridConnection gcc ) + public void visitConnection( final IGridConnection gcc ) { - GridConnection gc = (GridConnection) gcc; + final GridConnection gc = (GridConnection) gcc; gc.setControllerRoute( null, true ); gc.incrementChannelCount( this.usedChannels ); gc.finalizeChannels(); diff --git a/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java b/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java index e7bba5b1..f6bb4ff7 100644 --- a/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java +++ b/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java @@ -30,17 +30,17 @@ public class ControllerChannelUpdater implements IGridConnectionVisitor { @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { - GridNode gn = (GridNode) n; + final GridNode gn = (GridNode) n; gn.finalizeChannels(); return true; } @Override - public void visitConnection( IGridConnection gcc ) + public void visitConnection( final IGridConnection gcc ) { - GridConnection gc = (GridConnection) gcc; + final GridConnection gc = (GridConnection) gcc; gc.finalizeChannels(); } } diff --git a/src/main/java/appeng/me/pathfinding/ControllerValidator.java b/src/main/java/appeng/me/pathfinding/ControllerValidator.java index a3addcd9..7e9aff2e 100644 --- a/src/main/java/appeng/me/pathfinding/ControllerValidator.java +++ b/src/main/java/appeng/me/pathfinding/ControllerValidator.java @@ -38,7 +38,7 @@ public class ControllerValidator implements IGridVisitor int maxY; int maxZ; - public ControllerValidator( int x, int y, int z ) + public ControllerValidator( final int x, final int y, final int z ) { this.minX = x; this.maxX = x; @@ -49,14 +49,14 @@ public class ControllerValidator implements IGridVisitor } @Override - public boolean visitNode( IGridNode n ) + public boolean visitNode( final IGridNode n ) { - IGridHost host = n.getMachine(); + final IGridHost host = n.getMachine(); if( this.isValid && host instanceof TileController ) { - TileController c = (TileController) host; + final TileController c = (TileController) host; - BlockPos pos = c.getPos(); + final BlockPos pos = c.getPos(); this.minX = Math.min( pos.getX(), this.minX ); this.maxX = Math.max( pos.getX(), this.maxX ); diff --git a/src/main/java/appeng/me/pathfinding/PathSegment.java b/src/main/java/appeng/me/pathfinding/PathSegment.java index 0d4249f0..1c38ba59 100644 --- a/src/main/java/appeng/me/pathfinding/PathSegment.java +++ b/src/main/java/appeng/me/pathfinding/PathSegment.java @@ -40,7 +40,7 @@ public class PathSegment public boolean isDead; List open; - public PathSegment( PathGridCache myPGC, List open, Set semiOpen, Set closed ) + public PathSegment( final PathGridCache myPGC, final List open, final Set semiOpen, final Set closed ) { this.open = open; this.semiOpen = semiOpen; @@ -51,14 +51,14 @@ public class PathSegment public boolean step() { - List oldOpen = this.open; + final List oldOpen = this.open; this.open = new LinkedList(); - for( IPathItem i : oldOpen ) + for( final IPathItem i : oldOpen ) { - for( IPathItem pi : i.getPossibleOptions() ) + for( final IPathItem pi : i.getPossibleOptions() ) { - EnumSet flags = pi.getFlags(); + final EnumSet flags = pi.getFlags(); if( !this.closed.contains( pi ) ) { @@ -69,7 +69,7 @@ public class PathSegment // close the semi open. if( !this.semiOpen.contains( pi ) ) { - boolean worked; + final boolean worked; if( flags.contains( GridFlags.COMPRESSED_CHANNEL ) ) { @@ -82,10 +82,10 @@ public class PathSegment if( worked && flags.contains( GridFlags.MULTIBLOCK ) ) { - Iterator oni = ( (IGridMultiblock) ( (IGridNode) pi ).getGridBlock() ).getMultiblockNodes(); + final Iterator oni = ( (IGridMultiblock) ( (IGridNode) pi ).getGridBlock() ).getMultiblockNodes(); while( oni.hasNext() ) { - IGridNode otherNodes = oni.next(); + final IGridNode otherNodes = oni.next(); if( otherNodes != pi ) { this.semiOpen.add( (IPathItem) otherNodes ); @@ -109,7 +109,7 @@ public class PathSegment return this.open.isEmpty(); } - private boolean useDenseChannel( IPathItem start ) + private boolean useDenseChannel( final IPathItem start ) { IPathItem pi = start; while( pi != null ) @@ -134,7 +134,7 @@ public class PathSegment return true; } - private boolean useChannel( IPathItem start ) + private boolean useChannel( final IPathItem start ) { IPathItem pi = start; while( pi != null ) diff --git a/src/main/java/appeng/me/storage/AEExternalHandler.java b/src/main/java/appeng/me/storage/AEExternalHandler.java index 704a5d2d..69acde89 100644 --- a/src/main/java/appeng/me/storage/AEExternalHandler.java +++ b/src/main/java/appeng/me/storage/AEExternalHandler.java @@ -36,7 +36,7 @@ public class AEExternalHandler implements IExternalStorageHandler { @Override - public boolean canHandle( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource mySrc ) + public boolean canHandle( final TileEntity te, final EnumFacing d, final StorageChannel channel, final BaseActionSource mySrc ) { if( channel == StorageChannel.ITEMS && te instanceof ITileStorageMonitorable ) { @@ -47,7 +47,7 @@ public class AEExternalHandler implements IExternalStorageHandler } @Override - public IMEInventory getInventory( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource src ) + public IMEInventory getInventory( final TileEntity te, final EnumFacing d, final StorageChannel channel, final BaseActionSource src ) { if( te instanceof TileCondenser ) { @@ -63,12 +63,12 @@ public class AEExternalHandler implements IExternalStorageHandler if( te instanceof ITileStorageMonitorable ) { - ITileStorageMonitorable iface = (ITileStorageMonitorable) te; - IStorageMonitorable sm = iface.getMonitorable( d, src ); + final ITileStorageMonitorable iface = (ITileStorageMonitorable) te; + final IStorageMonitorable sm = iface.getMonitorable( d, src ); if( channel == StorageChannel.ITEMS && sm != null ) { - IMEInventory ii = sm.getItemInventory(); + final IMEInventory ii = sm.getItemInventory(); if( ii != null ) { return ii; @@ -77,7 +77,7 @@ public class AEExternalHandler implements IExternalStorageHandler if( channel == StorageChannel.FLUIDS && sm != null ) { - IMEInventory fi = sm.getFluidInventory(); + final IMEInventory fi = sm.getFluidInventory(); if( fi != null ) { return fi; diff --git a/src/main/java/appeng/me/storage/CellInventory.java b/src/main/java/appeng/me/storage/CellInventory.java index 7955f9f7..e0a6292c 100644 --- a/src/main/java/appeng/me/storage/CellInventory.java +++ b/src/main/java/appeng/me/storage/CellInventory.java @@ -67,13 +67,13 @@ public class CellInventory implements ICellInventory protected ItemStack i; protected IStorageCell cellType; - protected CellInventory( NBTTagCompound data, ISaveProvider container ) + protected CellInventory( final NBTTagCompound data, final ISaveProvider container ) { this.tagCompound = data; this.container = container; } - protected CellInventory( ItemStack o, ISaveProvider container ) throws AppEngException + protected CellInventory( final ItemStack o, final ISaveProvider container ) throws AppEngException { if( itemSlots == null ) { @@ -95,7 +95,7 @@ public class CellInventory implements ICellInventory this.cellType = null; this.i = o; - Item type = this.i.getItem(); + final Item type = this.i.getItem(); if( type instanceof IStorageCell ) { this.cellType = (IStorageCell) this.i.getItem(); @@ -128,19 +128,19 @@ public class CellInventory implements ICellInventory this.cellItems = null; } - public static IMEInventoryHandler getCell( ItemStack o, ISaveProvider container2 ) + public static IMEInventoryHandler getCell( final ItemStack o, final ISaveProvider container2 ) { try { return new CellInventoryHandler( new CellInventory( o, container2 ) ); } - catch( AppEngException e ) + catch( final AppEngException e ) { return null; } } - private static boolean isStorageCell( ItemStack i ) + private static boolean isStorageCell( final ItemStack i ) { if( i == null ) { @@ -149,13 +149,13 @@ public class CellInventory implements ICellInventory try { - Item type = i.getItem(); + final Item type = i.getItem(); if( type instanceof IStorageCell ) { return !( (IStorageCell) type ).storableInStorageCell(); } } - catch( Throwable err ) + catch( final Throwable err ) { return true; } @@ -163,14 +163,14 @@ public class CellInventory implements ICellInventory return false; } - public static boolean isCell( ItemStack i ) + public static boolean isCell( final ItemStack i ) { if( i == null ) { return false; } - Item type = i.getItem(); + final Item type = i.getItem(); if( type instanceof IStorageCell ) { return ( (IStorageCell) type ).isStorageCell( i ); @@ -179,12 +179,12 @@ public class CellInventory implements ICellInventory return false; } - public static void addBasicBlackList( int itemID, int meta ) + public static void addBasicBlackList( final int itemID, final int meta ) { BLACK_LIST.add( ( meta << Platform.DEF_OFFSET ) | itemID ); } - public static boolean isBlackListed( IAEItemStack input ) + public static boolean isBlackListed( final IAEItemStack input ) { if( BLACK_LIST.contains( ( OreDictionary.WILDCARD_VALUE << Platform.DEF_OFFSET ) | Item.getIdFromItem( input.getItem() ) ) ) { @@ -193,13 +193,13 @@ public class CellInventory implements ICellInventory return BLACK_LIST.contains( ( input.getItemDamage() << Platform.DEF_OFFSET ) | Item.getIdFromItem( input.getItem() ) ); } - private boolean isEmpty( IMEInventory meInventory ) + private boolean isEmpty( final IMEInventory meInventory ) { return meInventory.getAvailableItems( AEApi.instance().storage().createItemList() ).isEmpty(); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { if( input == null ) { @@ -215,21 +215,21 @@ public class CellInventory implements ICellInventory return input; } - ItemStack sharedItemStack = input.getItemStack(); + final ItemStack sharedItemStack = input.getItemStack(); if( CellInventory.isStorageCell( sharedItemStack ) ) { - IMEInventory meInventory = getCell( sharedItemStack, null ); + final IMEInventory meInventory = getCell( sharedItemStack, null ); if( meInventory != null && !this.isEmpty( meInventory ) ) { return input; } } - IAEItemStack l = this.getCellItems().findPrecise( input ); + final IAEItemStack l = this.getCellItems().findPrecise( input ); if( l != null ) { - long remainingItemSlots = this.getRemainingItemCount(); + final long remainingItemSlots = this.getRemainingItemCount(); if( remainingItemSlots < 0 ) { return input; @@ -237,7 +237,7 @@ public class CellInventory implements ICellInventory if( input.getStackSize() > remainingItemSlots ) { - IAEItemStack r = input.copy(); + final IAEItemStack r = input.copy(); r.setStackSize( r.getStackSize() - remainingItemSlots ); if( mode == Actionable.MODULATE ) { @@ -261,16 +261,16 @@ public class CellInventory implements ICellInventory if( this.canHoldNewItem() ) // room for new type, and for at least one item! { - int remainingItemCount = (int) this.getRemainingItemCount() - this.getBytesPerType() * 8; + final int remainingItemCount = (int) this.getRemainingItemCount() - this.getBytesPerType() * 8; if( remainingItemCount > 0 ) { if( input.getStackSize() > remainingItemCount ) { - ItemStack toReturn = Platform.cloneItemStack( sharedItemStack ); + final ItemStack toReturn = Platform.cloneItemStack( sharedItemStack ); toReturn.stackSize = sharedItemStack.stackSize - remainingItemCount; if( mode == Actionable.MODULATE ) { - ItemStack toWrite = Platform.cloneItemStack( sharedItemStack ); + final ItemStack toWrite = Platform.cloneItemStack( sharedItemStack ); toWrite.stackSize = remainingItemCount; this.cellItems.add( AEItemStack.create( toWrite ) ); @@ -296,18 +296,18 @@ public class CellInventory implements ICellInventory } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( request == null ) { return null; } - long size = Math.min( Integer.MAX_VALUE, request.getStackSize() ); + final long size = Math.min( Integer.MAX_VALUE, request.getStackSize() ); IAEItemStack Results = null; - IAEItemStack l = this.getCellItems().findPrecise( request ); + final IAEItemStack l = this.getCellItems().findPrecise( request ); if( l != null ) { Results = l.copy(); @@ -348,7 +348,7 @@ public class CellInventory implements ICellInventory return this.cellItems; } - private void updateItemCount( long delta ) + private void updateItemCount( final long delta ) { this.storedItemCount += delta; this.tagCompound.setInteger( ITEM_COUNT_TAG, this.storedItemCount ); @@ -361,18 +361,18 @@ public class CellInventory implements ICellInventory // add new pretty stuff... int x = 0; - for( IAEItemStack v : this.cellItems ) + for( final IAEItemStack v : this.cellItems ) { itemCount += v.getStackSize(); - NBTBase c = this.tagCompound.getTag( itemSlots[x] ); + final NBTBase c = this.tagCompound.getTag( itemSlots[x] ); if( c instanceof NBTTagCompound ) { v.writeToNBT( (NBTTagCompound) c ); } else { - NBTTagCompound g = new NBTTagCompound(); + final NBTTagCompound g = new NBTTagCompound(); v.writeToNBT( g ); this.tagCompound.setTag( itemSlots[x], g ); } @@ -388,7 +388,7 @@ public class CellInventory implements ICellInventory // NBTBase tagType = tagCompound.getTag( ITEM_TYPE_TAG ); // NBTBase tagCount = tagCompound.getTag( ITEM_COUNT_TAG ); - short oldStoredItems = this.storedItems; + final short oldStoredItems = this.storedItems; /* * if ( tagType instanceof NBTTagShort ) ((NBTTagShort) tagType).data = storedItems = (short) cellItems.size(); @@ -439,11 +439,11 @@ public class CellInventory implements ICellInventory this.cellItems.resetStatus(); // clears totals and stuff. - int types = (int) this.getStoredItemTypes(); + final int types = (int) this.getStoredItemTypes(); for( int x = 0; x < types; x++ ) { - ItemStack t = ItemStack.loadItemStackFromNBT( this.tagCompound.getCompoundTag( itemSlots[x] ) ); + final ItemStack t = ItemStack.loadItemStackFromNBT( this.tagCompound.getCompoundTag( itemSlots[x] ) ); if( t != null ) { t.stackSize = this.tagCompound.getInteger( itemSlotCount[x] ); @@ -459,9 +459,9 @@ public class CellInventory implements ICellInventory } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( IAEItemStack i : this.getCellItems() ) + for( final IAEItemStack i : this.getCellItems() ) { out.add( i ); } @@ -514,7 +514,7 @@ public class CellInventory implements ICellInventory @Override public boolean canHoldNewItem() { - long bytesFree = this.getFreeBytes(); + final long bytesFree = this.getFreeBytes(); return ( bytesFree > this.getBytesPerType() || ( bytesFree == this.getBytesPerType() && this.getUnusedItemCount() > 0 ) ) && this.getRemainingItemTypes() > 0; } @@ -533,7 +533,7 @@ public class CellInventory implements ICellInventory @Override public long getUsedBytes() { - long bytesForItemCount = ( this.getStoredItemCount() + this.getUnusedItemCount() ) / 8; + final long bytesForItemCount = ( this.getStoredItemCount() + this.getUnusedItemCount() ) / 8; return this.getStoredItemTypes() * this.getBytesPerType() + bytesForItemCount; } @@ -558,22 +558,22 @@ public class CellInventory implements ICellInventory @Override public long getRemainingItemTypes() { - long basedOnStorage = this.getFreeBytes() / this.getBytesPerType(); - long baseOnTotal = this.getTotalItemTypes() - this.getStoredItemTypes(); + final long basedOnStorage = this.getFreeBytes() / this.getBytesPerType(); + final long baseOnTotal = this.getTotalItemTypes() - this.getStoredItemTypes(); return basedOnStorage > baseOnTotal ? baseOnTotal : basedOnStorage; } @Override public long getRemainingItemCount() { - long remaining = this.getFreeBytes() * 8 + this.getUnusedItemCount(); + final long remaining = this.getFreeBytes() * 8 + this.getUnusedItemCount(); return remaining > 0 ? remaining : 0; } @Override public int getUnusedItemCount() { - int div = (int) ( this.getStoredItemCount() % 8 ); + final int div = (int) ( this.getStoredItemCount() % 8 ); if( div == 0 ) { diff --git a/src/main/java/appeng/me/storage/CellInventoryHandler.java b/src/main/java/appeng/me/storage/CellInventoryHandler.java index 1771a2cf..fcea2e37 100644 --- a/src/main/java/appeng/me/storage/CellInventoryHandler.java +++ b/src/main/java/appeng/me/storage/CellInventoryHandler.java @@ -42,28 +42,28 @@ import appeng.util.prioitylist.PrecisePriorityList; public class CellInventoryHandler extends MEInventoryHandler implements ICellInventoryHandler { - CellInventoryHandler( IMEInventory c ) + CellInventoryHandler( final IMEInventory c ) { super( c, StorageChannel.ITEMS ); - ICellInventory ci = this.getCellInv(); + final ICellInventory ci = this.getCellInv(); if( ci != null ) { - IItemList priorityList = AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); - IInventory upgrades = ci.getUpgradesInventory(); - IInventory config = ci.getConfigInventory(); - FuzzyMode fzMode = ci.getFuzzyMode(); + final IInventory upgrades = ci.getUpgradesInventory(); + final IInventory config = ci.getConfigInventory(); + final FuzzyMode fzMode = ci.getFuzzyMode(); boolean hasInverter = false; boolean hasFuzzy = false; for( int x = 0; x < upgrades.getSizeInventory(); x++ ) { - ItemStack is = upgrades.getStackInSlot( x ); + final ItemStack is = upgrades.getStackInSlot( x ); if( is != null && is.getItem() instanceof IUpgradeModule ) { - Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is ); + final Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is ); if( u != null ) { switch( u ) @@ -82,7 +82,7 @@ public class CellInventoryHandler extends MEInventoryHandler imple for( int x = 0; x < config.getSizeInventory(); x++ ) { - ItemStack is = config.getStackInSlot( x ); + final ItemStack is = config.getStackInSlot( x ); if( is != null ) { priorityList.add( AEItemStack.create( is ) ); diff --git a/src/main/java/appeng/me/storage/CreativeCellInventory.java b/src/main/java/appeng/me/storage/CreativeCellInventory.java index 05ca0695..514e8570 100644 --- a/src/main/java/appeng/me/storage/CreativeCellInventory.java +++ b/src/main/java/appeng/me/storage/CreativeCellInventory.java @@ -37,29 +37,29 @@ public class CreativeCellInventory implements IMEInventoryHandler final IItemList itemListCache = AEApi.instance().storage().createItemList(); - protected CreativeCellInventory( ItemStack o ) + protected CreativeCellInventory( final ItemStack o ) { - CellConfig cc = new CellConfig( o ); - for( ItemStack is : cc ) + final CellConfig cc = new CellConfig( o ); + for( final ItemStack is : cc ) { if( is != null ) { - IAEItemStack i = AEItemStack.create( is ); + final IAEItemStack i = AEItemStack.create( is ); i.setStackSize( Integer.MAX_VALUE ); this.itemListCache.add( i ); } } } - public static IMEInventoryHandler getCell( ItemStack o ) + public static IMEInventoryHandler getCell( final ItemStack o ) { return new CellInventoryHandler( new CreativeCellInventory( o ) ); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { - IAEItemStack local = this.itemListCache.findPrecise( input ); + final IAEItemStack local = this.itemListCache.findPrecise( input ); if( local == null ) { return input; @@ -69,9 +69,9 @@ public class CreativeCellInventory implements IMEInventoryHandler } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { - IAEItemStack local = this.itemListCache.findPrecise( request ); + final IAEItemStack local = this.itemListCache.findPrecise( request ); if( local == null ) { return null; @@ -81,9 +81,9 @@ public class CreativeCellInventory implements IMEInventoryHandler } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( IAEItemStack ais : this.itemListCache ) + for( final IAEItemStack ais : this.itemListCache ) { out.add( ais ); } @@ -103,13 +103,13 @@ public class CreativeCellInventory implements IMEInventoryHandler } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { return this.itemListCache.findPrecise( input ) != null; } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { return this.itemListCache.findPrecise( input ) != null; } @@ -127,7 +127,7 @@ public class CreativeCellInventory implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/DriveWatcher.java b/src/main/java/appeng/me/storage/DriveWatcher.java index 920e38fe..4437c0d8 100644 --- a/src/main/java/appeng/me/storage/DriveWatcher.java +++ b/src/main/java/appeng/me/storage/DriveWatcher.java @@ -36,7 +36,7 @@ public class DriveWatcher> extends MEInventoryHandler final ICellHandler handler; final IChestOrDrive cord; - public DriveWatcher( IMEInventory i, ItemStack is, ICellHandler han, IChestOrDrive cod ) + public DriveWatcher( final IMEInventory i, final ItemStack is, final ICellHandler han, final IChestOrDrive cod ) { super( i, i.getChannel() ); this.is = is; @@ -45,15 +45,15 @@ public class DriveWatcher> extends MEInventoryHandler } @Override - public T injectItems( T input, Actionable type, BaseActionSource src ) + public T injectItems( final T input, final Actionable type, final BaseActionSource src ) { - long size = input.getStackSize(); + final long size = input.getStackSize(); - T a = super.injectItems( input, type, src ); + final T a = super.injectItems( input, type, src ); if( a == null || a.getStackSize() != size ) { - int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); + final int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); if( newStatus != this.oldStatus ) { @@ -65,13 +65,13 @@ public class DriveWatcher> extends MEInventoryHandler } @Override - public T extractItems( T request, Actionable type, BaseActionSource src ) + public T extractItems( final T request, final Actionable type, final BaseActionSource src ) { - T a = super.extractItems( request, type, src ); + final T a = super.extractItems( request, type, src ); if( a != null ) { - int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); + final int newStatus = this.handler.getStatusForCell( this.is, this.getInternal() ); if( newStatus != this.oldStatus ) { diff --git a/src/main/java/appeng/me/storage/ItemWatcher.java b/src/main/java/appeng/me/storage/ItemWatcher.java index d1c9a64b..91699ad9 100644 --- a/src/main/java/appeng/me/storage/ItemWatcher.java +++ b/src/main/java/appeng/me/storage/ItemWatcher.java @@ -39,7 +39,7 @@ public class ItemWatcher implements IStackWatcher final IStackWatcherHost myObject; final HashSet myInterests = new HashSet(); - public ItemWatcher( GridStorageCache cache, IStackWatcherHost host ) + public ItemWatcher( final GridStorageCache cache, final IStackWatcherHost host ) { this.gsc = cache; this.myObject = host; @@ -63,7 +63,7 @@ public class ItemWatcher implements IStackWatcher } @Override - public boolean contains( Object o ) + public boolean contains( final Object o ) { return this.myInterests.contains( o ); } @@ -81,13 +81,13 @@ public class ItemWatcher implements IStackWatcher } @Override - public T[] toArray( T[] a ) + public T[] toArray( final T[] a ) { return this.myInterests.toArray( a ); } @Override - public boolean add( IAEStack e ) + public boolean add( final IAEStack e ) { if( this.myInterests.contains( e ) ) { @@ -98,23 +98,23 @@ public class ItemWatcher implements IStackWatcher } @Override - public boolean remove( Object o ) + public boolean remove( final Object o ) { return this.myInterests.remove( o ) && this.gsc.interestManager.remove( (IAEStack) o, this ); } @Override - public boolean containsAll( Collection c ) + public boolean containsAll( final Collection c ) { return this.myInterests.containsAll( c ); } @Override - public boolean addAll( Collection c ) + public boolean addAll( final Collection c ) { boolean didChange = false; - for( IAEStack o : c ) + for( final IAEStack o : c ) { didChange = this.add( o ) || didChange; } @@ -123,10 +123,10 @@ public class ItemWatcher implements IStackWatcher } @Override - public boolean removeAll( Collection c ) + public boolean removeAll( final Collection c ) { boolean didSomething = false; - for( Object o : c ) + for( final Object o : c ) { didSomething = this.remove( o ) || didSomething; } @@ -134,10 +134,10 @@ public class ItemWatcher implements IStackWatcher } @Override - public boolean retainAll( Collection c ) + public boolean retainAll( final Collection c ) { boolean changed = false; - Iterator i = this.iterator(); + final Iterator i = this.iterator(); while( i.hasNext() ) { @@ -154,7 +154,7 @@ public class ItemWatcher implements IStackWatcher @Override public void clear() { - Iterator i = this.myInterests.iterator(); + final Iterator i = this.myInterests.iterator(); while( i.hasNext() ) { this.gsc.interestManager.remove( i.next(), this ); @@ -169,7 +169,7 @@ public class ItemWatcher implements IStackWatcher final Iterator interestIterator; IAEStack myLast; - public ItemWatcherIterator( ItemWatcher parent, Iterator i ) + public ItemWatcherIterator( final ItemWatcher parent, final Iterator i ) { this.watcher = parent; this.interestIterator = i; diff --git a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java index 24107c05..6132e43a 100644 --- a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java +++ b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java @@ -38,20 +38,20 @@ public class MEIInventoryWrapper implements IMEInventory protected final IInventory target; protected final InventoryAdaptor adaptor; - public MEIInventoryWrapper( IInventory m, InventoryAdaptor ia ) + public MEIInventoryWrapper( final IInventory m, final InventoryAdaptor ia ) { this.target = m; this.adaptor = ia; } @Override - public IAEItemStack injectItems( IAEItemStack iox, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack iox, final Actionable mode, final BaseActionSource src ) { - ItemStack input = iox.getItemStack(); + final ItemStack input = iox.getItemStack(); if( this.adaptor != null ) { - ItemStack is = mode == Actionable.SIMULATE ? this.adaptor.simulateAdd( input ) : this.adaptor.addItems( input ); + final ItemStack is = mode == Actionable.SIMULATE ? this.adaptor.simulateAdd( input ) : this.adaptor.addItems( input ); if( is == null ) { return null; @@ -59,17 +59,17 @@ public class MEIInventoryWrapper implements IMEInventory return AEItemStack.create( is ); } - ItemStack out = Platform.cloneItemStack( input ); + final ItemStack out = Platform.cloneItemStack( input ); if( mode == Actionable.MODULATE ) // absolutely no need for a first run in simulate mode. { for( int x = 0; x < this.target.getSizeInventory(); x++ ) { - ItemStack t = this.target.getStackInSlot( x ); + final ItemStack t = this.target.getStackInSlot( x ); if( Platform.isSameItem( t, input ) ) { - int oriStack = t.stackSize; + final int oriStack = t.stackSize; t.stackSize += out.stackSize; this.target.setInventorySlotContents( x, t ); @@ -125,9 +125,9 @@ public class MEIInventoryWrapper implements IMEInventory } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { - ItemStack Req = request.getItemStack(); + final ItemStack Req = request.getItemStack(); int request_stackSize = Req.stackSize; @@ -151,7 +151,7 @@ public class MEIInventoryWrapper implements IMEInventory // try to find matching inventories that already have it... for( int x = 0; x < this.target.getSizeInventory(); x++ ) { - ItemStack sub = this.target.getStackInSlot( x ); + final ItemStack sub = this.target.getStackInSlot( x ); if( Platform.isSameItem( sub, Req ) ) { @@ -206,7 +206,7 @@ public class MEIInventoryWrapper implements IMEInventory } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { for( int x = 0; x < this.target.getSizeInventory(); x++ ) { diff --git a/src/main/java/appeng/me/storage/MEInventoryHandler.java b/src/main/java/appeng/me/storage/MEInventoryHandler.java index ded200ea..79eb4713 100644 --- a/src/main/java/appeng/me/storage/MEInventoryHandler.java +++ b/src/main/java/appeng/me/storage/MEInventoryHandler.java @@ -48,7 +48,7 @@ public class MEInventoryHandler> implements IMEInventoryHa private boolean hasReadAccess; private boolean hasWriteAccess; - public MEInventoryHandler( IMEInventory i, StorageChannel channel ) + public MEInventoryHandler( final IMEInventory i, final StorageChannel channel ) { this.channel = channel; @@ -74,7 +74,7 @@ public class MEInventoryHandler> implements IMEInventoryHa return this.myWhitelist; } - public void setWhitelist( IncludeExclude myWhitelist ) + public void setWhitelist( final IncludeExclude myWhitelist ) { this.myWhitelist = myWhitelist; } @@ -84,7 +84,7 @@ public class MEInventoryHandler> implements IMEInventoryHa return this.myAccess; } - public void setBaseAccess( AccessRestriction myAccess ) + public void setBaseAccess( final AccessRestriction myAccess ) { this.myAccess = myAccess; this.cachedAccessRestriction = this.myAccess.restrictPermissions( this.internal.getAccess() ); @@ -97,13 +97,13 @@ public class MEInventoryHandler> implements IMEInventoryHa return this.myPartitionList; } - public void setPartitionList( IPartitionList myPartitionList ) + public void setPartitionList( final IPartitionList myPartitionList ) { this.myPartitionList = myPartitionList; } @Override - public T injectItems( T input, Actionable type, BaseActionSource src ) + public T injectItems( final T input, final Actionable type, final BaseActionSource src ) { if( !this.canAccept( input ) ) { @@ -114,7 +114,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public T extractItems( T request, Actionable type, BaseActionSource src ) + public T extractItems( final T request, final Actionable type, final BaseActionSource src ) { if( !this.hasReadAccess ) { @@ -125,7 +125,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { if( !this.hasReadAccess ) { @@ -148,7 +148,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public boolean isPrioritized( T input ) + public boolean isPrioritized( final T input ) { if( this.myWhitelist == IncludeExclude.WHITELIST ) { @@ -158,7 +158,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public boolean canAccept( T input ) + public boolean canAccept( final T input ) { if( !this.hasWriteAccess ) { @@ -182,7 +182,7 @@ public class MEInventoryHandler> implements IMEInventoryHa return this.myPriority; } - public void setPriority( int myPriority ) + public void setPriority( final int myPriority ) { this.myPriority = myPriority; } @@ -194,7 +194,7 @@ public class MEInventoryHandler> implements IMEInventoryHa } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/MEMonitorIInventory.java b/src/main/java/appeng/me/storage/MEMonitorIInventory.java index 0fca89f0..56c46da1 100644 --- a/src/main/java/appeng/me/storage/MEMonitorIInventory.java +++ b/src/main/java/appeng/me/storage/MEMonitorIInventory.java @@ -53,26 +53,26 @@ public class MEMonitorIInventory implements IMEMonitor public BaseActionSource mySource; public StorageFilter mode = StorageFilter.EXTRACTABLE_ONLY; - public MEMonitorIInventory( InventoryAdaptor adaptor ) + public MEMonitorIInventory( final InventoryAdaptor adaptor ) { this.adaptor = adaptor; this.memory = new ConcurrentSkipListMap(); } @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { this.listeners.put( l, verificationToken ); } @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver l ) { this.listeners.remove( l ); } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { ItemStack out = null; @@ -96,13 +96,13 @@ public class MEMonitorIInventory implements IMEMonitor } // better then doing construction from scratch :3 - IAEItemStack o = input.copy(); + final IAEItemStack o = input.copy(); o.setStackSize( out.stackSize ); return o; } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable type, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable type, final BaseActionSource src ) { ItemStack out = null; @@ -121,7 +121,7 @@ public class MEMonitorIInventory implements IMEMonitor } // better then doing construction from scratch :3 - IAEItemStack o = request.copy(); + final IAEItemStack o = request.copy(); o.setStackSize( out.stackSize ); if( type == Actionable.MODULATE ) @@ -141,22 +141,22 @@ public class MEMonitorIInventory implements IMEMonitor public TickRateModulation onTick() { - LinkedList changes = new LinkedList(); + final LinkedList changes = new LinkedList(); this.list.resetStatus(); int high = 0; boolean changed = false; - for( ItemSlot is : this.adaptor ) + for( final ItemSlot is : this.adaptor ) { - CachedItemStack old = this.memory.get( is.slot ); + final CachedItemStack old = this.memory.get( is.slot ); high = Math.max( high, is.slot ); - ItemStack newIS = !is.isExtractable && this.mode == StorageFilter.EXTRACTABLE_ONLY ? null : is.getItemStack(); - ItemStack oldIS = old == null ? null : old.itemStack; + final ItemStack newIS = !is.isExtractable && this.mode == StorageFilter.EXTRACTABLE_ONLY ? null : is.getItemStack(); + final ItemStack oldIS = old == null ? null : old.itemStack; if( this.isDifferent( newIS, oldIS ) ) { - CachedItemStack cis = new CachedItemStack( is.getItemStack() ); + final CachedItemStack cis = new CachedItemStack( is.getItemStack() ); this.memory.put( is.slot, cis ); if( old != null && old.aeStack != null ) @@ -175,10 +175,10 @@ public class MEMonitorIInventory implements IMEMonitor } else { - int newSize = ( newIS == null ? 0 : newIS.stackSize ); - int diff = newSize - ( oldIS == null ? 0 : oldIS.stackSize ); + final int newSize = ( newIS == null ? 0 : newIS.stackSize ); + final int diff = newSize - ( oldIS == null ? 0 : oldIS.stackSize ); - IAEItemStack stack = ( old == null || old.aeStack == null ? AEApi.instance().storage().createItemStack( newIS ) : old.aeStack.copy() ); + final IAEItemStack stack = ( old == null || old.aeStack == null ? AEApi.instance().storage().createItemStack( newIS ) : old.aeStack.copy() ); if( stack != null ) { stack.setStackSize( newSize ); @@ -187,10 +187,10 @@ public class MEMonitorIInventory implements IMEMonitor if( diff != 0 && stack != null ) { - CachedItemStack cis = new CachedItemStack( is.getItemStack() ); + final CachedItemStack cis = new CachedItemStack( is.getItemStack() ); this.memory.put( is.slot, cis ); - IAEItemStack a = stack.copy(); + final IAEItemStack a = stack.copy(); a.setStackSize( diff ); changes.add( a ); changed = true; @@ -199,14 +199,14 @@ public class MEMonitorIInventory implements IMEMonitor } // detect dropped items; should fix non IISided Inventory Changes. - NavigableMap end = this.memory.tailMap( high, false ); + final NavigableMap end = this.memory.tailMap( high, false ); if( !end.isEmpty() ) { - for( CachedItemStack cis : end.values() ) + for( final CachedItemStack cis : end.values() ) { if( cis != null && cis.aeStack != null ) { - IAEItemStack a = cis.aeStack.copy(); + final IAEItemStack a = cis.aeStack.copy(); a.setStackSize( -a.getStackSize() ); changes.add( a ); changed = true; @@ -223,7 +223,7 @@ public class MEMonitorIInventory implements IMEMonitor return changed ? TickRateModulation.URGENT : TickRateModulation.SLOWER; } - private boolean isDifferent( ItemStack a, ItemStack b ) + private boolean isDifferent( final ItemStack a, final ItemStack b ) { if( a == b && b == null ) { @@ -238,16 +238,16 @@ public class MEMonitorIInventory implements IMEMonitor return !Platform.isSameItemPrecise( a, b ); } - private void postDifference( Iterable a ) + private void postDifference( final Iterable a ) { // AELog.info( a.getItemStack().getUnlocalizedName() + " @ " + a.getStackSize() ); if( a != null ) { - Iterator, Object>> i = this.listeners.entrySet().iterator(); + final Iterator, Object>> i = this.listeners.entrySet().iterator(); while( i.hasNext() ) { - Entry, Object> l = i.next(); - IMEMonitorHandlerReceiver key = l.getKey(); + final Entry, Object> l = i.next(); + final IMEMonitorHandlerReceiver key = l.getKey(); if( key.isValid( l.getValue() ) ) { key.postChange( this, a, this.mySource ); @@ -267,13 +267,13 @@ public class MEMonitorIInventory implements IMEMonitor } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { return false; } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { return true; } @@ -291,15 +291,15 @@ public class MEMonitorIInventory implements IMEMonitor } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( CachedItemStack is : this.memory.values() ) + for( final CachedItemStack is : this.memory.values() ) { out.addStorage( is.aeStack ); } @@ -319,7 +319,7 @@ public class MEMonitorIInventory implements IMEMonitor final ItemStack itemStack; final IAEItemStack aeStack; - public CachedItemStack( ItemStack is ) + public CachedItemStack( final ItemStack is ) { if( is == null ) { diff --git a/src/main/java/appeng/me/storage/MEMonitorPassThrough.java b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java index dd0940b7..dfc054c0 100644 --- a/src/main/java/appeng/me/storage/MEMonitorPassThrough.java +++ b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java @@ -42,7 +42,7 @@ public class MEMonitorPassThrough> extends MEPassThrough monitor; - public MEMonitorPassThrough( IMEInventory i, StorageChannel channel ) + public MEMonitorPassThrough( final IMEInventory i, final StorageChannel channel ) { super( i, channel ); if( i instanceof IMEMonitor ) @@ -52,7 +52,7 @@ public class MEMonitorPassThrough> extends MEPassThrough i ) + public void setInternal( final IMEInventory i ) { if( this.monitor != null ) { @@ -60,7 +60,7 @@ public class MEMonitorPassThrough> extends MEPassThrough before = this.getInternal() == null ? this.channel.createList() : this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); + final IItemList before = this.getInternal() == null ? this.channel.createList() : this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); super.setInternal( i ); if( i instanceof IMEMonitor ) @@ -68,7 +68,7 @@ public class MEMonitorPassThrough> extends MEPassThrough) i; } - IItemList after = this.getInternal() == null ? this.channel.createList() : this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); + final IItemList after = this.getInternal() == null ? this.channel.createList() : this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( this.channel.createList() ) ); if( this.monitor != null ) { @@ -79,20 +79,20 @@ public class MEMonitorPassThrough> extends MEPassThrough getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { super.getAvailableItems( new ItemListIgnoreCrafting( out ) ); return out; } @Override - public void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ) + public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) { this.listeners.put( l, verificationToken ); } @Override - public void removeListener( IMEMonitorHandlerReceiver l ) + public void removeListener( final IMEMonitorHandlerReceiver l ) { this.listeners.remove( l ); } @@ -102,7 +102,7 @@ public class MEMonitorPassThrough> extends MEPassThrough out = this.channel.createList(); + final IItemList out = this.channel.createList(); this.getInternal().getAvailableItems( new ItemListIgnoreCrafting( out ) ); return out; } @@ -110,19 +110,19 @@ public class MEMonitorPassThrough> extends MEPassThrough monitor, Iterable change, BaseActionSource source ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource source ) { - Iterator, Object>> i = this.listeners.entrySet().iterator(); + final Iterator, Object>> i = this.listeners.entrySet().iterator(); while( i.hasNext() ) { - Entry, Object> e = i.next(); - IMEMonitorHandlerReceiver receiver = e.getKey(); + final Entry, Object> e = i.next(); + final IMEMonitorHandlerReceiver receiver = e.getKey(); if( receiver.isValid( e.getValue() ) ) { receiver.postChange( this, change, source ); @@ -137,11 +137,11 @@ public class MEMonitorPassThrough> extends MEPassThrough, Object>> i = this.listeners.entrySet().iterator(); + final Iterator, Object>> i = this.listeners.entrySet().iterator(); while( i.hasNext() ) { - Entry, Object> e = i.next(); - IMEMonitorHandlerReceiver receiver = e.getKey(); + final Entry, Object> e = i.next(); + final IMEMonitorHandlerReceiver receiver = e.getKey(); if( receiver.isValid( e.getValue() ) ) { receiver.onListUpdate(); diff --git a/src/main/java/appeng/me/storage/MEPassThrough.java b/src/main/java/appeng/me/storage/MEPassThrough.java index c3dde45d..e5e4bcc3 100644 --- a/src/main/java/appeng/me/storage/MEPassThrough.java +++ b/src/main/java/appeng/me/storage/MEPassThrough.java @@ -35,7 +35,7 @@ public class MEPassThrough> implements IMEInventoryHandler protected final StorageChannel channel; private IMEInventory internal; - public MEPassThrough( IMEInventory i, StorageChannel channel ) + public MEPassThrough( final IMEInventory i, final StorageChannel channel ) { this.channel = channel; this.setInternal( i ); @@ -46,25 +46,25 @@ public class MEPassThrough> implements IMEInventoryHandler return this.internal; } - public void setInternal( IMEInventory i ) + public void setInternal( final IMEInventory i ) { this.internal = i; } @Override - public T injectItems( T input, Actionable type, BaseActionSource src ) + public T injectItems( final T input, final Actionable type, final BaseActionSource src ) { return this.internal.injectItems( input, type, src ); } @Override - public T extractItems( T request, Actionable type, BaseActionSource src ) + public T extractItems( final T request, final Actionable type, final BaseActionSource src ) { return this.internal.extractItems( request, type, src ); } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return this.internal.getAvailableItems( out ); } @@ -82,13 +82,13 @@ public class MEPassThrough> implements IMEInventoryHandler } @Override - public boolean isPrioritized( T input ) + public boolean isPrioritized( final T input ) { return false; } @Override - public boolean canAccept( T input ) + public boolean canAccept( final T input ) { return true; } @@ -106,7 +106,7 @@ public class MEPassThrough> implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java index 35a9c0da..b96a5a97 100644 --- a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java +++ b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java @@ -53,7 +53,7 @@ public class NetworkInventoryHandler> implements IMEInvent { @Override - public int compare( Integer o1, Integer o2 ) + public int compare( final Integer o1, final Integer o2 ) { return ItemSorters.compareInt( o2, o1 ); } @@ -65,16 +65,16 @@ public class NetworkInventoryHandler> implements IMEInvent private final NavigableMap>> priorityInventory; int myPass = 0; - public NetworkInventoryHandler( StorageChannel chan, SecurityCache security ) + public NetworkInventoryHandler( final StorageChannel chan, final SecurityCache security ) { this.myChannel = chan; this.security = security; this.priorityInventory = new TreeMap>>( PRIORITY_SORTER ); // TreeMultimap.create( prioritySorter, hashSorter ); } - public void addNewStorage( IMEInventoryHandler h ) + public void addNewStorage( final IMEInventoryHandler h ) { - int priority = h.getPriority(); + final int priority = h.getPriority(); List> list = this.priorityInventory.get( priority ); if( list == null ) { @@ -85,7 +85,7 @@ public class NetworkInventoryHandler> implements IMEInvent } @Override - public T injectItems( T input, Actionable type, BaseActionSource src ) + public T injectItems( T input, final Actionable type, final BaseActionSource src ) { if( this.diveList( this, type ) ) { @@ -98,12 +98,12 @@ public class NetworkInventoryHandler> implements IMEInvent return input; } - for( List> invList : this.priorityInventory.values() ) + for( final List> invList : this.priorityInventory.values() ) { Iterator> ii = invList.iterator(); while( ii.hasNext() && input != null ) { - IMEInventoryHandler inv = ii.next(); + final IMEInventoryHandler inv = ii.next(); if( inv.validForPass( 1 ) && inv.canAccept( input ) && ( inv.isPrioritized( input ) || inv.extractItems( input, Actionable.SIMULATE, src ) != null ) ) { @@ -118,7 +118,7 @@ public class NetworkInventoryHandler> implements IMEInvent ii = invList.iterator(); while( ii.hasNext() && input != null ) { - IMEInventoryHandler inv = ii.next(); + final IMEInventoryHandler inv = ii.next(); if( inv.validForPass( 2 ) && inv.canAccept( input ) && !inv.isPrioritized( input ) ) { @@ -132,9 +132,9 @@ public class NetworkInventoryHandler> implements IMEInvent return input; } - private boolean diveList( NetworkInventoryHandler networkInventoryHandler, Actionable type ) + private boolean diveList( final NetworkInventoryHandler networkInventoryHandler, final Actionable type ) { - LinkedList cDepth = this.getDepth( type ); + final LinkedList cDepth = this.getDepth( type ); if( cDepth.contains( networkInventoryHandler ) ) { return true; @@ -144,7 +144,7 @@ public class NetworkInventoryHandler> implements IMEInvent return false; } - private boolean testPermission( BaseActionSource src, SecurityPermissions permission ) + private boolean testPermission( final BaseActionSource src, final SecurityPermissions permission ) { if( src.isPlayer() ) { @@ -157,18 +157,18 @@ public class NetworkInventoryHandler> implements IMEInvent { if( this.security.isAvailable() ) { - IGridNode n = ( (MachineSource) src ).via.getActionableNode(); + final IGridNode n = ( (MachineSource) src ).via.getActionableNode(); if( n == null ) { return true; } - IGrid gn = n.getGrid(); + final IGrid gn = n.getGrid(); if( gn != this.security.myGrid ) { - ISecurityGrid sg = gn.getCache( ISecurityGrid.class ); - int playerID = sg.getOwner(); + final ISecurityGrid sg = gn.getCache( ISecurityGrid.class ); + final int playerID = sg.getOwner(); if( !this.security.hasPermission( playerID, permission ) ) { @@ -181,7 +181,7 @@ public class NetworkInventoryHandler> implements IMEInvent return false; } - private void surface( NetworkInventoryHandler networkInventoryHandler, Actionable type ) + private void surface( final NetworkInventoryHandler networkInventoryHandler, final Actionable type ) { if( this.getDepth( type ).pop() != this ) { @@ -189,9 +189,9 @@ public class NetworkInventoryHandler> implements IMEInvent } } - private LinkedList getDepth( Actionable type ) + private LinkedList getDepth( final Actionable type ) { - ThreadLocal depth = type == Actionable.MODULATE ? DEPTH_MOD : DEPTH_SIM; + final ThreadLocal depth = type == Actionable.MODULATE ? DEPTH_MOD : DEPTH_SIM; LinkedList s = depth.get(); @@ -204,7 +204,7 @@ public class NetworkInventoryHandler> implements IMEInvent } @Override - public T extractItems( T request, Actionable mode, BaseActionSource src ) + public T extractItems( T request, final Actionable mode, final BaseActionSource src ) { if( this.diveList( this, mode ) ) { @@ -217,21 +217,21 @@ public class NetworkInventoryHandler> implements IMEInvent return null; } - Iterator>> i = this.priorityInventory.descendingMap().values().iterator();// priorityInventory.asMap().descendingMap().entrySet().iterator(); + final Iterator>> i = this.priorityInventory.descendingMap().values().iterator();// priorityInventory.asMap().descendingMap().entrySet().iterator(); - T output = request.copy(); + final T output = request.copy(); request = request.copy(); output.setStackSize( 0 ); - long req = request.getStackSize(); + final long req = request.getStackSize(); while( i.hasNext() ) { - List> invList = i.next(); + final List> invList = i.next(); - Iterator> ii = invList.iterator(); + final Iterator> ii = invList.iterator(); while( ii.hasNext() && output.getStackSize() < req ) { - IMEInventoryHandler inv = ii.next(); + final IMEInventoryHandler inv = ii.next(); request.setStackSize( req - output.getStackSize() ); output.add( inv.extractItems( request, mode, src ) ); @@ -257,9 +257,9 @@ public class NetworkInventoryHandler> implements IMEInvent } // for (Entry> h : priorityInventory.entries()) - for( List> i : this.priorityInventory.values() ) + for( final List> i : this.priorityInventory.values() ) { - for( IMEInventoryHandler j : i ) + for( final IMEInventoryHandler j : i ) { out = j.getAvailableItems( out ); } @@ -270,9 +270,9 @@ public class NetworkInventoryHandler> implements IMEInvent return out; } - private boolean diveIteration( NetworkInventoryHandler networkInventoryHandler, Actionable type ) + private boolean diveIteration( final NetworkInventoryHandler networkInventoryHandler, final Actionable type ) { - LinkedList cDepth = this.getDepth( type ); + final LinkedList cDepth = this.getDepth( type ); if( cDepth.isEmpty() ) { currentPass++; @@ -307,13 +307,13 @@ public class NetworkInventoryHandler> implements IMEInvent } @Override - public boolean isPrioritized( T input ) + public boolean isPrioritized( final T input ) { return false; } @Override - public boolean canAccept( T input ) + public boolean canAccept( final T input ) { return true; } @@ -331,7 +331,7 @@ public class NetworkInventoryHandler> implements IMEInvent } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/NullInventory.java b/src/main/java/appeng/me/storage/NullInventory.java index 833bba4f..f674a192 100644 --- a/src/main/java/appeng/me/storage/NullInventory.java +++ b/src/main/java/appeng/me/storage/NullInventory.java @@ -32,19 +32,19 @@ public class NullInventory> implements IMEInventoryHandler { @Override - public T injectItems( T input, Actionable mode, BaseActionSource src ) + public T injectItems( final T input, final Actionable mode, final BaseActionSource src ) { return input; } @Override - public T extractItems( T request, Actionable mode, BaseActionSource src ) + public T extractItems( final T request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return out; } @@ -62,13 +62,13 @@ public class NullInventory> implements IMEInventoryHandler } @Override - public boolean isPrioritized( T input ) + public boolean isPrioritized( final T input ) { return false; } @Override - public boolean canAccept( T input ) + public boolean canAccept( final T input ) { return false; } @@ -86,7 +86,7 @@ public class NullInventory> implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return i == 2; } diff --git a/src/main/java/appeng/me/storage/SecurityInventory.java b/src/main/java/appeng/me/storage/SecurityInventory.java index 86d69001..5032801b 100644 --- a/src/main/java/appeng/me/storage/SecurityInventory.java +++ b/src/main/java/appeng/me/storage/SecurityInventory.java @@ -42,13 +42,13 @@ public class SecurityInventory implements IMEInventoryHandler public final IItemList storedItems = AEApi.instance().storage().createItemList(); final TileSecurity securityTile; - public SecurityInventory( TileSecurity ts ) + public SecurityInventory( final TileSecurity ts ) { this.securityTile = ts; } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { if( this.hasPermission( src ) ) { @@ -70,7 +70,7 @@ public class SecurityInventory implements IMEInventoryHandler return input; } - private boolean hasPermission( BaseActionSource src ) + private boolean hasPermission( final BaseActionSource src ) { if( src.isPlayer() ) { @@ -78,7 +78,7 @@ public class SecurityInventory implements IMEInventoryHandler { return this.securityTile.getProxy().getSecurity().hasPermission( ( (PlayerSource) src ).player, SecurityPermissions.SECURITY ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -87,14 +87,14 @@ public class SecurityInventory implements IMEInventoryHandler } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { if( this.hasPermission( src ) ) { - IAEItemStack target = this.storedItems.findPrecise( request ); + final IAEItemStack target = this.storedItems.findPrecise( request ); if( target != null ) { - IAEItemStack output = target.copy(); + final IAEItemStack output = target.copy(); if( mode == Actionable.SIMULATE ) { @@ -110,9 +110,9 @@ public class SecurityInventory implements IMEInventoryHandler } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { - for( IAEItemStack ais : this.storedItems ) + for( final IAEItemStack ais : this.storedItems ) { out.add( ais ); } @@ -133,30 +133,30 @@ public class SecurityInventory implements IMEInventoryHandler } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { return false; } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { if( input.getItem() instanceof IBiometricCard ) { - IBiometricCard tbc = (IBiometricCard) input.getItem(); - GameProfile newUser = tbc.getProfile( input.getItemStack() ); + final IBiometricCard tbc = (IBiometricCard) input.getItem(); + final GameProfile newUser = tbc.getProfile( input.getItemStack() ); - int PlayerID = AEApi.instance().registries().players().getID( newUser ); + final int PlayerID = AEApi.instance().registries().players().getID( newUser ); if( this.securityTile.getOwner() == PlayerID ) { return false; } - for( IAEItemStack ais : this.storedItems ) + for( final IAEItemStack ais : this.storedItems ) { if( ais.isMeaningful() ) { - GameProfile thisUser = tbc.getProfile( ais.getItemStack() ); + final GameProfile thisUser = tbc.getProfile( ais.getItemStack() ); if( thisUser == newUser ) { return false; @@ -187,7 +187,7 @@ public class SecurityInventory implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return true; } diff --git a/src/main/java/appeng/me/storage/VoidFluidInventory.java b/src/main/java/appeng/me/storage/VoidFluidInventory.java index 045ab04c..3cab7082 100644 --- a/src/main/java/appeng/me/storage/VoidFluidInventory.java +++ b/src/main/java/appeng/me/storage/VoidFluidInventory.java @@ -34,13 +34,13 @@ public class VoidFluidInventory implements IMEInventoryHandler final TileCondenser target; - public VoidFluidInventory( TileCondenser te ) + public VoidFluidInventory( final TileCondenser te ) { this.target = te; } @Override - public IAEFluidStack injectItems( IAEFluidStack input, Actionable mode, BaseActionSource src ) + public IAEFluidStack injectItems( final IAEFluidStack input, final Actionable mode, final BaseActionSource src ) { if( mode == Actionable.SIMULATE ) { @@ -55,13 +55,13 @@ public class VoidFluidInventory implements IMEInventoryHandler } @Override - public IAEFluidStack extractItems( IAEFluidStack request, Actionable mode, BaseActionSource src ) + public IAEFluidStack extractItems( final IAEFluidStack request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return out; } @@ -79,13 +79,13 @@ public class VoidFluidInventory implements IMEInventoryHandler } @Override - public boolean isPrioritized( IAEFluidStack input ) + public boolean isPrioritized( final IAEFluidStack input ) { return false; } @Override - public boolean canAccept( IAEFluidStack input ) + public boolean canAccept( final IAEFluidStack input ) { return true; } @@ -103,7 +103,7 @@ public class VoidFluidInventory implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return i == 2; } diff --git a/src/main/java/appeng/me/storage/VoidItemInventory.java b/src/main/java/appeng/me/storage/VoidItemInventory.java index 2ed92610..5400e75b 100644 --- a/src/main/java/appeng/me/storage/VoidItemInventory.java +++ b/src/main/java/appeng/me/storage/VoidItemInventory.java @@ -34,13 +34,13 @@ public class VoidItemInventory implements IMEInventoryHandler final TileCondenser target; - public VoidItemInventory( TileCondenser te ) + public VoidItemInventory( final TileCondenser te ) { this.target = te; } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src ) { if( mode == Actionable.SIMULATE ) { @@ -55,13 +55,13 @@ public class VoidItemInventory implements IMEInventoryHandler } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return out; } @@ -79,13 +79,13 @@ public class VoidItemInventory implements IMEInventoryHandler } @Override - public boolean isPrioritized( IAEItemStack input ) + public boolean isPrioritized( final IAEItemStack input ) { return false; } @Override - public boolean canAccept( IAEItemStack input ) + public boolean canAccept( final IAEItemStack input ) { return true; } @@ -103,7 +103,7 @@ public class VoidItemInventory implements IMEInventoryHandler } @Override - public boolean validForPass( int i ) + public boolean validForPass( final int i ) { return i == 2; } diff --git a/src/main/java/appeng/parts/AEBasePart.java b/src/main/java/appeng/parts/AEBasePart.java index 314aa251..c6a9abd7 100644 --- a/src/main/java/appeng/parts/AEBasePart.java +++ b/src/main/java/appeng/parts/AEBasePart.java @@ -83,7 +83,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, protected IPartHost host = null; protected AEPartLocation side = null; - public AEBasePart( ItemStack is ) + public AEBasePart( final ItemStack is ) { Preconditions.checkNotNull( is ); @@ -98,13 +98,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public IGridNode getGridNode( AEPartLocation dir ) + public IGridNode getGridNode( final AEPartLocation dir ) { return this.proxy.getNode(); } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.GLASS; } @@ -114,7 +114,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, { if( this.is.stackSize > 0 ) { - List items = new ArrayList(); + final List items = new ArrayList(); items.add( this.is.copy() ); this.host.removePart( this.side, false ); Platform.spawnDrops( this.tile.getWorld(), this.tile.getPos(), items ); @@ -132,20 +132,20 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return 0; } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setBounds( 1, 1, 1, 15, 15, 15 ); rh.renderInventoryBox( renderer ); @@ -197,7 +197,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setBounds( 1, 1, 1, 15, 15, 15 ); rh.renderBlock( pos, renderer ); @@ -209,24 +209,24 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, return this.is.hasDisplayName(); } - public void addEntityCrashInfo( CrashReportCategory crashreportcategory ) + public void addEntityCrashInfo( final CrashReportCategory crashreportcategory ) { crashreportcategory.addCrashSection( "Part Side", this.side ); } @Override @SideOnly( Side.CLIENT ) - public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderDynamic( final double x, final double y, final double z, final IPartRenderHelper rh, final ModelGenerator renderer ) { } @Override - public ItemStack getItemStack( PartItemStack type ) + public ItemStack getItemStack( final PartItemStack type ) { if( type == PartItemStack.Network ) { - ItemStack copy = this.is.copy(); + final ItemStack copy = this.is.copy(); copy.setTagCompound( null ); return copy; } @@ -252,13 +252,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { this.proxy.readFromNBT( data ); } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { this.proxy.writeToNBT( data ); } @@ -276,13 +276,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { return false; } @@ -294,7 +294,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void onEntityCollision( Entity entity ) + public void onEntityCollision( final Entity entity ) { } @@ -312,7 +312,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile ) { this.side = side; this.tile = tile; @@ -327,7 +327,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, @Override @SideOnly( Side.CLIENT ) - public void randomDisplayTick( World world, BlockPos pos, Random r ) + public void randomDisplayTick( final World world, final BlockPos pos, final Random r ) { } @@ -339,7 +339,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { } @@ -351,7 +351,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public boolean isLadder( EntityLivingBase entity ) + public boolean isLadder( final EntityLivingBase entity ) { return false; } @@ -363,7 +363,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { return null; } @@ -374,11 +374,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, * @param from source of settings * @param compound compound of source */ - public void uploadSettings( SettingsFrom from, NBTTagCompound compound ) + public void uploadSettings( final SettingsFrom from, final NBTTagCompound compound ) { if( compound != null ) { - IConfigManager cm = this.getConfigManager(); + final IConfigManager cm = this.getConfigManager(); if( cm != null ) { cm.readFromNBT( compound ); @@ -387,15 +387,15 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, if( this instanceof IPriorityHost ) { - IPriorityHost pHost = (IPriorityHost) this; + final IPriorityHost pHost = (IPriorityHost) this; pHost.setPriority( compound.getInteger( "priority" ) ); } - IInventory inv = this.getInventoryByName( "config" ); + final IInventory inv = this.getInventoryByName( "config" ); if( inv instanceof AppEngInternalAEInventory ) { - AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; - AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); + final AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; + final AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); tmp.readFromNBT( compound, "config" ); for( int x = 0; x < tmp.getSizeInventory(); x++ ) { @@ -411,11 +411,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, * * @return compound of source */ - public NBTTagCompound downloadSettings( SettingsFrom from ) + public NBTTagCompound downloadSettings( final SettingsFrom from ) { - NBTTagCompound output = new NBTTagCompound(); + final NBTTagCompound output = new NBTTagCompound(); - IConfigManager cm = this.getConfigManager(); + final IConfigManager cm = this.getConfigManager(); if( cm != null ) { cm.writeToNBT( output ); @@ -423,11 +423,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, if( this instanceof IPriorityHost ) { - IPriorityHost pHost = (IPriorityHost) this; + final IPriorityHost pHost = (IPriorityHost) this; output.setInteger( "priority", pHost.getPriority() ); } - IInventory inv = this.getInventoryByName( "config" ); + final IInventory inv = this.getInventoryByName( "config" ); if( inv instanceof AppEngInternalAEInventory ) { ( (AppEngInternalAEInventory) inv ).writeToNBT( output, "config" ); @@ -441,13 +441,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, return true; } - private boolean useMemoryCard( EntityPlayer player ) + private boolean useMemoryCard( final EntityPlayer player ) { - ItemStack memCardIS = player.inventory.getCurrentItem(); + final ItemStack memCardIS = player.inventory.getCurrentItem(); if( memCardIS != null && this.useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard ) { - IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem(); + final IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem(); ItemStack is = this.getItemStack( PartItemStack.Network ); @@ -455,17 +455,17 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, final IDefinitions definitions = AEApi.instance().definitions(); if( definitions.parts().iface().isSameAs( is ) ) { - for( ItemStack iface : definitions.blocks().iface().maybeStack( 1 ).asSet() ) + for( final ItemStack iface : definitions.blocks().iface().maybeStack( 1 ).asSet() ) { is = iface; } } - String name = is.getUnlocalizedName(); + final String name = is.getUnlocalizedName(); if( player.isSneaking() ) { - NBTTagCompound data = this.downloadSettings( SettingsFrom.MEMORY_CARD ); + final NBTTagCompound data = this.downloadSettings( SettingsFrom.MEMORY_CARD ); if( data != null ) { memoryCard.setMemoryCardContents( memCardIS, name, data ); @@ -474,8 +474,8 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } else { - String storedName = memoryCard.getSettingsName( memCardIS ); - NBTTagCompound data = memoryCard.getData( memCardIS ); + final String storedName = memoryCard.getSettingsName( memCardIS ); + final NBTTagCompound data = memoryCard.getData( memCardIS ); if( name.equals( storedName ) ) { this.uploadSettings( SettingsFrom.MEMORY_CARD, data ); @@ -492,7 +492,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public final boolean onActivate( EntityPlayer player, Vec3 pos ) + public final boolean onActivate( final EntityPlayer player, final Vec3 pos ) { if( this.useMemoryCard( player ) ) { @@ -503,7 +503,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, } @Override - public final boolean onShiftActivate( EntityPlayer player, Vec3 pos ) + public final boolean onShiftActivate( final EntityPlayer player, final Vec3 pos ) { if( this.useMemoryCard( player ) ) { @@ -513,24 +513,24 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, return this.onPartShiftActivate( player, pos ); } - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { return false; } - public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos ) { return false; } @Override - public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side ) { this.proxy.setOwner( player ); } @Override - public boolean canBePlacedOn( BusSupport what ) + public boolean canBePlacedOn( final BusSupport what ) { return what == BusSupport.CABLE; } @@ -543,7 +543,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, @Override @SideOnly( Side.CLIENT ) - public TextureAtlasSprite getBreakingTexture(ModelGenerator renderer) + public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer) { return null; } diff --git a/src/main/java/appeng/parts/BusCollisionHelper.java b/src/main/java/appeng/parts/BusCollisionHelper.java index b465d4f4..4f30dd57 100644 --- a/src/main/java/appeng/parts/BusCollisionHelper.java +++ b/src/main/java/appeng/parts/BusCollisionHelper.java @@ -40,7 +40,7 @@ public class BusCollisionHelper implements IPartCollisionHelper private final Entity entity; private final boolean isVisual; - public BusCollisionHelper( List boxes, EnumFacing x, EnumFacing y, EnumFacing z, Entity e, boolean visual ) + public BusCollisionHelper( final List boxes, final EnumFacing x, final EnumFacing y, final EnumFacing z, final Entity e, final boolean visual ) { this.boxes = boxes; this.x = x; @@ -50,7 +50,7 @@ public class BusCollisionHelper implements IPartCollisionHelper this.isVisual = visual; } - public BusCollisionHelper( List boxes, AEPartLocation s, Entity e, boolean visual ) + public BusCollisionHelper( final List boxes, final AEPartLocation s, final Entity e, final boolean visual ) { this.boxes = boxes; this.entity = e; diff --git a/src/main/java/appeng/parts/CableBusContainer.java b/src/main/java/appeng/parts/CableBusContainer.java index 0aac7c02..e354fffe 100644 --- a/src/main/java/appeng/parts/CableBusContainer.java +++ b/src/main/java/appeng/parts/CableBusContainer.java @@ -82,18 +82,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I public boolean requiresDynamicRender = false; boolean inWorld = false; - public CableBusContainer( IPartHost host ) + public CableBusContainer( final IPartHost host ) { this.tcb = host; } public static boolean isLoading() { - Boolean is = IS_LOADING.get(); + final Boolean is = IS_LOADING.get(); return is != null && is; } - public void setHost( IPartHost host ) + public void setHost( final IPartHost host ) { this.tcb.clearContainer(); this.tcb = host; @@ -101,7 +101,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I public void rotateLeft() { - IPart[] newSides = new IPart[6]; + final IPart[] newSides = new IPart[6]; newSides[AEPartLocation.UP.ordinal()] = this.getSide( AEPartLocation.UP ); newSides[AEPartLocation.DOWN.ordinal()] = this.getSide( AEPartLocation.DOWN ); @@ -111,7 +111,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I newSides[AEPartLocation.WEST.ordinal()] = this.getSide( AEPartLocation.SOUTH ); newSides[AEPartLocation.NORTH.ordinal()] = this.getSide( AEPartLocation.WEST ); - for( AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS ) { this.setSide( dir, newSides[dir.ordinal()] ); } @@ -126,7 +126,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean canAddPart( ItemStack is, AEPartLocation side ) + public boolean canAddPart( ItemStack is, final AEPartLocation side ) { if( PartPlacement.isFacade( is, side ) != null ) { @@ -135,18 +135,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( is.getItem() instanceof IPartItem ) { - IPartItem bi = (IPartItem) is.getItem(); + final IPartItem bi = (IPartItem) is.getItem(); is = is.copy(); is.stackSize = 1; - IPart bp = bi.createPartFromItemStack( is ); + final IPart bp = bi.createPartFromItemStack( is ); if( bp != null ) { if( bp instanceof IPartCable ) { boolean canPlace = true; - for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) { if( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ( (IPartCable) bp ).supportsBuses() ) ) { @@ -163,7 +163,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } else if( !( bp instanceof IPartCable ) && side != AEPartLocation.INTERNAL ) { - IPart cable = this.getPart( AEPartLocation.INTERNAL ); + final IPart cable = this.getPart( AEPartLocation.INTERNAL ); if( cable != null && !bp.canBePlacedOn( ( (IPartCable) cable ).supportsBuses() ) ) { return false; @@ -177,22 +177,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public AEPartLocation addPart( ItemStack is, AEPartLocation side, EntityPlayer player ) + public AEPartLocation addPart( ItemStack is, final AEPartLocation side, final EntityPlayer player ) { if( this.canAddPart( is, side ) ) { if( is.getItem() instanceof IPartItem ) { - IPartItem bi = (IPartItem) is.getItem(); + final IPartItem bi = (IPartItem) is.getItem(); is = is.copy(); is.stackSize = 1; - IPart bp = bi.createPartFromItemStack( is ); + final IPart bp = bi.createPartFromItemStack( is ); if( bp instanceof IPartCable ) { boolean canPlace = true; - for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) { if( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ( (IPartCable) bp ).supportsBuses() ) ) { @@ -223,22 +223,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I bp.addToWorld(); } - IGridNode cn = this.getCenter().getGridNode(); + final IGridNode cn = this.getCenter().getGridNode(); if( cn != null ) { - for( AEPartLocation ins : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation ins : AEPartLocation.SIDE_LOCATIONS ) { - IPart sbp = this.getPart( ins ); + final IPart sbp = this.getPart( ins ); if( sbp != null ) { - IGridNode sn = sbp.getGridNode(); + final IGridNode sn = sbp.getGridNode(); if( sn != null ) { try { new GridConnection( cn, sn, AEPartLocation.INTERNAL ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // ekk! @@ -259,7 +259,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } else if( bp != null && !( bp instanceof IPartCable ) && side != AEPartLocation.INTERNAL ) { - IPart cable = this.getPart( AEPartLocation.INTERNAL ); + final IPart cable = this.getPart( AEPartLocation.INTERNAL ); if( cable != null && !bp.canBePlacedOn( ( (IPartCable) cable ).supportsBuses() ) ) { return null; @@ -280,8 +280,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( this.getCenter() != null ) { - IGridNode cn = this.getCenter().getGridNode(); - IGridNode sn = bp.getGridNode(); + final IGridNode cn = this.getCenter().getGridNode(); + final IGridNode sn = bp.getGridNode(); if( cn != null && sn != null ) { @@ -289,7 +289,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { new GridConnection( cn, sn, AEPartLocation.INTERNAL ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // ekk! @@ -313,7 +313,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public IPart getPart( AEPartLocation partLocation ) + public IPart getPart( final AEPartLocation partLocation ) { if( partLocation == AEPartLocation.INTERNAL ) { @@ -323,13 +323,13 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public IPart getPart( EnumFacing side ) + public IPart getPart( final EnumFacing side ) { return this.getSide( AEPartLocation.fromFacing( side ) ); } @Override - public void removePart( AEPartLocation side, boolean suppressUpdate ) + public void removePart( final AEPartLocation side, final boolean suppressUpdate ) { if( side == AEPartLocation.INTERNAL ) { @@ -381,7 +381,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if( this.getCenter() != null ) { - IPartCable c = this.getCenter(); + final IPartCable c = this.getCenter(); return c.getCableColor(); } return AEColor.Transparent; @@ -394,22 +394,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean isBlocked( EnumFacing side ) + public boolean isBlocked( final EnumFacing side ) { return this.tcb.isBlocked( side ); } @Override - public SelectedPart selectPart( Vec3 pos ) + public SelectedPart selectPart( final Vec3 pos ) { - for( AEPartLocation side : AEPartLocation.values() ) + for( final AEPartLocation side : AEPartLocation.values() ) { - IPart p = this.getPart( side ); + final IPart p = this.getPart( side ); if( p != null ) { - List boxes = new LinkedList(); + final List boxes = new LinkedList(); - IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); + final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); p.getBoxes( bch ); for( AxisAlignedBB bb : boxes ) { @@ -424,15 +424,15 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( AEApi.instance().partHelper().getCableRenderMode().opaqueFacades ) { - IFacadeContainer fc = this.getFacadeContainer(); - for( AEPartLocation side : AEPartLocation.SIDE_LOCATIONS ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS ) { - IFacadePart p = fc.getFacade( side ); + final IFacadePart p = fc.getFacade( side ); if( p != null ) { - List boxes = new LinkedList(); + final List boxes = new LinkedList(); - IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); + final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true ); p.getBoxes( bch, null ); for( AxisAlignedBB bb : boxes ) { @@ -460,12 +460,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if( this.getCenter() == null ) { - List facades = new LinkedList(); + final List facades = new LinkedList(); - IFacadeContainer fc = this.getFacadeContainer(); - for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) { - IFacadePart fp = fc.getFacade( d ); + final IFacadePart fp = fc.getFacade( d ); if( fp != null ) { facades.add( fp.getItemStack() ); @@ -475,7 +475,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( !facades.isEmpty() ) { - TileEntity te = this.tcb.getTile(); + final TileEntity te = this.tcb.getTile(); Platform.spawnDrops( te.getWorld(), te.getPos(), facades ); } } @@ -484,7 +484,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean hasRedstone( AEPartLocation side ) + public boolean hasRedstone( final AEPartLocation side ) { if( this.hasRedstone == YesNo.UNDECIDED ) { @@ -497,10 +497,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public boolean isEmpty() { - IFacadeContainer fc = this.getFacadeContainer(); - for( AEPartLocation s : AEPartLocation.values() ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final AEPartLocation s : AEPartLocation.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { return false; @@ -508,7 +508,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( s != AEPartLocation.INTERNAL ) { - IFacadePart fp = fc.getFacade( s ); + final IFacadePart fp = fc.getFacade( s ); if( fp != null ) { return false; @@ -544,16 +544,16 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I private void updateRedstone() { - TileEntity te = this.getTile(); + final TileEntity te = this.getTile(); this.hasRedstone = te.getWorld().isBlockIndirectlyGettingPowered( te.getPos() ) != 0 ? YesNo.YES : YesNo.NO; } public void updateDynamicRender() { this.requiresDynamicRender = false; - for( AEPartLocation s : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation s : AEPartLocation.SIDE_LOCATIONS ) { - IPart p = this.getPart( s ); + final IPart p = this.getPart( s ); if( p != null ) { this.requiresDynamicRender = this.requiresDynamicRender || p.requireDynamicRender(); @@ -568,9 +568,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if( this.getCenter() != null ) { - EnumSet sides = EnumSet.allOf( EnumFacing.class ); + final EnumSet sides = EnumSet.allOf( EnumFacing.class ); - for( EnumFacing s : EnumFacing.VALUES ) + for( final EnumFacing s : EnumFacing.VALUES ) { if( this.getPart( s ) != null || this.isBlocked( s ) ) { @@ -579,7 +579,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } this.getCenter().setValidSides( sides ); - IGridNode n = this.getCenter().getGridNode(); + final IGridNode n = this.getCenter().getGridNode(); if( n != null ) { n.updateState(); @@ -597,13 +597,13 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I this.inWorld = true; IS_LOADING.set( true ); - TileEntity te = this.getTile(); + final TileEntity te = this.getTile(); // start with the center, then install the side parts into the grid. for( int x = 6; x >= 0; x-- ) { - AEPartLocation s = AEPartLocation.fromOrdinal( x ); - IPart part = this.getPart( s ); + final AEPartLocation s = AEPartLocation.fromOrdinal( x ); + final IPart part = this.getPart( s ); if( part != null ) { @@ -612,24 +612,24 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( s != AEPartLocation.INTERNAL ) { - IGridNode sn = part.getGridNode(); + final IGridNode sn = part.getGridNode(); if( sn != null ) { // this is a really stupid if statement, why was this // here? // if ( !sn.getConnections().iterator().hasNext() ) - IPart center = this.getPart( AEPartLocation.INTERNAL ); + final IPart center = this.getPart( AEPartLocation.INTERNAL ); if( center != null ) { - IGridNode cn = center.getGridNode(); + final IGridNode cn = center.getGridNode(); if( cn != null ) { try { AEApi.instance().createGridConnection( cn, sn ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // ekk } @@ -654,9 +654,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I this.inWorld = false; - for( AEPartLocation s : AEPartLocation.values() ) + for( final AEPartLocation s : AEPartLocation.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { part.removeFromWorld(); @@ -667,12 +667,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public IGridNode getGridNode( AEPartLocation side ) + public IGridNode getGridNode( final AEPartLocation side ) { - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); if( part != null ) { - IGridNode n = part.getExternalFacingNode(); + final IGridNode n = part.getExternalFacingNode(); if( n != null ) { return n; @@ -688,12 +688,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part instanceof IGridHost ) { - AECableType t = ( (IGridHost) part ).getCableConnectionType( dir ); + final AECableType t = ( (IGridHost) part ).getCableConnectionType( dir ); if( t != null && t != AECableType.NONE ) { return t; @@ -702,7 +702,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( this.getCenter() != null ) { - IPartCable c = this.getCenter(); + final IPartCable c = this.getCenter(); return c.getCableConnectionType(); } return AECableType.NONE; @@ -711,9 +711,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I @Override public void securityBreak() { - for( AEPartLocation d : AEPartLocation.values() ) + for( final AEPartLocation d : AEPartLocation.values() ) { - IPart p = this.getPart( d ); + final IPart p = this.getPart( d ); if( p instanceof IGridHost ) { ( (IGridHost) p ).securityBreak(); @@ -721,16 +721,16 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } - public Iterable getSelectedBoundingBoxesFromPool( boolean ignoreConnections, boolean includeFacades, Entity e, boolean visual ) + public Iterable getSelectedBoundingBoxesFromPool( final boolean ignoreConnections, final boolean includeFacades, final Entity e, final boolean visual ) { - List boxes = new LinkedList(); + final List boxes = new LinkedList(); - IFacadeContainer fc = this.getFacadeContainer(); - for( AEPartLocation s : AEPartLocation.values() ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final AEPartLocation s : AEPartLocation.values() ) { - IPartCollisionHelper bch = new BusCollisionHelper( boxes, s, e, visual ); + final IPartCollisionHelper bch = new BusCollisionHelper( boxes, s, e, visual ); - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { if( ignoreConnections && part instanceof IPartCable ) @@ -747,7 +747,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { if( includeFacades && s != null && s != AEPartLocation.INTERNAL ) { - IFacadePart fp = fc.getFacade( s ); + final IFacadePart fp = fc.getFacade( s ); if( fp != null ) { fp.getBoxes( bch, e ); @@ -760,25 +760,25 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public int isProvidingStrongPower( EnumFacing side ) + public int isProvidingStrongPower( final EnumFacing side ) { - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); return part != null ? part.isProvidingStrongPower() : 0; } @Override - public int isProvidingWeakPower( EnumFacing side ) + public int isProvidingWeakPower( final EnumFacing side ) { - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); return part != null ? part.isProvidingWeakPower() : 0; } @Override - public boolean canConnectRedstone( EnumSet enumSet ) + public boolean canConnectRedstone( final EnumSet enumSet ) { - for( EnumFacing dir : enumSet ) + for( final EnumFacing dir : enumSet ) { - IPart part = this.getPart( dir ); + final IPart part = this.getPart( dir ); if( part != null && part.canConnectRedstone() ) { return true; @@ -788,11 +788,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public void onEntityCollision( Entity entity ) + public void onEntityCollision( final Entity entity ) { - for( AEPartLocation s : AEPartLocation.values() ) + for( final AEPartLocation s : AEPartLocation.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { part.onEntityCollision( entity ); @@ -801,9 +801,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean activate( EntityPlayer player, Vec3 pos ) + public boolean activate( final EntityPlayer player, final Vec3 pos ) { - SelectedPart p = this.selectPart( pos ); + final SelectedPart p = this.selectPart( pos ); if( p != null && p.part != null ) { return p.part.onActivate( player, pos ); @@ -816,9 +816,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { this.hasRedstone = YesNo.UNDECIDED; - for( AEPartLocation s : AEPartLocation.values() ) + for( final AEPartLocation s : AEPartLocation.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { part.onNeighborChanged(); @@ -827,7 +827,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean isSolidOnSide( EnumFacing side ) + public boolean isSolidOnSide( final EnumFacing side ) { if( side == null ) { @@ -835,23 +835,23 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } // facades are solid.. - IFacadePart fp = this.getFacadeContainer().getFacade( AEPartLocation.fromFacing( side ) ); + final IFacadePart fp = this.getFacadeContainer().getFacade( AEPartLocation.fromFacing( side ) ); if( fp != null ) { return true; } // buses can be too. - IPart part = this.getPart( side ); + final IPart part = this.getPart( side ); return part != null && part.isSolid(); } @Override - public boolean isLadder( EntityLivingBase entity ) + public boolean isLadder( final EntityLivingBase entity ) { - for( AEPartLocation side : AEPartLocation.values() ) + for( final AEPartLocation side : AEPartLocation.values() ) { - IPart p = this.getPart( side ); + final IPart p = this.getPart( side ); if( p != null ) { if( p.isLadder( entity ) ) @@ -865,11 +865,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public void randomDisplayTick( World world, BlockPos pos, Random r ) + public void randomDisplayTick( final World world, final BlockPos pos, final Random r ) { - for( AEPartLocation side : AEPartLocation.values() ) + for( final AEPartLocation side : AEPartLocation.values() ) { - IPart p = this.getPart( side ); + final IPart p = this.getPart( side ); if( p != null ) { p.randomDisplayTick( world, pos, r ); @@ -882,9 +882,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { int light = 0; - for( AEPartLocation d : AEPartLocation.values() ) + for( final AEPartLocation d : AEPartLocation.values() ) { - IPart p = this.getPart( d ); + final IPart p = this.getPart( d ); if( p != null ) { light = Math.max( p.getLightLevel(), light ); @@ -906,17 +906,17 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @SideOnly( Side.CLIENT ) - public void renderDynamic( double x, double y, double z ) + public void renderDynamic( final double x, final double y, final double z ) { CableRenderHelper.getInstance().renderDynamic( this, x, y, z ); } - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { int sides = 0; for( int x = 0; x < 7; x++ ) { - IPart p = this.getPart( AEPartLocation.fromOrdinal( x ) ); + final IPart p = this.getPart( AEPartLocation.fromOrdinal( x ) ); if( p != null ) { sides |= ( 1 << x ); @@ -927,10 +927,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I for( int x = 0; x < 7; x++ ) { - IPart p = this.getPart( AEPartLocation.fromOrdinal( x ) ); + final IPart p = this.getPart( AEPartLocation.fromOrdinal( x ) ); if( p != null ) { - ItemStack is = p.getItemStack( PartItemStack.Network ); + final ItemStack is = p.getItemStack( PartItemStack.Network ); data.writeShort( Item.getIdFromItem( is.getItem() ) ); data.writeShort( is.getItemDamage() ); @@ -942,9 +942,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I this.getFacadeContainer().writeToStream( data ); } - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { - byte sides = data.readByte(); + final byte sides = data.readByte(); boolean updateBlock = false; @@ -955,12 +955,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { IPart p = this.getPart( side ); - short itemID = data.readShort(); - short dmgValue = data.readShort(); + final short itemID = data.readShort(); + final short dmgValue = data.readShort(); - Item myItem = Item.getItemById( itemID ); + final Item myItem = Item.getItemById( itemID ); - ItemStack current = p != null ? p.getItemStack( PartItemStack.Network ) : null; + final ItemStack current = p != null ? p.getItemStack( PartItemStack.Network ) : null; if( current != null && current.getItem() == myItem && current.getItemDamage() == dmgValue ) { if( p.readFromStream( data ) ) @@ -997,22 +997,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return updateBlock; } - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { data.setInteger( "hasRedstone", this.hasRedstone.ordinal() ); - IFacadeContainer fc = this.getFacadeContainer(); - for( AEPartLocation s : AEPartLocation.values() ) + final IFacadeContainer fc = this.getFacadeContainer(); + for( final AEPartLocation s : AEPartLocation.values() ) { fc.writeToNBT( data ); - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { - NBTTagCompound def = new NBTTagCompound(); + final NBTTagCompound def = new NBTTagCompound(); part.getItemStack( PartItemStack.World ).writeToNBT( def ); - NBTTagCompound extra = new NBTTagCompound(); + final NBTTagCompound extra = new NBTTagCompound(); part.writeToNBT( extra ); data.setTag( "def:" + this.getSide( part ).ordinal(), def ); @@ -1021,7 +1021,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } } - AEPartLocation getSide( IPart part ) + AEPartLocation getSide( final IPart part ) { if( this.getCenter() == part ) { @@ -1029,7 +1029,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } else { - for( AEPartLocation side : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS ) { if( this.getSide( side ) == part ) { @@ -1041,7 +1041,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I throw new IllegalStateException( "Uhh Bad Part (" + part + ") on Side." ); } - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { if( data.hasKey( "hasRedstone" ) ) { @@ -1052,18 +1052,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I { AEPartLocation side = AEPartLocation.fromOrdinal( x ); - NBTTagCompound def = data.getCompoundTag( "def:" + side.ordinal() ); - NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() ); + final NBTTagCompound def = data.getCompoundTag( "def:" + side.ordinal() ); + final NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() ); if( def != null && extra != null ) { IPart p = this.getPart( side ); - ItemStack iss = ItemStack.loadItemStackFromNBT( def ); + final ItemStack iss = ItemStack.loadItemStackFromNBT( def ); if( iss == null ) { continue; } - ItemStack current = p == null ? null : p.getItemStack( PartItemStack.World ); + final ItemStack current = p == null ? null : p.getItemStack( PartItemStack.World ); if( Platform.isSameItemType( iss, current ) ) { @@ -1093,11 +1093,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I this.getFacadeContainer().readFromNBT( data ); } - public List getDrops( List drops ) + public List getDrops( final List drops ) { - for( AEPartLocation s : AEPartLocation.values() ) + for( final AEPartLocation s : AEPartLocation.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { drops.add( part.getItemStack( PartItemStack.Break ) ); @@ -1106,7 +1106,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I if( s != AEPartLocation.INTERNAL ) { - IFacadePart fp = this.getFacadeContainer().getFacade( s ); + final IFacadePart fp = this.getFacadeContainer().getFacade( s ); if( fp != null ) { drops.add( fp.getItemStack() ); @@ -1117,11 +1117,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I return drops; } - public List getNoDrops( List drops ) + public List getNoDrops( final List drops ) { - for( AEPartLocation s : AEPartLocation.values() ) + for( final AEPartLocation s : AEPartLocation.values() ) { - IPart part = this.getPart( s ); + final IPart part = this.getPart( s ); if( part != null ) { part.getDrops( drops, false ); @@ -1132,12 +1132,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I } @Override - public boolean recolourBlock( EnumFacing side, AEColor colour, EntityPlayer who ) + public boolean recolourBlock( final EnumFacing side, final AEColor colour, final EntityPlayer who ) { - IPart cable = this.getPart( AEPartLocation.INTERNAL ); + final IPart cable = this.getPart( AEPartLocation.INTERNAL ); if( cable != null ) { - IPartCable pc = (IPartCable) cable; + final IPartCable pc = (IPartCable) cable; return pc.changeColor( colour, who ); } return false; diff --git a/src/main/java/appeng/parts/CableBusStorage.java b/src/main/java/appeng/parts/CableBusStorage.java index 4d98ee03..ef1f7f7b 100644 --- a/src/main/java/appeng/parts/CableBusStorage.java +++ b/src/main/java/appeng/parts/CableBusStorage.java @@ -42,14 +42,14 @@ public class CableBusStorage return this.center; } - protected void setCenter( IPartCable center ) + protected void setCenter( final IPartCable center ) { this.center = center; } - protected IPart getSide( AEPartLocation side ) + protected IPart getSide( final AEPartLocation side ) { - int x = side.ordinal(); + final int x = side.ordinal(); if( this.sides != null && this.sides.length > x ) { return this.sides[x]; @@ -58,9 +58,9 @@ public class CableBusStorage return null; } - protected void setSide( AEPartLocation side, IPart part ) + protected void setSide( final AEPartLocation side, final IPart part ) { - int x = side.ordinal(); + final int x = side.ordinal(); if( this.sides != null && this.sides.length > x && part == null ) { @@ -74,7 +74,7 @@ public class CableBusStorage } } - private T[] shrink( T[] in, boolean parts ) + private T[] shrink( final T[] in, final boolean parts ) { int newSize = -1; for( int x = 0; x < in.length; x++ ) @@ -96,22 +96,22 @@ public class CableBusStorage return in; } - T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] ); + final T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] ); System.arraycopy( in, 0, newArray, 0, newSize ); return newArray; } - private T[] grow( T[] in, int newValue, boolean parts ) + private T[] grow( final T[] in, final int newValue, final boolean parts ) { if( in != null && in.length > newValue ) { return in; } - int newSize = newValue + 1; + final int newSize = newValue + 1; - T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] ); + final T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] ); if( in != null ) { System.arraycopy( in, 0, newArray, 0, in.length ); @@ -120,7 +120,7 @@ public class CableBusStorage return newArray; } - public IFacadePart getFacade( int x ) + public IFacadePart getFacade( final int x ) { if( this.facades != null && this.facades.length > x ) { @@ -130,7 +130,7 @@ public class CableBusStorage return null; } - public void setFacade( int x, @Nullable IFacadePart facade ) + public void setFacade( final int x, @Nullable final IFacadePart facade ) { if( this.facades != null && this.facades.length > x && facade == null ) { diff --git a/src/main/java/appeng/parts/NullCableBusContainer.java b/src/main/java/appeng/parts/NullCableBusContainer.java index 1f58b031..bd6a707f 100644 --- a/src/main/java/appeng/parts/NullCableBusContainer.java +++ b/src/main/java/appeng/parts/NullCableBusContainer.java @@ -37,31 +37,31 @@ public class NullCableBusContainer implements ICableBusContainer { @Override - public int isProvidingStrongPower( EnumFacing opposite ) + public int isProvidingStrongPower( final EnumFacing opposite ) { return 0; } @Override - public int isProvidingWeakPower( EnumFacing opposite ) + public int isProvidingWeakPower( final EnumFacing opposite ) { return 0; } @Override - public boolean canConnectRedstone( EnumSet of ) + public boolean canConnectRedstone( final EnumSet of ) { return false; } @Override - public void onEntityCollision( Entity e ) + public void onEntityCollision( final Entity e ) { } @Override - public boolean activate( EntityPlayer player, Vec3 vecFromPool ) + public boolean activate( final EntityPlayer player, final Vec3 vecFromPool ) { return false; } @@ -73,7 +73,7 @@ public class NullCableBusContainer implements ICableBusContainer } @Override - public boolean isSolidOnSide( EnumFacing side ) + public boolean isSolidOnSide( final EnumFacing side ) { return false; } @@ -85,25 +85,25 @@ public class NullCableBusContainer implements ICableBusContainer } @Override - public SelectedPart selectPart( Vec3 v3 ) + public SelectedPart selectPart( final Vec3 v3 ) { return new SelectedPart(); } @Override - public boolean recolourBlock( EnumFacing side, AEColor colour, EntityPlayer who ) + public boolean recolourBlock( final EnumFacing side, final AEColor colour, final EntityPlayer who ) { return false; } @Override - public boolean isLadder( EntityLivingBase entity ) + public boolean isLadder( final EntityLivingBase entity ) { return false; } @Override - public void randomDisplayTick( World world, BlockPos pos, Random r ) + public void randomDisplayTick( final World world, final BlockPos pos, final Random r ) { } diff --git a/src/main/java/appeng/parts/PartBasicState.java b/src/main/java/appeng/parts/PartBasicState.java index a9e1c9bc..fb1a7962 100644 --- a/src/main/java/appeng/parts/PartBasicState.java +++ b/src/main/java/appeng/parts/PartBasicState.java @@ -49,26 +49,26 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel protected int clientFlags = 0; // sent as byte. - public PartBasicState( ItemStack is ) + public PartBasicState( final ItemStack is ) { super( is ); this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL ); } @MENetworkEventSubscribe - public void chanRender( MENetworkChannelsChanged c ) + public void chanRender( final MENetworkChannelsChanged c ) { this.getHost().markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } @SideOnly( Side.CLIENT ) - public void renderLights( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderLights( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { this.setColors( renderer, ( this.clientFlags & ( POWERED_FLAG | CHANNEL_FLAG ) ) == ( POWERED_FLAG | CHANNEL_FLAG ), ( this.clientFlags & POWERED_FLAG ) == POWERED_FLAG ); rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.EAST, renderer ); @@ -77,17 +77,17 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.DOWN, renderer ); } - public void setColors( ModelGenerator renderer, boolean hasChan, boolean hasPower ) + public void setColors( final ModelGenerator renderer, final boolean hasChan, final boolean hasPower ) { if( hasChan ) { - int l = 14; + final int l = 14; renderer.setBrightness( l << 20 | l << 4 ); renderer.setColorOpaque_I( this.getColor().blackVariant ); } else if( hasPower ) { - int l = 9; + final int l = 9; renderer.setBrightness( l << 20 | l << 4 ); renderer.setColorOpaque_I( this.getColor().whiteVariant ); } @@ -99,7 +99,7 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { super.writeToStream( data ); @@ -119,7 +119,7 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel this.clientFlags = this.populateFlags( this.clientFlags ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // meh } @@ -127,17 +127,17 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel data.writeByte( (byte) this.clientFlags ); } - protected int populateFlags( int cf ) + protected int populateFlags( final int cf ) { return cf; } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { - boolean eh = super.readFromStream( data ); + final boolean eh = super.readFromStream( data ); - int old = this.clientFlags; + final int old = this.clientFlags; this.clientFlags = data.readByte(); return eh || old != this.clientFlags; @@ -145,7 +145,7 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel @Override @SideOnly( Side.CLIENT ) - public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer ) + public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer ) { return CableBusTextures.PartTransitionPlaneBack.getIcon().getAtlas(); } diff --git a/src/main/java/appeng/parts/PartPlacement.java b/src/main/java/appeng/parts/PartPlacement.java index 7b970343..46275d09 100644 --- a/src/main/java/appeng/parts/PartPlacement.java +++ b/src/main/java/appeng/parts/PartPlacement.java @@ -72,7 +72,7 @@ public class PartPlacement private final ThreadLocal placing = new ThreadLocal(); private boolean wasCanceled = false; - public static boolean place( ItemStack held, BlockPos pos, EnumFacing side, EntityPlayer player, World world, PlaceType pass, int depth ) + public static boolean place( final ItemStack held, final BlockPos pos, EnumFacing side, final EntityPlayer player, final World world, PlaceType pass, final int depth ) { if( depth > 3 ) { @@ -86,8 +86,8 @@ public class PartPlacement return false; } - Block block = world.getBlockState( pos ).getBlock(); - TileEntity tile = world.getTileEntity( pos ); + final Block block = world.getBlockState( pos ).getBlock(); + final TileEntity tile = world.getTileEntity( pos ); IPartHost host = null; if( tile instanceof IPartHost ) @@ -99,12 +99,12 @@ public class PartPlacement { if( !world.isRemote ) { - LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); - MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b ); + final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); + final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b ); if( mop != null ) { - List is = new LinkedList(); - SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) ); + final List is = new LinkedList(); + final SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) ); if( sp.part != null ) { @@ -152,7 +152,7 @@ public class PartPlacement if( held != null ) { - IFacadePart fp = isFacade( held, AEPartLocation.fromFacing( side ) ); + final IFacadePart fp = isFacade( held, AEPartLocation.fromFacing( side ) ); if( fp != null ) { if( host != null ) @@ -210,15 +210,15 @@ public class PartPlacement // if ( held == null ) { - Block block = world.getBlockState( pos ).getBlock(); + final Block block = world.getBlockState( pos ).getBlock(); if( host != null && player.isSneaking() && block != null ) { - LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); - MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b ); + final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); + final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b ); if( mop != null ) { mop.hitVec = mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ); - SelectedPart sPart = selectPart( player, host, mop.hitVec ); + final SelectedPart sPart = selectPart( player, host, mop.hitVec ); if( sPart != null && sPart.part != null ) { if( sPart.part.onShiftActivate( player, mop.hitVec ) ) @@ -246,7 +246,7 @@ public class PartPlacement { EnumFacing offset = null; - Block blkID = world.getBlockState( pos ).getBlock(); + final Block blkID = world.getBlockState( pos ).getBlock(); if( blkID != null && !blkID.isReplaceable( world, pos ) ) { offset = side; @@ -324,7 +324,7 @@ public class PartPlacement { te_pos = pos.offset( side ); - Block blkID = world.getBlockState( te_pos ).getBlock(); + final Block blkID = world.getBlockState( te_pos ).getBlock(); tile = world.getTileEntity( te_pos ); if( tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) ) @@ -342,12 +342,12 @@ public class PartPlacement if( !world.isRemote ) { - Block block = world.getBlockState( pos ).getBlock(); - LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); - MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b ); + final Block block = world.getBlockState( pos ).getBlock(); + final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) ); + final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b ); if( mop != null ) { - SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) ); + final SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) ); if( sp.part != null ) { @@ -358,16 +358,16 @@ public class PartPlacement } } - DimensionalCoord dc = host.getLocation(); + final DimensionalCoord dc = host.getLocation(); if( !Platform.hasPermissions( dc, player ) ) { return false; } - AEPartLocation mySide = host.addPart( held, AEPartLocation.fromFacing( side ), player ); + final AEPartLocation mySide = host.addPart( held, AEPartLocation.fromFacing( side ), player ); if( mySide != null ) { - for( Block multiPartBlock : multiPart.maybeBlock().asSet() ) + for( final Block multiPartBlock : multiPart.maybeBlock().asSet() ) { final SoundType ss = multiPartBlock.stepSound; @@ -393,7 +393,7 @@ public class PartPlacement return true; } - private static float getEyeOffset( EntityPlayer p ) + private static float getEyeOffset( final EntityPlayer p ) { if( p.worldObj.isRemote ) { @@ -403,16 +403,16 @@ public class PartPlacement return eyeHeight; } - private static SelectedPart selectPart( EntityPlayer player, IPartHost host, Vec3 pos ) + private static SelectedPart selectPart( final EntityPlayer player, final IPartHost host, final Vec3 pos ) { CommonHelper.proxy.updateRenderMode( player ); - SelectedPart sp = host.selectPart( pos ); + final SelectedPart sp = host.selectPart( pos ); CommonHelper.proxy.updateRenderMode( null ); return sp; } - public static IFacadePart isFacade( ItemStack held, AEPartLocation side ) + public static IFacadePart isFacade( final ItemStack held, final AEPartLocation side ) { if( held.getItem() instanceof IFacadeItem ) { @@ -421,7 +421,7 @@ public class PartPlacement if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) { - IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); if( bc.isFacade( held ) ) { return bc.createFacadePart( held, side ); @@ -432,28 +432,28 @@ public class PartPlacement } @SubscribeEvent - public void playerInteract( TickEvent.ClientTickEvent event ) + public void playerInteract( final TickEvent.ClientTickEvent event ) { this.wasCanceled = false; } @SubscribeEvent - public void playerInteract( PlayerInteractEvent event ) + public void playerInteract( final PlayerInteractEvent event ) { if( event.action == Action.RIGHT_CLICK_AIR && event.entityPlayer.worldObj.isRemote ) { // re-check to see if this event was already channeled, cause these two events are really stupid... - MovingObjectPosition mop = Platform.rayTrace( event.entityPlayer, true, false ); - Minecraft mc = Minecraft.getMinecraft(); + final MovingObjectPosition mop = Platform.rayTrace( event.entityPlayer, true, false ); + final Minecraft mc = Minecraft.getMinecraft(); - float f = 1.0F; - double d0 = mc.playerController.getBlockReachDistance(); - Vec3 vec3 = mc.getRenderViewEntity().getPositionEyes( f ); + final float f = 1.0F; + final double d0 = mc.playerController.getBlockReachDistance(); + final Vec3 vec3 = mc.getRenderViewEntity().getPositionEyes( f ); if( mop != null && mop.hitVec.distanceTo( vec3 ) < d0 ) { - World w = event.entity.worldObj; - TileEntity te = w.getTileEntity( mop.getBlockPos() ); + final World w = event.entity.worldObj; + final TileEntity te = w.getTileEntity( mop.getBlockPos() ); if( te instanceof IPartHost && this.wasCanceled ) { event.setCanceled( true ); @@ -461,7 +461,7 @@ public class PartPlacement } else { - ItemStack held = event.entityPlayer.getHeldItem(); + final ItemStack held = event.entityPlayer.getHeldItem(); final IItems items = AEApi.instance().definitions().items(); boolean supportedItem = items.memoryCard().isSameAs( held ); @@ -482,7 +482,7 @@ public class PartPlacement this.placing.set( event ); - ItemStack held = event.entityPlayer.getHeldItem(); + final ItemStack held = event.entityPlayer.getHeldItem(); if( place( held, event.pos, event.face, event.entityPlayer, event.entityPlayer.worldObj, PlaceType.INTERACT_FIRST_PASS, 0 ) ) { event.setCanceled( true ); diff --git a/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java b/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java index 62151f33..95518c85 100644 --- a/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java @@ -13,18 +13,18 @@ public class BlockUpgradeInventory extends UpgradeInventory { private final Block block; - public BlockUpgradeInventory( Block block, IAEAppEngInventory parent, int s ) + public BlockUpgradeInventory( final Block block, final IAEAppEngInventory parent, final int s ) { super( parent, s ); this.block = block; } @Override - public int getMaxInstalled( Upgrades upgrades ) + public int getMaxInstalled( final Upgrades upgrades ) { int max = 0; - for( ItemStack is : upgrades.getSupported().keySet() ) + for( final ItemStack is : upgrades.getSupported().keySet() ) { final Item encodedItem = is.getItem(); diff --git a/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java b/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java index 64cbd57a..ab62b7cc 100644 --- a/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java @@ -11,7 +11,7 @@ public final class DefinitionUpgradeInventory extends UpgradeInventory { private final IItemDefinition definition; - public DefinitionUpgradeInventory( IItemDefinition definition, IAEAppEngInventory parent, int s ) + public DefinitionUpgradeInventory( final IItemDefinition definition, final IAEAppEngInventory parent, final int s ) { super( parent, s ); @@ -19,11 +19,11 @@ public final class DefinitionUpgradeInventory extends UpgradeInventory } @Override - public int getMaxInstalled( Upgrades upgrades ) + public int getMaxInstalled( final Upgrades upgrades ) { int max = 0; - for( ItemStack stack : upgrades.getSupported().keySet() ) + for( final ItemStack stack : upgrades.getSupported().keySet() ) { if( this.definition.isSameAs( stack ) ) { diff --git a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java index a41bd2de..c3362d30 100644 --- a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java +++ b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java @@ -82,20 +82,20 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab private boolean isAccepting = true; private boolean breaking = false; - public PartAnnihilationPlane( ItemStack is ) + public PartAnnihilationPlane( final ItemStack is ) { super( is ); } @Override - public TickRateModulation call( World world ) throws Exception + public TickRateModulation call( final World world ) throws Exception { this.breaking = false; return this.breakBlock( true ); } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { int minX = 1; int minY = 1; @@ -107,7 +107,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab { final TileEntity te = host.getTile(); - BlockPos pos = te.getPos(); + final BlockPos pos = te.getPos(); final EnumFacing e = bch.getWorldX(); final EnumFacing u = bch.getWorldY(); @@ -139,7 +139,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( SIDE_ICON, SIDE_ICON, BACK_ICON, renderer.getIcon( is ), SIDE_ICON, SIDE_ICON ); @@ -152,12 +152,12 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { this.renderStaticWithIcon( pos, rh, renderer, ACTIVE_ICON ); } - protected void renderStaticWithIcon( BlockPos opos, IPartRenderHelper rh, ModelGenerator renderer, IAESprite activeIcon ) + protected void renderStaticWithIcon( final BlockPos opos, final IPartRenderHelper rh, final ModelGenerator renderer, final IAESprite activeIcon ) { int minX = 1; @@ -165,7 +165,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab final EnumFacing u = rh.getWorldY(); final TileEntity te = this.getHost().getTile(); - BlockPos pos = te.getPos(); + final BlockPos pos = te.getPos(); if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) ) { @@ -220,12 +220,12 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab } @Override - public void onEntityCollision( Entity entity ) + public void onEntityCollision( final Entity entity ) { if( this.isAccepting && entity instanceof EntityItem && !entity.isDead && Platform.isServer() && this.proxy.isActive() ) { boolean capture = false; - BlockPos pos = tile.getPos(); + final BlockPos pos = tile.getPos(); switch( this.side ) { @@ -296,7 +296,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * * @param entityItem {@link EntityItem} to store */ - private boolean storeEntityItem( EntityItem entityItem ) + private boolean storeEntityItem( final EntityItem entityItem ) { if( !entityItem.isDead ) { @@ -314,7 +314,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * @param item {@link ItemStack} to store * @return the leftover items, which could not be stored inside the network */ - private IAEItemStack storeItemStack( ItemStack item ) + private IAEItemStack storeItemStack( final ItemStack item ) { final IAEItemStack itemToStore = AEItemStack.create( item ); try @@ -344,7 +344,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * @param overflow the leftover {@link IAEItemStack} * @return true, if the entity was changed otherwise false. */ - private boolean handleOverflow( EntityItem entityItem, IAEItemStack overflow ) + private boolean handleOverflow( final EntityItem entityItem, final IAEItemStack overflow ) { if( overflow == null || overflow.getStackSize() == 0 ) { @@ -366,7 +366,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * * @param overflow the item to spawn */ - private void spawnOverflow( IAEItemStack overflow ) + private void spawnOverflow( final IAEItemStack overflow ) { if( overflow == null ) { @@ -389,7 +389,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab w.spawnEntityInWorld( overflowEntity ); } - protected boolean isAnnihilationPlane( TileEntity blockTileEntity, AEPartLocation side ) + protected boolean isAnnihilationPlane( final TileEntity blockTileEntity, final AEPartLocation side ) { if( blockTileEntity instanceof IPartHost ) { @@ -401,7 +401,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override @MENetworkEventSubscribe - public void chanRender( MENetworkChannelsChanged c ) + public void chanRender( final MENetworkChannelsChanged c ) { this.onNeighborChanged(); this.getHost().markForUpdate(); @@ -409,13 +409,13 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab @Override @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.onNeighborChanged(); this.getHost().markForUpdate(); } - public TickRateModulation breakBlock( boolean modulate ) + public TickRateModulation breakBlock( final boolean modulate ) { if( this.isAccepting && this.proxy.isActive() ) { @@ -424,7 +424,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab final TileEntity te = this.getTile(); final WorldServer w = (WorldServer) te.getWorld(); - BlockPos pos = te.getPos().offset( side.getFacing() ); + final BlockPos pos = te.getPos().offset( side.getFacing() ); final IEnergyGrid energy = this.proxy.getEnergy(); @@ -464,13 +464,13 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.AnnihilationPlane.min, TickRates.AnnihilationPlane.max, false, true ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( this.breaking ) { @@ -484,7 +484,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab /** * Checks if this plane can handle the block at the specific coordinates. */ - protected boolean canHandleBlock( WorldServer w, BlockPos pos ) + protected boolean canHandleBlock( final WorldServer w, final BlockPos pos ) { final Block block = w.getBlockState( pos ).getBlock(); final Material material = block.getMaterial(); @@ -495,7 +495,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab return !ignoreMaterials && !ignoreBlocks && !w.isAirBlock( pos ) && w.isBlockLoaded( pos ) && w.canMineBlockBody( Platform.getPlayer( w ), pos ) && hardness >= 0f; } - protected List obtainBlockDrops( WorldServer w, BlockPos pos ) + protected List obtainBlockDrops( final WorldServer w, final BlockPos pos ) { final ItemStack[] out = Platform.getBlockDrops( w, pos ); return Lists.newArrayList( out ); @@ -504,7 +504,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab /** * Checks if this plane can handle the block at the specific coordinates. */ - protected float calculateEnergyUsage( WorldServer w, BlockPos pos, List items ) + protected float calculateEnergyUsage( final WorldServer w, final BlockPos pos, final List items ) { final Block block = w.getBlockState( pos ).getBlock(); final float hardness = block.getBlockHardness( w, pos ); @@ -527,7 +527,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab * * @return true, if the network can store at least a single item of all drops or no drops are reported */ - protected boolean canStoreItemStacks( List itemStacks ) + protected boolean canStoreItemStacks( final List itemStacks ) { boolean canStore = itemStacks.isEmpty(); @@ -554,7 +554,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab return canStore; } - protected void breakBlockAndStoreItems( WorldServer w, BlockPos pos, List items ) + protected void breakBlockAndStoreItems( final WorldServer w, final BlockPos pos, final List items ) { w.setBlockToAir( pos ); diff --git a/src/main/java/appeng/parts/automation/PartExportBus.java b/src/main/java/appeng/parts/automation/PartExportBus.java index 6e713ed0..1c94bf18 100644 --- a/src/main/java/appeng/parts/automation/PartExportBus.java +++ b/src/main/java/appeng/parts/automation/PartExportBus.java @@ -73,7 +73,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest private int nextSlot = 0; @Reflected - public PartExportBus( ItemStack is ) + public PartExportBus( final ItemStack is ) { super( is ); @@ -85,7 +85,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { super.readFromNBT( extra ); this.craftingTracker.readFromNBT( extra ); @@ -93,7 +93,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { super.writeToNBT( extra ); this.craftingTracker.writeToNBT( extra ); @@ -126,7 +126,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest for( x = 0; x < this.availableSlots() && this.itemToSend > 0; x++ ) { - int slotToExport = this.getStartingSlot( schedulingMode, x ); + final int slotToExport = this.getStartingSlot( schedulingMode, x ); final IAEItemStack ais = this.config.getAEStackInSlot( slotToExport ); @@ -143,7 +143,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) { - for( IAEItemStack o : ImmutableList.copyOf( inv.getStorageList().findFuzzy( ais, fzMode ) ) ) + for( final IAEItemStack o : ImmutableList.copyOf( inv.getStorageList().findFuzzy( ais, fzMode ) ) ) { this.pushItemIntoTarget( destination, energy, inv, o ); if( this.itemToSend <= 0 ) @@ -170,7 +170,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest return TickRateModulation.SLEEP; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -186,7 +186,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 4, 4, 12, 12, 12, 14 ); bch.addBox( 5, 5, 14, 11, 11, 15 ); @@ -196,7 +196,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() ); @@ -212,7 +212,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() ); @@ -240,7 +240,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -257,7 +257,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.ExportBus.min, TickRates.ExportBus.max, this.isSleeping(), false ); } @@ -269,7 +269,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.doBusWork(); } @@ -281,7 +281,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode ) + public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack items, final Actionable mode ) { final InventoryAdaptor d = this.getHandler(); @@ -302,7 +302,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { AELog.error( e ); } @@ -311,7 +311,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } @Override - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { this.craftingTracker.jobStateChange( link ); } @@ -332,19 +332,19 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest return this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0; } - private void pushItemIntoTarget( InventoryAdaptor d, IEnergyGrid energy, IMEInventory inv, IAEItemStack ais ) + private void pushItemIntoTarget( final InventoryAdaptor d, final IEnergyGrid energy, final IMEInventory inv, IAEItemStack ais ) { final ItemStack is = ais.getItemStack(); is.stackSize = (int) this.itemToSend; final ItemStack o = d.simulateAdd( is ); - long canFit = o == null ? this.itemToSend : this.itemToSend - o.stackSize; + final long canFit = o == null ? this.itemToSend : this.itemToSend - o.stackSize; if( canFit > 0 ) { ais = ais.copy(); ais.setStackSize( canFit ); - IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc ); + final IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc ); if( itemsToAdd != null ) { @@ -364,7 +364,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } } - private int getStartingSlot( SchedulingMode schedulingMode, int x ) + private int getStartingSlot( final SchedulingMode schedulingMode, final int x ) { if( schedulingMode == SchedulingMode.RANDOM ) { @@ -379,7 +379,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest return x; } - private void updateSchedulingMode( SchedulingMode schedulingMode, int x ) + private void updateSchedulingMode( final SchedulingMode schedulingMode, final int x ) { if( schedulingMode == SchedulingMode.ROUNDROBIN ) { @@ -387,7 +387,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest } } - private TickRateModulation getFailedCraftingPenalty( int failedAttempts ) + private TickRateModulation getFailedCraftingPenalty( final int failedAttempts ) { if( failedAttempts > 5 ) { diff --git a/src/main/java/appeng/parts/automation/PartFormationPlane.java b/src/main/java/appeng/parts/automation/PartFormationPlane.java index 0b087bae..0ef492e1 100644 --- a/src/main/java/appeng/parts/automation/PartFormationPlane.java +++ b/src/main/java/appeng/parts/automation/PartFormationPlane.java @@ -92,7 +92,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine boolean wasActive = false; boolean blocked = false; - public PartFormationPlane( ItemStack is ) + public PartFormationPlane( final ItemStack is ) { super( is ); @@ -107,12 +107,12 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine this.myHandler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST ); this.myHandler.setPriority( this.priority ); - IItemList priorityList = AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); - int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; + final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; for( int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++ ) { - IAEItemStack is = this.Config.getAEStackInSlot( x ); + final IAEItemStack is = this.Config.getAEStackInSlot( x ); if( is != null ) { priorityList.add( is ); @@ -132,7 +132,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine { this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -145,14 +145,14 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.updateHandler(); this.host.markForSave(); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { super.onChangeInventory( inv, slot, mc, removedStack, newStack ); @@ -169,7 +169,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.Config.readFromNBT( data, "config" ); @@ -178,7 +178,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.Config.writeToNBT( data, "config" ); @@ -186,7 +186,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -198,9 +198,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { - boolean currentActive = this.proxy.isActive(); + final boolean currentActive = this.proxy.isActive(); if( this.wasActive != currentActive ) { this.wasActive = currentActive; @@ -210,9 +210,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @MENetworkEventSubscribe - public void updateChannels( MENetworkChannelsChanged changedChannels ) + public void updateChannels( final MENetworkChannelsChanged changedChannels ) { - boolean currentActive = this.proxy.isActive(); + final boolean currentActive = this.proxy.isActive(); if( this.wasActive != currentActive ) { this.wasActive = currentActive; @@ -222,22 +222,22 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { int minX = 1; int minY = 1; int maxX = 15; int maxY = 15; - IPartHost host = this.getHost(); + final IPartHost host = this.getHost(); if( host != null ) { - TileEntity te = host.getTile(); + final TileEntity te = host.getTile(); - BlockPos pos = te.getPos(); + final BlockPos pos = te.getPos(); - EnumFacing e = bch.getWorldX(); - EnumFacing u = bch.getWorldY(); + final EnumFacing e = bch.getWorldX(); + final EnumFacing u = bch.getWorldY(); if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) ) { @@ -266,7 +266,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() ); @@ -279,15 +279,15 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos opos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos opos, final IPartRenderHelper rh, final ModelGenerator renderer ) { int minX = 1; - EnumFacing e = rh.getWorldX(); - EnumFacing u = rh.getWorldY(); + final EnumFacing e = rh.getWorldX(); + final EnumFacing u = rh.getWorldY(); - TileEntity te = this.getHost().getTile(); - BlockPos pos = te.getPos(); + final TileEntity te = this.getHost().getTile(); + final BlockPos pos = te.getPos(); if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) ) { @@ -312,7 +312,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine maxY = 16; } - boolean isActive = ( this.clientFlags & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ); + final boolean isActive = ( this.clientFlags & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ); rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : renderer.getIcon( is ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() ); @@ -330,11 +330,11 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override public void onNeighborChanged() { - TileEntity te = this.host.getTile(); - World w = te.getWorld(); - AEPartLocation side = this.side; + final TileEntity te = this.host.getTile(); + final World w = te.getWorld(); + final AEPartLocation side = this.side; - BlockPos tePos = te.getPos().offset( side.getFacing() ); + final BlockPos tePos = te.getPos().offset( side.getFacing() ); this.blocked = !w.getBlockState( tePos ).getBlock().isReplaceable( w, tePos ); } @@ -346,7 +346,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -362,22 +362,22 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine return false; } - private boolean isTransitionPlane( TileEntity blockTileEntity, AEPartLocation side ) + private boolean isTransitionPlane( final TileEntity blockTileEntity, final AEPartLocation side ) { if( blockTileEntity instanceof IPartHost ) { - IPart p = ( (IPartHost) blockTileEntity ).getPart( side ); + final IPart p = ( (IPartHost) blockTileEntity ).getPart( side ); return p instanceof PartFormationPlane; } return false; } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { if( this.proxy.isActive() && channel == StorageChannel.ITEMS ) { - List Handler = new ArrayList( 1 ); + final List Handler = new ArrayList( 1 ); Handler.add( this.myHandler ); return Handler; } @@ -391,7 +391,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; this.host.markForSave(); @@ -399,38 +399,38 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void blinkCell( int slot ) + public void blinkCell( final int slot ) { // :P } @Override - public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) + public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src ) { if( this.blocked || input == null || input.getStackSize() <= 0 ) { return input; } - YesNo placeBlock = (YesNo) this.getConfigManager().getSetting( Settings.PLACE_BLOCK ); + final YesNo placeBlock = (YesNo) this.getConfigManager().getSetting( Settings.PLACE_BLOCK ); - ItemStack is = input.getItemStack(); - Item i = is.getItem(); + final ItemStack is = input.getItemStack(); + final Item i = is.getItem(); long maxStorage = Math.min( input.getStackSize(), is.getMaxStackSize() ); boolean worked = false; - TileEntity te = this.host.getTile(); - World w = te.getWorld(); - AEPartLocation side = this.side; + final TileEntity te = this.host.getTile(); + final World w = te.getWorld(); + final AEPartLocation side = this.side; - BlockPos tePos = te.getPos().offset( side.getFacing() ); + final BlockPos tePos = te.getPos().offset( side.getFacing() ); if( w.getBlockState( tePos ).getBlock().isReplaceable( w, tePos ) ) { if( placeBlock == YesNo.YES && ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem || i instanceof ItemReed ) ) { - EntityPlayer player = Platform.getPlayer( (WorldServer) w ); + final EntityPlayer player = Platform.getPlayer( (WorldServer) w ); Platform.configurePlayer( player, side, this.tile ); // TODO: LIMIT FIREWORKS @@ -494,9 +494,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine else { worked = true; - Chunk c = w.getChunkFromBlockCoords( tePos ); + final Chunk c = w.getChunkFromBlockCoords( tePos ); - int sum = 0; + final int sum = 0; // TODO: LIMIT OTHER THIGNS! /* @@ -512,7 +512,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine { is.stackSize = (int) maxStorage; - EntityItem ei = new EntityItem( w, // w + final EntityItem ei = new EntityItem( w, // w ( ( side.xOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.xOffset * -0.3 + tePos.getX(), // spawn ( ( side.yOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.yOffset * -0.3 + tePos.getY(), // spawn ( ( side.zOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.zOffset * -0.3 + tePos.getZ(), // spawn @@ -555,7 +555,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine if( worked ) { - IAEItemStack out = input.copy(); + final IAEItemStack out = input.copy(); out.decStackSize( maxStorage ); if( out.getStackSize() == 0 ) { @@ -568,13 +568,13 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) + public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems( IItemList out ) + public IItemList getAvailableItems( final IItemList out ) { return out; } @@ -586,7 +586,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void saveChanges( IMEInventory cellInventory ) + public void saveChanges( final IMEInventory cellInventory ) { // nope! } diff --git a/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java b/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java index 45d031fe..66dbaf1a 100644 --- a/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java +++ b/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java @@ -47,20 +47,20 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane private static final float SILK_TOUCH_FACTOR = 16; - public PartIdentityAnnihilationPlane( ItemStack is ) + public PartIdentityAnnihilationPlane( final ItemStack is ) { super( is ); } @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { this.renderStaticWithIcon( pos, rh, renderer, ACTIVE_ICON ); } @Override - protected boolean isAnnihilationPlane( TileEntity blockTileEntity, AEPartLocation side ) + protected boolean isAnnihilationPlane( final TileEntity blockTileEntity, final AEPartLocation side ) { if( blockTileEntity instanceof IPartHost ) { @@ -71,7 +71,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane } @Override - protected float calculateEnergyUsage( WorldServer w, BlockPos pos, List items ) + protected float calculateEnergyUsage( final WorldServer w, final BlockPos pos, final List items ) { final float requiredEnergy = super.calculateEnergyUsage( w, pos, items ); @@ -79,7 +79,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane } @Override - protected List obtainBlockDrops( WorldServer w, BlockPos pos ) + protected List obtainBlockDrops( final WorldServer w, final BlockPos pos ) { final FakePlayer fakePlayer = FakePlayerFactory.getMinecraft( w ); final IBlockState state = w.getBlockState( pos ); @@ -96,7 +96,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane { meta = state.getBlock().getMetaFromState( state ); } - ItemStack itemstack = new ItemStack( item, 1, meta ); + final ItemStack itemstack = new ItemStack( item, 1, meta ); out.add( itemstack ); } return out; diff --git a/src/main/java/appeng/parts/automation/PartImportBus.java b/src/main/java/appeng/parts/automation/PartImportBus.java index 375c5552..6c719ec6 100644 --- a/src/main/java/appeng/parts/automation/PartImportBus.java +++ b/src/main/java/appeng/parts/automation/PartImportBus.java @@ -65,7 +65,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin private boolean worked; // used in tickingRequest @Reflected - public PartImportBus( ItemStack is ) + public PartImportBus( final ItemStack is ) { super( is ); @@ -75,7 +75,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { if( stack == null || stack.getItem() == null ) { @@ -91,7 +91,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 6, 6, 11, 10, 10, 13 ); bch.addBox( 5, 5, 13, 11, 11, 14 ); @@ -100,7 +100,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() ); @@ -116,7 +116,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() ); @@ -143,7 +143,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -160,13 +160,13 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.ImportBus.min, TickRates.ImportBus.max, this.getHandler() == null, false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.doBusWork(); } @@ -222,7 +222,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :3 } @@ -235,7 +235,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin return this.worked ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } - private boolean importStuff( InventoryAdaptor myAdaptor, IAEItemStack whatToImport, IMEMonitor inv, IEnergySource energy, FuzzyMode fzMode ) + private boolean importStuff( final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, final IMEMonitor inv, final IEnergySource energy, final FuzzyMode fzMode ) { final int toSend = this.calculateMaximumAmountToImport( myAdaptor, whatToImport, inv, fzMode ); final ItemStack newItems; @@ -283,7 +283,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin return false; } - private int calculateMaximumAmountToImport( InventoryAdaptor myAdaptor, IAEItemStack whatToImport, IMEMonitor inv, FuzzyMode fzMode ) + private int calculateMaximumAmountToImport( final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, final IMEMonitor inv, final FuzzyMode fzMode ) { final int toSend = Math.min( this.itemToSend, 64 ); final ItemStack itemStackToImport; @@ -318,7 +318,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin return toSend; } - private IInventoryDestination configDestination( IMEMonitor itemInventory ) + private IInventoryDestination configDestination( final IMEMonitor itemInventory ) { this.destination = itemInventory; return this; diff --git a/src/main/java/appeng/parts/automation/PartLevelEmitter.java b/src/main/java/appeng/parts/automation/PartLevelEmitter.java index 5f00442c..1c6ac91a 100644 --- a/src/main/java/appeng/parts/automation/PartLevelEmitter.java +++ b/src/main/java/appeng/parts/automation/PartLevelEmitter.java @@ -102,7 +102,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH boolean status = false; @Reflected - public PartLevelEmitter( ItemStack is ) + public PartLevelEmitter( final ItemStack is ) { super( is ); @@ -117,7 +117,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH return this.reportingValue; } - public void setReportingValue( long v ) + public void setReportingValue( final long v ) { this.reportingValue = v; if( this.getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL ) @@ -131,18 +131,18 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @MENetworkEventSubscribe - public void powerChanged( MENetworkPowerStatusChange c ) + public void powerChanged( final MENetworkPowerStatusChange c ) { this.updateState(); } private void updateState() { - boolean isOn = this.isLevelEmitterOn(); + final boolean isOn = this.isLevelEmitterOn(); if( this.prevState != isOn ) { this.host.markForUpdate(); - TileEntity te = this.host.getTile(); + final TileEntity te = this.host.getTile(); this.prevState = isOn; Platform.notifyBlocksOfNeighbors( te.getWorld(), te.getPos() ); Platform.notifyBlocksOfNeighbors( te.getWorld(), te.getPos().offset( side.getFacing() ) ); @@ -167,7 +167,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { return this.proxy.getCrafting().isRequesting( this.config.getAEStackInSlot( 0 ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -175,37 +175,37 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH return this.prevState; } - boolean flipState = this.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL; + final boolean flipState = this.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL; return flipState ? this.reportingValue >= this.lastReportedValue + 1 : this.reportingValue < this.lastReportedValue + 1; } @MENetworkEventSubscribe - public void channelChanged( MENetworkChannelsChanged c ) + public void channelChanged( final MENetworkChannelsChanged c ) { this.updateState(); } @Override - protected int populateFlags( int cf ) + protected int populateFlags( final int cf ) { return cf | ( this.prevState ? FLAG_ON : 0 ); } @Override - public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer ) + public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer ) { return renderer.getIcon( is ).getAtlas(); } @Override - public void updateWatcher( ICraftingWatcher newWatcher ) + public void updateWatcher( final ICraftingWatcher newWatcher ) { this.myCraftingWatcher = newWatcher; this.configureWatchers(); } @Override - public void onRequestChange( ICraftingGrid craftingGrid, IAEItemStack what ) + public void onRequestChange( final ICraftingGrid craftingGrid, final IAEItemStack what ) { this.updateState(); } @@ -213,7 +213,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH // update the system... public void configureWatchers() { - IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); + final IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); if( this.myWatcher != null ) { @@ -234,7 +234,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { this.proxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.proxy.getNode() ) ); } - catch( GridAccessException e1 ) + catch( final GridAccessException e1 ) { // :/ } @@ -265,7 +265,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH // no more item stuff.. this.proxy.getStorage().getItemInventory().removeListener( this ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -291,20 +291,20 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH this.updateReportingValue( this.proxy.getStorage().getItemInventory() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // >.> } } - private void updateReportingValue( IMEMonitor monitor ) + private void updateReportingValue( final IMEMonitor monitor ) { - IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); + final IAEItemStack myStack = this.config.getAEStackInSlot( 0 ); if( myStack == null ) { this.lastReportedValue = 0; - for( IAEItemStack st : monitor.getStorageList() ) + for( final IAEItemStack st : monitor.getStorageList() ) { this.lastReportedValue += st.getStackSize(); } @@ -312,16 +312,16 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH else if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) { this.lastReportedValue = 0; - FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ); - Collection fuzzyList = monitor.getStorageList().findFuzzy( myStack, fzMode ); - for( IAEItemStack st : fuzzyList ) + final FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ); + final Collection fuzzyList = monitor.getStorageList().findFuzzy( myStack, fzMode ); + for( final IAEItemStack st : fuzzyList ) { this.lastReportedValue += st.getStackSize(); } } else { - IAEItemStack r = monitor.getStorageList().findPrecise( myStack ); + final IAEItemStack r = monitor.getStorageList().findPrecise( myStack ); if( r == null ) { this.lastReportedValue = 0; @@ -336,14 +336,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void updateWatcher( IStackWatcher newWatcher ) + public void updateWatcher( final IStackWatcher newWatcher ) { this.myWatcher = newWatcher; this.configureWatchers(); } @Override - public void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan ) + public void onStackChange( final IItemList o, final IAEStack fullStack, final IAEStack diffStack, final BaseActionSource src, final StorageChannel chan ) { if( chan == StorageChannel.ITEMS && fullStack.equals( this.config.getAEStackInSlot( 0 ) ) && this.getInstalledUpgrades( Upgrades.FUZZY ) == 0 ) { @@ -353,34 +353,34 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void updateWatcher( IEnergyWatcher newWatcher ) + public void updateWatcher( final IEnergyWatcher newWatcher ) { this.myEnergyWatcher = newWatcher; this.configureWatchers(); } @Override - public void onThresholdPass( IEnergyGrid energyGrid ) + public void onThresholdPass( final IEnergyGrid energyGrid ) { this.lastReportedValue = (long) energyGrid.getStoredPower(); this.updateState(); } @Override - public boolean isValid( Object effectiveGrid ) + public boolean isValid( final Object effectiveGrid ) { try { return this.proxy.getGrid() == effectiveGrid; } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return false; } } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource actionSource ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource actionSource ) { this.updateReportingValue( (IMEMonitor) monitor ); } @@ -392,37 +392,37 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH { this.updateReportingValue( this.proxy.getStorage().getItemInventory() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // ;P } } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.SMART; } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 7, 7, 11, 9, 9, 16 ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( renderer.getIcon( is ) ); this.renderTorchAtAngle( 0, -0.5, 0, renderer ); } - public void renderTorchAtAngle( double baseX, double baseY, double baseZ, ModelGenerator renderer ) + public void renderTorchAtAngle( double baseX, double baseY, double baseZ, final ModelGenerator renderer ) { - boolean isOn = this.isLevelEmitterOn(); - IAESprite offTexture = renderer.getIcon( is ); - IAESprite IIcon = ( isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture ); + final boolean isOn = this.isLevelEmitterOn(); + final IAESprite offTexture = renderer.getIcon( is ); + final IAESprite IIcon = ( isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture ); // this.centerX = baseX + 0.5; this.centerY = baseY + 0.5; @@ -441,35 +441,35 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH * (double)TextureAtlasSprite.func_94214_a(9.0D); double d16 = (double)TextureAtlasSprite.func_94207_b(15.0D); */ - float var16 = IIcon.getMinU(); - float var17 = IIcon.getMaxU(); - float var18 = IIcon.getMinV(); - float var19 = IIcon.getMaxV(); + final float var16 = IIcon.getMinU(); + final float var17 = IIcon.getMaxU(); + final float var18 = IIcon.getMinV(); + final float var19 = IIcon.getMaxV(); /* * float var16 = (float)var14 / 256.0F; float var17 = ((float)var14 + 15.99F) / 256.0F; float var18 = * (float)var15 / 256.0F; float var19 = ((float)var15 + 15.99F) / 256.0F; */ - double var20b = offTexture.getInterpolatedU( 7.0D ); - double var24b = offTexture.getInterpolatedU( 9.0D ); + final double var20b = offTexture.getInterpolatedU( 7.0D ); + final double var24b = offTexture.getInterpolatedU( 9.0D ); - double var20 = IIcon.getInterpolatedU( 7.0D ); - double var24 = IIcon.getInterpolatedU( 9.0D ); - double var22 = IIcon.getInterpolatedV( 6.0D + ( isOn ? 0 : 1.0D ) ); - double var26 = IIcon.getInterpolatedV( 8.0D + ( isOn ? 0 : 1.0D ) ); - double var28 = IIcon.getInterpolatedU( 7.0D ); - double var30 = IIcon.getInterpolatedV( 13.0D ); - double var32 = IIcon.getInterpolatedU( 9.0D ); - double var34 = IIcon.getInterpolatedV( 15.0D ); + final double var20 = IIcon.getInterpolatedU( 7.0D ); + final double var24 = IIcon.getInterpolatedU( 9.0D ); + final double var22 = IIcon.getInterpolatedV( 6.0D + ( isOn ? 0 : 1.0D ) ); + final double var26 = IIcon.getInterpolatedV( 8.0D + ( isOn ? 0 : 1.0D ) ); + final double var28 = IIcon.getInterpolatedU( 7.0D ); + final double var30 = IIcon.getInterpolatedV( 13.0D ); + final double var32 = IIcon.getInterpolatedU( 9.0D ); + final double var34 = IIcon.getInterpolatedV( 15.0D ); - double var22b = IIcon.getInterpolatedV( 9.0D ); - double var26b = IIcon.getInterpolatedV( 11.0D ); + final double var22b = IIcon.getInterpolatedV( 9.0D ); + final double var26b = IIcon.getInterpolatedV( 11.0D ); baseX += 0.5D; baseZ += 0.5D; - double var36 = baseX - 0.5D; - double var38 = baseX + 0.5D; - double var40 = baseZ - 0.5D; - double var42 = baseZ + 0.5D; + final double var36 = baseX - 0.5D; + final double var38 = baseX + 0.5D; + final double var40 = baseZ - 0.5D; + final double var42 = baseZ + 0.5D; double toff = 0.0d; @@ -484,18 +484,18 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH renderer.setBrightness( 11 << 20 | 11 << 4 ); } - EnumFacing t = EnumFacing.UP; + final EnumFacing t = EnumFacing.UP; - double TorchLen = 0.625D; - double var44 = 0.0625D; - double Zero = 0; - double par10 = 0; + final double TorchLen = 0.625D; + final double var44 = 0.0625D; + final double Zero = 0; + final double par10 = 0; this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var20, var22 ); this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20, var26 ); this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24, var26 ); this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24, var22 ); - double var422 = 0.1915D + 1.0 / 16.0; + final double var422 = 0.1915D + 1.0 / 16.0; this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24b, var22b ); this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24b, var26b ); this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20b, var26b ); @@ -527,7 +527,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH this.addVertexWithUV(t,renderer, var36, baseY + 1.0D, baseZ - var44, var17, var18 ); } - public void addVertexWithUV( EnumFacing face, ModelGenerator renderer, double x, double y, double z, double u, double v ) + public void addVertexWithUV( final EnumFacing face, final ModelGenerator renderer, double x, double y, double z, final double u, final double v ) { x -= this.centerX; y -= this.centerY; @@ -541,7 +541,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH if( this.side == AEPartLocation.EAST ) { - double m = x; + final double m = x; x = y; y = m; y = -y; @@ -549,14 +549,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH if( this.side == AEPartLocation.WEST ) { - double m = x; + final double m = x; x = -y; y = m; } if( this.side == AEPartLocation.SOUTH ) { - double m = z; + final double m = z; z = y; y = m; y = -y; @@ -564,7 +564,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH if( this.side == AEPartLocation.NORTH ) { - double m = z; + final double m = z; z = -y; y = m; } @@ -578,7 +578,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( renderer.getIcon( is ) ); // rh.setTexture( CableBusTextures.ItemPartLevelEmitterOn.getIcon() ); @@ -618,17 +618,17 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH @Override public void randomDisplayTick( - World world, - BlockPos pos, - Random r ) + final World world, + final BlockPos pos, + final Random r ) { if( this.isLevelEmitterOn() ) { - AEPartLocation d = this.side; + final AEPartLocation d = this.side; - double d0 = d.xOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D; - double d1 = d.yOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D; - double d2 = d.zOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D; + final double d0 = d.xOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D; + final double d1 = d.yOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D; + final double d2 = d.zOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D; world.spawnParticle( EnumParticleTypes.REDSTONE, 0.5 + pos.getX() + d0, 0.5 + pos.getY() + d1, 0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D, new int[0] ); } @@ -641,7 +641,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -658,13 +658,13 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.configureWatchers(); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( inv == this.config ) { @@ -687,7 +687,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.lastReportedValue = data.getLong( "lastReportedValue" ); @@ -697,7 +697,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setLong( "lastReportedValue", this.lastReportedValue ); @@ -707,7 +707,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -718,7 +718,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table ) { return false; } @@ -730,13 +730,13 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH } @Override - public void provideCrafting( ICraftingProviderHelper craftingTracker ) + public void provideCrafting( final ICraftingProviderHelper craftingTracker ) { if( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ) { if( this.getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE ) == YesNo.YES ) { - IAEItemStack what = this.config.getAEStackInSlot( 0 ); + final IAEItemStack what = this.config.getAEStackInSlot( 0 ); if( what != null ) { craftingTracker.setEmitable( what ); diff --git a/src/main/java/appeng/parts/automation/PartSharedItemBus.java b/src/main/java/appeng/parts/automation/PartSharedItemBus.java index 16313d24..1ccd31fc 100644 --- a/src/main/java/appeng/parts/automation/PartSharedItemBus.java +++ b/src/main/java/appeng/parts/automation/PartSharedItemBus.java @@ -42,7 +42,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid private InventoryAdaptor adaptor; private boolean lastRedstone = false; - public PartSharedItemBus( ItemStack is ) + public PartSharedItemBus( final ItemStack is ) { super( is ); } @@ -54,21 +54,21 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid } @Override - public void readFromNBT( net.minecraft.nbt.NBTTagCompound extra ) + public void readFromNBT( final net.minecraft.nbt.NBTTagCompound extra ) { super.readFromNBT( extra ); this.config.readFromNBT( extra, "config" ); } @Override - public void writeToNBT( net.minecraft.nbt.NBTTagCompound extra ) + public void writeToNBT( final net.minecraft.nbt.NBTTagCompound extra ) { super.writeToNBT( extra ); this.config.writeToNBT( extra, "config" ); } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -110,9 +110,9 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid return this.adaptor; } - private TileEntity getTileEntity( TileEntity self, BlockPos pos ) + private TileEntity getTileEntity( final TileEntity self, final BlockPos pos ) { - World w = self.getWorld(); + final World w = self.getWorld(); if( w.getChunkProvider().chunkExists( pos.getX() >> 4, pos.getZ() >> 4 ) ) { @@ -177,7 +177,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid this.proxy.getTick().sleepDevice( this.proxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } diff --git a/src/main/java/appeng/parts/automation/PartUpgradeable.java b/src/main/java/appeng/parts/automation/PartUpgradeable.java index 6586cb05..36001883 100644 --- a/src/main/java/appeng/parts/automation/PartUpgradeable.java +++ b/src/main/java/appeng/parts/automation/PartUpgradeable.java @@ -38,7 +38,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn private final IConfigManager manager; private final UpgradeInventory upgrades; - public PartUpgradeable( ItemStack is ) + public PartUpgradeable( final ItemStack is ) { super( is ); this.upgrades = new StackUpgradeInventory( this.is, this, this.getUpgradeSlots() ); @@ -52,13 +52,13 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( inv == this.upgrades ) { @@ -108,7 +108,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.upgrades.getInstalledUpgrades( u ); } @@ -120,7 +120,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public void readFromNBT( net.minecraft.nbt.NBTTagCompound extra ) + public void readFromNBT( final net.minecraft.nbt.NBTTagCompound extra ) { super.readFromNBT( extra ); this.manager.readFromNBT( extra ); @@ -128,7 +128,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public void writeToNBT( net.minecraft.nbt.NBTTagCompound extra ) + public void writeToNBT( final net.minecraft.nbt.NBTTagCompound extra ) { super.writeToNBT( extra ); this.manager.writeToNBT( extra ); @@ -136,9 +136,9 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { - for( ItemStack is : this.upgrades ) + for( final ItemStack is : this.upgrades ) { if( is != null ) { @@ -154,7 +154,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "upgrades" ) ) { diff --git a/src/main/java/appeng/parts/automation/StackUpgradeInventory.java b/src/main/java/appeng/parts/automation/StackUpgradeInventory.java index cf001fbd..8a3a858a 100644 --- a/src/main/java/appeng/parts/automation/StackUpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/StackUpgradeInventory.java @@ -11,18 +11,18 @@ public class StackUpgradeInventory extends UpgradeInventory { private final ItemStack stack; - public StackUpgradeInventory( ItemStack stack, IAEAppEngInventory inventory, int s ) + public StackUpgradeInventory( final ItemStack stack, final IAEAppEngInventory inventory, final int s ) { super( inventory, s ); this.stack = stack; } @Override - public int getMaxInstalled( Upgrades upgrades ) + public int getMaxInstalled( final Upgrades upgrades ) { int max = 0; - for( ItemStack is : upgrades.getSupported().keySet() ) + for( final ItemStack is : upgrades.getSupported().keySet() ) { if( Platform.isSameItem( this.stack, is ) ) { diff --git a/src/main/java/appeng/parts/automation/UpgradeInventory.java b/src/main/java/appeng/parts/automation/UpgradeInventory.java index 7959effc..de13320b 100644 --- a/src/main/java/appeng/parts/automation/UpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/UpgradeInventory.java @@ -43,7 +43,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement private int inverterUpgrades = 0; private int craftingUpgrades = 0; - public UpgradeInventory( IAEAppEngInventory parent, int s ) + public UpgradeInventory( final IAEAppEngInventory parent, final int s ) { super( null, s ); this.te = this; @@ -63,16 +63,16 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( itemstack == null ) { return false; } - Item it = itemstack.getItem(); + final Item it = itemstack.getItem(); if( it instanceof IUpgradeModule ) { - Upgrades u = ( (IUpgradeModule) it ).getType( itemstack ); + final Upgrades u = ( (IUpgradeModule) it ).getType( itemstack ); if( u != null ) { return this.getInstalledUpgrades( u ) < this.getMaxInstalled( u ); @@ -81,7 +81,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement return false; } - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { if( !this.cached ) { @@ -114,14 +114,14 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement this.cached = true; this.inverterUpgrades = this.capacityUpgrades = this.redstoneUpgrades = this.speedUpgrades = this.fuzzyUpgrades = this.craftingUpgrades = 0; - for( ItemStack is : this ) + for( final ItemStack is : this ) { if( is == null || is.getItem() == null || !( is.getItem() instanceof IUpgradeModule ) ) { continue; } - Upgrades myUpgrade = ( (IUpgradeModule) is.getItem() ).getType( is ); + final Upgrades myUpgrade = ( (IUpgradeModule) is.getItem() ).getType( is ); switch( myUpgrade ) { case CAPACITY: @@ -156,7 +156,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement } @Override - public void readFromNBT( NBTTagCompound target ) + public void readFromNBT( final NBTTagCompound target ) { super.readFromNBT( target ); this.updateUpgradeInfo(); @@ -169,7 +169,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { this.cached = false; if( this.parent != null && Platform.isServer() ) diff --git a/src/main/java/appeng/parts/misc/PartCableAnchor.java b/src/main/java/appeng/parts/misc/PartCableAnchor.java index 7490f059..24b55a21 100644 --- a/src/main/java/appeng/parts/misc/PartCableAnchor.java +++ b/src/main/java/appeng/parts/misc/PartCableAnchor.java @@ -56,13 +56,13 @@ public class PartCableAnchor implements IPart IPartHost host = null; AEPartLocation mySide = AEPartLocation.UP; - public PartCableAnchor( ItemStack is ) + public PartCableAnchor( final ItemStack is ) { this.is = is; } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { if( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null ) { @@ -75,14 +75,14 @@ public class PartCableAnchor implements IPart } @Override - public ItemStack getItemStack( PartItemStack wrenched ) + public ItemStack getItemStack( final PartItemStack wrenched ) { return this.is; } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper instance, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper instance, final ModelGenerator renderer ) { instance.setTexture( renderer.getIcon( is ) ); instance.setBounds( 7, 7, 4, 9, 9, 14 ); @@ -92,9 +92,9 @@ public class PartCableAnchor implements IPart @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { - IAESprite myIcon = renderer.getIcon( is ); + final IAESprite myIcon = renderer.getIcon( is ); rh.setTexture( myIcon ); if( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null ) { @@ -110,13 +110,13 @@ public class PartCableAnchor implements IPart @Override @SideOnly( Side.CLIENT ) - public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderDynamic( final double x, final double y, final double z, final IPartRenderHelper rh, final ModelGenerator renderer ) { } @Override - public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer) + public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer) { return null; } @@ -140,13 +140,13 @@ public class PartCableAnchor implements IPart } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { } @@ -158,7 +158,7 @@ public class PartCableAnchor implements IPart } @Override - public boolean isLadder( EntityLivingBase entity ) + public boolean isLadder( final EntityLivingBase entity ) { return this.mySide.yOffset == 0 && ( entity.isCollidedHorizontally || !entity.onGround ); } @@ -182,13 +182,13 @@ public class PartCableAnchor implements IPart } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { return false; } @@ -200,7 +200,7 @@ public class PartCableAnchor implements IPart } @Override - public void onEntityCollision( Entity entity ) + public void onEntityCollision( final Entity entity ) { } @@ -224,26 +224,26 @@ public class PartCableAnchor implements IPart } @Override - public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile ) { this.host = host; this.mySide = side; } @Override - public boolean onActivate( EntityPlayer player, Vec3 pos ) + public boolean onActivate( final EntityPlayer player, final Vec3 pos ) { return false; } @Override - public boolean onShiftActivate( EntityPlayer player, Vec3 pos ) + public boolean onShiftActivate( final EntityPlayer player, final Vec3 pos ) { return false; } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { } @@ -256,21 +256,21 @@ public class PartCableAnchor implements IPart @Override public void randomDisplayTick( - World world, - BlockPos pos, - Random r ) + final World world, + final BlockPos pos, + final Random r ) { } @Override - public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side ) { } @Override - public boolean canBePlacedOn( BusSupport what ) + public boolean canBePlacedOn( final BusSupport what ) { return what == BusSupport.CABLE || what == BusSupport.DENSE_CABLE; } diff --git a/src/main/java/appeng/parts/misc/PartInterface.java b/src/main/java/appeng/parts/misc/PartInterface.java index 202d3c48..158d8cee 100644 --- a/src/main/java/appeng/parts/misc/PartInterface.java +++ b/src/main/java/appeng/parts/misc/PartInterface.java @@ -80,39 +80,39 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto final DualityInterface duality = new DualityInterface( this.proxy, this ); @Reflected - public PartInterface( ItemStack is ) + public PartInterface( final ItemStack is ) { super( is ); } @MENetworkEventSubscribe - public void stateChange( MENetworkChannelsChanged c ) + public void stateChange( final MENetworkChannelsChanged c ) { this.duality.notifyNeighbors(); } @MENetworkEventSubscribe - public void stateChange( MENetworkPowerStatusChange c ) + public void stateChange( final MENetworkPowerStatusChange c ) { this.duality.notifyNeighbors(); } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 2, 2, 14, 14, 14, 16 ); bch.addBox( 5, 5, 12, 11, 11, 14 ); } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.duality.getInstalledUpgrades( u ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); @@ -134,7 +134,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); @@ -155,14 +155,14 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.duality.readFromNBT( data ); } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.duality.writeToNBT( data ); @@ -176,7 +176,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { this.duality.addDrops( drops ); } @@ -194,13 +194,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { return this.duality.getInventoryByName( name ); } @Override - public boolean onPartActivate( EntityPlayer p, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer p, final Vec3 pos ) { if( p.isSneaking() ) { @@ -216,13 +216,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public TextureAtlasSprite getBreakingTexture(ModelGenerator renderer) + public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer) { return renderer.getIcon( is ).getAtlas(); } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { return this.duality.canInsert( stack ); } @@ -240,13 +240,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return this.duality.getTickingRequest( node ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.duality.tickingRequest( node, ticksSinceLastCall ); } @@ -258,25 +258,25 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.duality.getStorage().getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return this.duality.getStorage().decrStackSize( i, j ); } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return this.duality.getStorage().getStackInSlotOnClosing( i ); } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { this.duality.getStorage().setInventorySlotContents( i, itemstack ); } @@ -306,49 +306,49 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return this.duality.getStorage().isUseableByPlayer( entityplayer ); } @Override - public void openInventory( EntityPlayer player ) + public void openInventory( final EntityPlayer player ) { this.duality.getStorage().openInventory(player); } @Override - public void closeInventory( EntityPlayer player ) + public void closeInventory( final EntityPlayer player ) { this.duality.getStorage().closeInventory(player); } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return this.duality.getStorage().isItemValidForSlot( i, itemstack ); } @Override - public int[] getSlotsForFace( EnumFacing side ) + public int[] getSlotsForFace( final EnumFacing side ) { return this.duality.getSlotsForFace( side ); } @Override - public boolean canInsertItem( int i, ItemStack itemstack, EnumFacing j ) + public boolean canInsertItem( final int i, final ItemStack itemstack, final EnumFacing j ) { return true; } @Override - public boolean canExtractItem( int i, ItemStack itemstack, EnumFacing j ) + public boolean canExtractItem( final int i, final ItemStack itemstack, final EnumFacing j ) { return true; } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { this.duality.onChangeInventory( inv, slot, mc, removedStack, newStack ); } @@ -372,13 +372,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public IStorageMonitorable getMonitorable( EnumFacing side, BaseActionSource src ) + public IStorageMonitorable getMonitorable( final EnumFacing side, final BaseActionSource src ) { return this.duality.getMonitorable( side, src, this ); } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table ) { return this.duality.pushPattern( patternDetails, table ); } @@ -390,7 +390,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public void provideCrafting( ICraftingProviderHelper craftingTracker ) + public void provideCrafting( final ICraftingProviderHelper craftingTracker ) { this.duality.provideCrafting( craftingTracker ); } @@ -402,13 +402,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode ) + public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack items, final Actionable mode ) { return this.duality.injectCraftedItems( link, items, mode ); } @Override - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { this.duality.jobStateChange( link ); } @@ -420,22 +420,22 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.duality.setPriority( newValue ); } @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 ) { } diff --git a/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java b/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java index 807351b1..fddee47b 100644 --- a/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java +++ b/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java @@ -26,7 +26,7 @@ import appeng.helpers.Reflected; public class PartInvertedToggleBus extends PartToggleBus { @Reflected - public PartInvertedToggleBus( ItemStack is ) + public PartInvertedToggleBus( final ItemStack is ) { super( is ); this.proxy.setIdlePowerUsage( 0.0 ); diff --git a/src/main/java/appeng/parts/misc/PartStorageBus.java b/src/main/java/appeng/parts/misc/PartStorageBus.java index 4b5c09d7..4c6cb9ff 100644 --- a/src/main/java/appeng/parts/misc/PartStorageBus.java +++ b/src/main/java/appeng/parts/misc/PartStorageBus.java @@ -100,7 +100,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC private byte resetCacheLogic = 0; @Reflected - public PartStorageBus( ItemStack is ) + public PartStorageBus( final ItemStack is ) { super( is ); this.getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE ); @@ -111,14 +111,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC @Override @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.updateStatus(); } private void updateStatus() { - boolean currentActive = this.proxy.isActive(); + final boolean currentActive = this.proxy.isActive(); if( this.wasActive != currentActive ) { this.wasActive = currentActive; @@ -127,7 +127,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); this.host.markForUpdate(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -135,7 +135,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @MENetworkEventSubscribe - public void updateChannels( MENetworkChannelsChanged changedChannels ) + public void updateChannels( final MENetworkChannelsChanged changedChannels ) { this.updateStatus(); } @@ -147,14 +147,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.resetCache( true ); this.host.markForSave(); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { super.onChangeInventory( inv, slot, mc, removedStack, newStack ); @@ -172,7 +172,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.Config.readFromNBT( data, "config" ); @@ -180,7 +180,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.Config.writeToNBT( data, "config" ); @@ -188,7 +188,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -198,7 +198,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC return super.getInventoryByName( name ); } - private void resetCache( boolean fullReset ) + private void resetCache( final boolean fullReset ) { if( this.host == null || this.host.getTile() == null || this.host.getTile().getWorld() == null || this.host.getTile().getWorld().isRemote ) { @@ -218,20 +218,20 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC { this.proxy.getTick().alertDevice( this.proxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @Override - public boolean isValid( Object verificationToken ) + public boolean isValid( final Object verificationToken ) { return this.handler == verificationToken; } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource source ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource source ) { try { @@ -240,7 +240,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.proxy.getStorage().postAlterationOfStoredItems( StorageChannel.ITEMS, change, this.mySrc ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } @@ -253,7 +253,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 3, 3, 15, 13, 13, 16 ); bch.addBox( 2, 2, 14, 14, 14, 15 ); @@ -262,7 +262,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); @@ -278,7 +278,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() ); @@ -314,7 +314,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !player.isSneaking() ) { @@ -331,13 +331,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, this.monitor == null, true ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( this.resetCacheLogic != 0 ) { @@ -354,10 +354,10 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC private void resetCache() { - boolean fullReset = this.resetCacheLogic == 2; + final boolean fullReset = this.resetCacheLogic == 2; this.resetCacheLogic = 0; - IMEInventory in = this.getInternalHandler(); + final IMEInventory in = this.getInternalHandler(); IItemList before = AEApi.instance().storage().createItemList(); if( in != null ) { @@ -370,7 +370,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.handlerHash = 0; } - IMEInventory out = this.getInternalHandler(); + final IMEInventory out = this.getInternalHandler(); if( this.monitor != null ) { @@ -393,13 +393,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC return this.handler; } - boolean wasSleeping = this.monitor == null; + final boolean wasSleeping = this.monitor == null; this.cached = true; - TileEntity self = this.getHost().getTile(); - TileEntity target = self.getWorld().getTileEntity( self.getPos().offset( side.getFacing() ) ); + final TileEntity self = this.getHost().getTile(); + final TileEntity target = self.getWorld().getTileEntity( self.getPos().offset( side.getFacing() ) ); - int newHandlerHash = Platform.generateTileHash( target ); + final int newHandlerHash = Platform.generateTileHash( target ); if( this.handlerHash == newHandlerHash && this.handlerHash != 0 ) { @@ -411,7 +411,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC // force grid to update handlers... this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :3 } @@ -421,14 +421,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.monitor = null; if( target != null ) { - IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc ); + final IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc ); if( esh != null ) { - IMEInventory inv = esh.getInventory( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc ); + final IMEInventory inv = esh.getInventory( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc ); if( inv instanceof MEMonitorIInventory ) { - MEMonitorIInventory h = (MEMonitorIInventory) inv; + final MEMonitorIInventory h = (MEMonitorIInventory) inv; h.mode = (StorageFilter) this.getConfigManager().getSetting( Settings.STORAGE_FILTER ); h.mySource = new MachineSource( this ); } @@ -448,12 +448,12 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC this.handler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST ); this.handler.setPriority( this.priority ); - IItemList priorityList = AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); - int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; + final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; for( int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++ ) { - IAEItemStack is = this.Config.getAEStackInSlot( x ); + final IAEItemStack is = this.Config.getAEStackInSlot( x ); if( is != null ) { priorityList.add( is ); @@ -482,7 +482,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC { try { - ITickManager tm = this.proxy.getTick(); + final ITickManager tm = this.proxy.getTick(); if( this.monitor == null ) { tm.sleepDevice( this.proxy.getNode() ); @@ -492,7 +492,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC tm.wakeDevice( this.proxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } @@ -501,7 +501,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC return this.handler; } - private void checkInterfaceVsStorageBus( TileEntity target, AEPartLocation side ) + private void checkInterfaceVsStorageBus( final TileEntity target, final AEPartLocation side ) { IInterfaceHost achievement = null; @@ -512,7 +512,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC if( target instanceof IPartHost ) { - Object part = ( (IPartHost) target ).getPart( side ); + final Object part = ( (IPartHost) target ).getPart( side ); if( part instanceof IInterfaceHost ) { achievement = (IInterfaceHost) part; @@ -527,11 +527,11 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { if( channel == StorageChannel.ITEMS ) { - IMEInventoryHandler out = this.proxy.isActive() ? this.getInternalHandler() : null; + final IMEInventoryHandler out = this.proxy.isActive() ? this.getInternalHandler() : null; if( out != null ) { return Collections.singletonList( out ); @@ -547,7 +547,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; this.host.markForSave(); @@ -555,7 +555,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } @Override - public void blinkCell( int slot ) + public void blinkCell( final int slot ) { } @@ -569,7 +569,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC } */ @Override - public void saveChanges( IMEInventory cellInventory ) + public void saveChanges( final IMEInventory cellInventory ) { // nope! } diff --git a/src/main/java/appeng/parts/misc/PartToggleBus.java b/src/main/java/appeng/parts/misc/PartToggleBus.java index 9c7febc3..adf893f6 100644 --- a/src/main/java/appeng/parts/misc/PartToggleBus.java +++ b/src/main/java/appeng/parts/misc/PartToggleBus.java @@ -59,7 +59,7 @@ public class PartToggleBus extends PartBasicState boolean hasRedstone = false; @Reflected - public PartToggleBus( ItemStack is ) + public PartToggleBus( final ItemStack is ) { super( is ); @@ -70,14 +70,14 @@ public class PartToggleBus extends PartBasicState } @Override - public void setColors( ModelGenerator renderer, boolean hasChan, boolean hasPower ) + public void setColors( final ModelGenerator renderer, final boolean hasChan, final boolean hasPower ) { this.hasRedstone = ( this.clientFlags & REDSTONE_FLAG ) == REDSTONE_FLAG; super.setColors( renderer, hasChan && this.hasRedstone, hasPower && this.hasRedstone ); } @Override - protected int populateFlags( int cf ) + protected int populateFlags( final int cf ) { return cf | ( this.getIntention() ? REDSTONE_FLAG : 0 ); } @@ -88,13 +88,13 @@ public class PartToggleBus extends PartBasicState } @Override - public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer ) + public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer ) { return renderer.getIcon( is ).getAtlas(); } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.GLASS; } @@ -104,7 +104,7 @@ public class PartToggleBus extends PartBasicState { if( this.is.stackSize > 0 ) { - List items = new ArrayList(); + final List items = new ArrayList(); items.add( this.is.copy() ); this.host.removePart( this.side, false ); Platform.spawnDrops( this.tile.getWorld(), this.tile.getPos(), items ); @@ -113,14 +113,14 @@ public class PartToggleBus extends PartBasicState } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 6, 6, 11, 10, 10, 16 ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { GL11.glTranslated( -0.2, -0.3, 0.0 ); @@ -145,7 +145,7 @@ public class PartToggleBus extends PartBasicState @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( renderer.getIcon( is ) ); @@ -166,7 +166,7 @@ public class PartToggleBus extends PartBasicState @Override public void onNeighborChanged() { - boolean oldHasRedstone = this.hasRedstone; + final boolean oldHasRedstone = this.hasRedstone; this.hasRedstone = this.getHost().hasRedstone( this.side ); if( this.hasRedstone != oldHasRedstone ) @@ -177,14 +177,14 @@ public class PartToggleBus extends PartBasicState } @Override - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { super.readFromNBT( extra ); this.outerProxy.readFromNBT( extra ); } @Override - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { super.writeToNBT( extra ); this.outerProxy.writeToNBT( extra ); @@ -207,7 +207,7 @@ public class PartToggleBus extends PartBasicState } @Override - public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile ) { super.setPartHostInfo( side, host, tile ); this.outerProxy.setValidSides( EnumSet.of( side.getFacing() ) ); @@ -226,7 +226,7 @@ public class PartToggleBus extends PartBasicState } @Override - public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side ) { super.onPlacement( player, held, side ); this.outerProxy.setOwner( player ); @@ -234,7 +234,7 @@ public class PartToggleBus extends PartBasicState private void updateInternalState() { - boolean intention = this.getIntention(); + final boolean intention = this.getIntention(); if( intention == ( this.connection == null ) ) { if( this.proxy.getNode() != null && this.outerProxy.getNode() != null ) @@ -245,7 +245,7 @@ public class PartToggleBus extends PartBasicState { this.connection = AEApi.instance().createGridConnection( this.proxy.getNode(), this.outerProxy.getNode() ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { // :( } diff --git a/src/main/java/appeng/parts/networking/PartCable.java b/src/main/java/appeng/parts/networking/PartCable.java index 739e67bb..7cc3fc23 100644 --- a/src/main/java/appeng/parts/networking/PartCable.java +++ b/src/main/java/appeng/parts/networking/PartCable.java @@ -75,7 +75,7 @@ public class PartCable extends AEBasePart implements IPartCable EnumSet connections = EnumSet.noneOf( AEPartLocation.class ); boolean powered = false; - public PartCable( ItemStack is ) + public PartCable( final ItemStack is ) { super( is ); this.proxy.setFlags( GridFlags.PREFERRED ); @@ -102,7 +102,7 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public boolean changeColor( AEColor newColor, EntityPlayer who ) + public boolean changeColor( final AEColor newColor, final EntityPlayer who ) { if( this.getCableColor() != newColor ) { @@ -133,7 +133,7 @@ public class PartCable extends AEBasePart implements IPartCable { hasPermission = this.proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -155,13 +155,13 @@ public class PartCable extends AEBasePart implements IPartCable @Override public void setValidSides( - EnumSet sides ) + final EnumSet sides ) { this.proxy.setValidSides( sides ); } @Override - public boolean isConnected( EnumFacing side ) + public boolean isConnected( final EnumFacing side ) { return this.connections.contains( AEPartLocation.fromFacing( side ) ); } @@ -172,13 +172,13 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 6.0, 6.0, 6.0, 10.0, 10.0, 10.0 ); if( Platform.isServer() ) { - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { this.connections = n.getConnectedSides(); @@ -189,15 +189,15 @@ public class PartCable extends AEBasePart implements IPartCable } } - IPartHost ph = this.getHost(); + final IPartHost ph = this.getHost(); if( ph != null ) { - for( AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS ) { - IPart p = ph.getPart( dir ); + final IPart p = ph.getPart( dir ); if( p instanceof IGridHost ) { - double dist = p.cableConnectionRenderTo(); + final double dist = p.cableConnectionRenderTo(); if( dist > 8 ) { @@ -230,7 +230,7 @@ public class PartCable extends AEBasePart implements IPartCable } } - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { switch( of ) { @@ -259,7 +259,7 @@ public class PartCable extends AEBasePart implements IPartCable @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { GL11.glTranslated( -0.0, -0.0, 0.3 ); @@ -269,12 +269,12 @@ public class PartCable extends AEBasePart implements IPartCable rh.setTexture( null ); } - public IAESprite getTexture( AEColor c,ModelGenerator renderer ) + public IAESprite getTexture( final AEColor c, final ModelGenerator renderer ) { return this.getGlassTexture( c,renderer ); } - public IAESprite getGlassTexture( AEColor c,ModelGenerator renderer ) + public IAESprite getGlassTexture( final AEColor c, final ModelGenerator renderer ) { switch( c ) { @@ -327,18 +327,18 @@ public class PartCable extends AEBasePart implements IPartCable @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { boolean useCovered = false; boolean requireDetailed = false; - for( AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS ) { - IPart p = this.getHost().getPart( dir ); + final IPart p = this.getHost().getPart( dir ); if( p instanceof IGridHost ) { - IGridHost igh = (IGridHost) p; - AECableType type = igh.getCableConnectionType( dir.getOpposite() ); + final IGridHost igh = (IGridHost) p; + final AECableType type = igh.getCableConnectionType( dir.getOpposite() ); if( type == AECableType.COVERED || type == AECableType.SMART ) { useCovered = true; @@ -347,9 +347,9 @@ public class PartCable extends AEBasePart implements IPartCable } else if( this.connections.contains( dir ) ) { - TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( dir.getFacing() ) ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( dir.getFacing() ) ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; if( partHost == null && gh != null && gh.getCableConnectionType( dir ) != AECableType.GLASS ) { requireDetailed = true; @@ -366,13 +366,13 @@ public class PartCable extends AEBasePart implements IPartCable rh.setTexture( this.getTexture( this.getCableColor(),renderer ) ); } - IPartHost ph = this.getHost(); - for( AEPartLocation of : EnumSet.complementOf( this.connections ) ) + final IPartHost ph = this.getHost(); + for( final AEPartLocation of : EnumSet.complementOf( this.connections ) ) { - IPart bp = ph.getPart( of ); + final IPart bp = ph.getPart( of ); if( bp instanceof IGridHost ) { - int len = bp.cableConnectionRenderTo(); + final int len = bp.cableConnectionRenderTo(); if( len < 8 ) { switch( of ) @@ -416,17 +416,17 @@ public class PartCable extends AEBasePart implements IPartCable rh.renderBlock( pos, renderer ); } - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { this.renderGlassConnection( pos, rh, renderer, of ); } } else { - IAESprite def = this.getTexture( this.getCableColor(), renderer ); + final IAESprite def = this.getTexture( this.getCableColor(), renderer ); rh.setTexture( def ); - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing(), of.getFacing().getOpposite() ) ) ); switch( of ) @@ -458,18 +458,18 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); if( Platform.isServer() ) { - IGridNode node = this.getGridNode(); + final IGridNode node = this.getGridNode(); if( node != null ) { int howMany = 0; - for( IGridConnection gc : node.getConnections() ) + for( final IGridConnection gc : node.getConnections() ) { howMany = Math.max( gc.getUsedChannels(), howMany ); } @@ -480,23 +480,23 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { int cs = 0; int sideOut = 0; - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { - for( AEPartLocation thisSide : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation thisSide : AEPartLocation.SIDE_LOCATIONS ) { - IPart part = this.getHost().getPart( thisSide ); + final IPart part = this.getHost().getPart( thisSide ); if( part != null ) { if( part.getGridNode() != null ) { - IReadOnlyCollection set = part.getGridNode().getConnections(); - for( IGridConnection gc : set ) + final IReadOnlyCollection set = part.getGridNode().getConnections(); + for( final IGridConnection gc : set ) { if( this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) ) { @@ -511,13 +511,13 @@ public class PartCable extends AEBasePart implements IPartCable } } - for( IGridConnection gc : n.getConnections() ) + for( final IGridConnection gc : n.getConnections() ) { - AEPartLocation side = gc.getDirection( n ); + final AEPartLocation side = gc.getDirection( n ); if( side != AEPartLocation.INTERNAL ) { - boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ); - boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ); + final boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ); + final boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ); if( isTier2a && isTier2b ) { @@ -539,7 +539,7 @@ public class PartCable extends AEBasePart implements IPartCable cs |= ( 1 << AEPartLocation.INTERNAL.ordinal() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // aww... } @@ -549,21 +549,21 @@ public class PartCable extends AEBasePart implements IPartCable } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { - int cs = data.readByte(); - int sideOut = data.readInt(); + final int cs = data.readByte(); + final int sideOut = data.readInt(); - EnumSet myC = this.connections.clone(); - boolean wasPowered = this.powered; + final EnumSet myC = this.connections.clone(); + final boolean wasPowered = this.powered; this.powered = false; boolean channelsChanged = false; - for( AEPartLocation d : AEPartLocation.values() ) + for( final AEPartLocation d : AEPartLocation.values() ) { if( d != AEPartLocation.INTERNAL ) { - int ch = ( sideOut >> ( d.ordinal() * 4 ) ) & 0xF; + final int ch = ( sideOut >> ( d.ordinal() * 4 ) ) & 0xF; if( ch != this.channelsOnSide[d.ordinal()] ) { channelsChanged = true; @@ -573,7 +573,7 @@ public class PartCable extends AEBasePart implements IPartCable if( d == AEPartLocation.INTERNAL ) { - int id = 1 << d.ordinal(); + final int id = 1 << d.ordinal(); if( id == ( cs & id ) ) { this.powered = true; @@ -581,7 +581,7 @@ public class PartCable extends AEBasePart implements IPartCable } else { - int id = 1 << d.ordinal(); + final int id = 1 << d.ordinal(); if( id == ( cs & id ) ) { this.connections.add( d ); @@ -598,12 +598,12 @@ public class PartCable extends AEBasePart implements IPartCable @Override @SideOnly( Side.CLIENT ) - public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer ) + public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer ) { return this.getTexture( this.getCableColor(), renderer ).getAtlas(); } - public IAESprite getCoveredTexture( AEColor c, ModelGenerator renderer ) + public IAESprite getCoveredTexture( final AEColor c, final ModelGenerator renderer ) { switch( c ) { @@ -648,17 +648,17 @@ public class PartCable extends AEBasePart implements IPartCable return renderer.getIcon( coveredCableStack ); } - protected boolean nonLinear( EnumSet sides ) + protected boolean nonLinear( final EnumSet sides ) { return ( sides.contains( AEPartLocation.EAST ) && sides.contains( AEPartLocation.WEST ) ) || ( sides.contains( AEPartLocation.NORTH ) && sides.contains( AEPartLocation.SOUTH ) ) || ( sides.contains( AEPartLocation.UP ) && sides.contains( AEPartLocation.DOWN ) ); } @SideOnly( Side.CLIENT ) - public void renderGlassConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, AEPartLocation of ) + public void renderGlassConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final AEPartLocation of ) { - TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing() ) ) ); @@ -730,11 +730,11 @@ public class PartCable extends AEBasePart implements IPartCable } @SideOnly( Side.CLIENT ) - public void renderCoveredConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, int channels, AEPartLocation of ) + public void renderCoveredConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of ) { - TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing() ) ) ); if( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null && partHost.getColor() != AEColor.Transparent ) @@ -811,11 +811,11 @@ public class PartCable extends AEBasePart implements IPartCable } @SideOnly( Side.CLIENT ) - public void renderSmartConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, int channels, AEPartLocation of ) + public void renderSmartConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of ) { - TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; AEColor myColor = this.getCableColor(); rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing() ) ) ); @@ -855,13 +855,13 @@ public class PartCable extends AEBasePart implements IPartCable rh.renderBlock( pos, renderer ); this.setSmartConnectionRotations( of, renderer ); - IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); if( of == AEPartLocation.EAST || of == AEPartLocation.WEST ) { - AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); - FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST ); + final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); + final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST ); ico.setFlip( false, true ); } @@ -919,8 +919,8 @@ public class PartCable extends AEBasePart implements IPartCable { this.setSmartConnectionRotations( of, renderer ); - IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); renderer.setBrightness( 15 << 20 | 15 << 4 ); renderer.setColorOpaque_I( myColor.blackVariant ); @@ -935,7 +935,7 @@ public class PartCable extends AEBasePart implements IPartCable } } - public IAESprite getSmartTexture( AEColor c, ModelGenerator renderer ) + public IAESprite getSmartTexture( final AEColor c, final ModelGenerator renderer ) { switch( c ) { @@ -981,7 +981,7 @@ public class PartCable extends AEBasePart implements IPartCable } @SideOnly( Side.CLIENT ) - protected void setSmartConnectionRotations( AEPartLocation of, ModelGenerator renderer ) + protected void setSmartConnectionRotations( final AEPartLocation of, final ModelGenerator renderer ) { switch( of ) { @@ -1014,7 +1014,7 @@ public class PartCable extends AEBasePart implements IPartCable } } - protected CableBusTextures getChannelTex( int i, boolean b ) + protected CableBusTextures getChannelTex( int i, final boolean b ) { if( !this.powered ) { @@ -1056,7 +1056,7 @@ public class PartCable extends AEBasePart implements IPartCable } @SideOnly( Side.CLIENT ) - protected void renderAllFaces( AEBaseBlock blk, BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + protected void renderAllFaces( final AEBaseBlock blk, final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setBounds( (float) renderer.renderMinX * 16.0f, (float) renderer.renderMinY * 16.0f, (float) renderer.renderMinZ * 16.0f, (float) renderer.renderMaxX * 16.0f, (float) renderer.renderMaxY * 16.0f, (float) renderer.renderMaxZ * 16.0f ); rh.renderFace( pos, blk.getRendererInstance().getTexture( AEPartLocation.WEST ), EnumFacing.WEST, renderer ); diff --git a/src/main/java/appeng/parts/networking/PartCableCovered.java b/src/main/java/appeng/parts/networking/PartCableCovered.java index 92079cde..45a8415f 100644 --- a/src/main/java/appeng/parts/networking/PartCableCovered.java +++ b/src/main/java/appeng/parts/networking/PartCableCovered.java @@ -51,19 +51,19 @@ import appeng.util.Platform; public class PartCableCovered extends PartCable { @Reflected - public PartCableCovered( ItemStack is ) + public PartCableCovered( final ItemStack is ) { super( is ); } @MENetworkEventSubscribe - public void channelUpdated( MENetworkChannelsChanged c ) + public void channelUpdated( final MENetworkChannelsChanged c ) { this.getHost().markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } @@ -75,13 +75,13 @@ public class PartCableCovered extends PartCable } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 ); if( Platform.isServer() ) { - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { this.connections = n.getConnectedSides(); @@ -92,7 +92,7 @@ public class PartCableCovered extends PartCable } } - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { switch( of ) { @@ -121,7 +121,7 @@ public class PartCableCovered extends PartCable @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { GL11.glTranslated( -0.0, -0.0, 0.3 ); @@ -131,7 +131,7 @@ public class PartCableCovered extends PartCable OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor(), renderer ), offU, offV ); - for( EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) ) + for( final EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) ) { rh.renderInventoryFace( main, side, renderer ); } @@ -140,14 +140,14 @@ public class PartCableCovered extends PartCable offV = 0; main = new OffsetIcon( this.getTexture( this.getCableColor(), renderer ), offU, offV ); - for( EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) ) + for( final EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) ) { rh.renderInventoryFace( main, side, renderer ); } main = new OffsetIcon( this.getTexture( this.getCableColor(), renderer ), 0, 0 ); - for( EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) ) + for( final EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) ) { rh.renderInventoryFace( main, side, renderer ); } @@ -156,24 +156,24 @@ public class PartCableCovered extends PartCable } @Override - public IAESprite getTexture( AEColor c, ModelGenerator renderer ) + public IAESprite getTexture( final AEColor c, final ModelGenerator renderer ) { return this.getCoveredTexture( c, renderer ); } @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( this.getTexture( this.getCableColor(), renderer ) ); - EnumSet sides = this.connections.clone(); + final EnumSet sides = this.connections.clone(); boolean hasBuses = false; - IPartHost ph = this.getHost(); - for( AEPartLocation of : EnumSet.complementOf( this.connections ) ) + final IPartHost ph = this.getHost(); + for( final AEPartLocation of : EnumSet.complementOf( this.connections ) ) { - IPart bp = ph.getPart( of ); + final IPart bp = ph.getPart( of ); if( bp instanceof IGridHost ) { if( of != AEPartLocation.INTERNAL ) @@ -182,7 +182,7 @@ public class PartCableCovered extends PartCable hasBuses = true; } - int len = bp.cableConnectionRenderTo(); + final int len = bp.cableConnectionRenderTo(); if( len < 8 ) { switch( of ) @@ -215,7 +215,7 @@ public class PartCableCovered extends PartCable if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses ) { - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { this.renderCoveredConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of ); } @@ -226,9 +226,9 @@ public class PartCableCovered extends PartCable } else { - IAESprite def = this.getTexture( this.getCableColor(), renderer ); - IAESprite off = new OffsetIcon( def, 0, -12 ); - for( AEPartLocation of : this.connections ) + final IAESprite def = this.getTexture( this.getCableColor(), renderer ); + final IAESprite off = new OffsetIcon( def, 0, -12 ); + for( final AEPartLocation of : this.connections ) { switch( of ) { diff --git a/src/main/java/appeng/parts/networking/PartCableGlass.java b/src/main/java/appeng/parts/networking/PartCableGlass.java index 7268df95..ee6ae017 100644 --- a/src/main/java/appeng/parts/networking/PartCableGlass.java +++ b/src/main/java/appeng/parts/networking/PartCableGlass.java @@ -26,7 +26,7 @@ import appeng.helpers.Reflected; public class PartCableGlass extends PartCable { @Reflected - public PartCableGlass( ItemStack is ) + public PartCableGlass( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/networking/PartCableSmart.java b/src/main/java/appeng/parts/networking/PartCableSmart.java index ff3e441e..9cdefc58 100644 --- a/src/main/java/appeng/parts/networking/PartCableSmart.java +++ b/src/main/java/appeng/parts/networking/PartCableSmart.java @@ -54,19 +54,19 @@ import appeng.util.Platform; public class PartCableSmart extends PartCable { @Reflected - public PartCableSmart( ItemStack is ) + public PartCableSmart( final ItemStack is ) { super( is ); } @MENetworkEventSubscribe - public void channelUpdated( MENetworkChannelsChanged c ) + public void channelUpdated( final MENetworkChannelsChanged c ) { this.getHost().markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } @@ -78,13 +78,13 @@ public class PartCableSmart extends PartCable } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 ); if( Platform.isServer() ) { - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { this.connections = n.getConnectedSides(); @@ -95,7 +95,7 @@ public class PartCableSmart extends PartCable } } - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { switch( of ) { @@ -124,7 +124,7 @@ public class PartCableSmart extends PartCable @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { GL11.glTranslated( -0.0, -0.0, 0.3 ); @@ -135,7 +135,7 @@ public class PartCableSmart extends PartCable OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); - for( EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) ) + for( final EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) ) { rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f ); rh.renderInventoryFace( main, side, renderer ); @@ -149,7 +149,7 @@ public class PartCableSmart extends PartCable ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); - for( EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) ) + for( final EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) ) { rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f ); rh.renderInventoryFace( main, side, renderer ); @@ -161,7 +161,7 @@ public class PartCableSmart extends PartCable ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 ); ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 ); - for( EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) ) + for( final EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) ) { rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f ); rh.renderInventoryFace( main, side, renderer ); @@ -173,24 +173,24 @@ public class PartCableSmart extends PartCable } @Override - public IAESprite getTexture( AEColor c, ModelGenerator renderer ) + public IAESprite getTexture( final AEColor c, final ModelGenerator renderer ) { return this.getSmartTexture( c, renderer ); } @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( this.getTexture( this.getCableColor(), renderer ) ); - EnumSet sides = this.connections.clone(); + final EnumSet sides = this.connections.clone(); boolean hasBuses = false; - IPartHost ph = this.getHost(); - for( AEPartLocation of : EnumSet.complementOf( this.connections ) ) + final IPartHost ph = this.getHost(); + for( final AEPartLocation of : EnumSet.complementOf( this.connections ) ) { - IPart bp = ph.getPart( of ); + final IPart bp = ph.getPart( of ); if( bp instanceof IGridHost ) { if( of != AEPartLocation.INTERNAL ) @@ -199,7 +199,7 @@ public class PartCableSmart extends PartCable hasBuses = true; } - int len = bp.cableConnectionRenderTo(); + final int len = bp.cableConnectionRenderTo(); if( len < 8 ) { switch( of ) @@ -228,13 +228,13 @@ public class PartCableSmart extends PartCable rh.renderBlock( pos, renderer ); this.setSmartConnectionRotations( of, renderer ); - IAESprite firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f ); - IAESprite secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f ); + final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f ); + final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f ); if( of == AEPartLocation.EAST || of == AEPartLocation.WEST ) { - AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); - FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST ); + final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); + final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST ); ico.setFlip( false, true ); } @@ -256,7 +256,7 @@ public class PartCableSmart extends PartCable if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses ) { - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { this.renderSmartConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of ); } @@ -269,21 +269,21 @@ public class PartCableSmart extends PartCable { AEPartLocation selectedSide = AEPartLocation.INTERNAL; - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { selectedSide = of; break; } - int channels = this.channelsOnSide[selectedSide.ordinal()]; - IAESprite def = this.getTexture( this.getCableColor(), renderer ); - IAESprite off = new OffsetIcon( def, 0, -12 ); + final int channels = this.channelsOnSide[selectedSide.ordinal()]; + final IAESprite def = this.getTexture( this.getCableColor(), renderer ); + final IAESprite off = new OffsetIcon( def, 0, -12 ); - IAESprite firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IAESprite firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 ); + final IAESprite firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IAESprite firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 ); - IAESprite secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); - IAESprite secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 ); + final IAESprite secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IAESprite secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 ); switch( selectedSide ) { @@ -318,8 +318,8 @@ public class PartCableSmart extends PartCable renderer.uvRotateSouth = 0; renderer.uvRotateNorth = 0; - AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); - FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST ); + final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); + final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST ); ico.setFlip( false, true ); renderer.setRenderBounds( 0, 5 / 16.0, 5 / 16.0, 16 / 16.0, 11 / 16.0, 11 / 16.0 ); diff --git a/src/main/java/appeng/parts/networking/PartDenseCable.java b/src/main/java/appeng/parts/networking/PartDenseCable.java index 45c452ad..1bf4e48d 100644 --- a/src/main/java/appeng/parts/networking/PartDenseCable.java +++ b/src/main/java/appeng/parts/networking/PartDenseCable.java @@ -58,7 +58,7 @@ import appeng.util.Platform; public class PartDenseCable extends PartCable { @Reflected - public PartDenseCable( ItemStack is ) + public PartDenseCable( final ItemStack is ) { super( is ); @@ -78,17 +78,17 @@ public class PartDenseCable extends PartCable } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { - boolean noLadder = !bch.isBBCollision(); - double min = noLadder ? 3.0 : 4.9; - double max = noLadder ? 13.0 : 11.1; + final boolean noLadder = !bch.isBBCollision(); + final double min = noLadder ? 3.0 : 4.9; + final double max = noLadder ? 13.0 : 11.1; bch.addBox( min, min, min, max, max, max ); if( Platform.isServer() ) { - IGridNode n = this.getGridNode(); + final IGridNode n = this.getGridNode(); if( n != null ) { this.connections = n.getConnectedSides(); @@ -99,7 +99,7 @@ public class PartDenseCable extends PartCable } } - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { if( this.isDense( of ) ) { @@ -156,7 +156,7 @@ public class PartDenseCable extends PartCable @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { GL11.glTranslated( -0.0, -0.0, 0.3 ); rh.setBounds( 4.0f, 4.0f, 2.0f, 12.0f, 12.0f, 14.0f ); @@ -168,7 +168,7 @@ public class PartDenseCable extends PartCable OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); - for( EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) ) + for( final EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) ) { rh.renderInventoryFace( main, side, renderer ); rh.renderInventoryFace( ch1, side, renderer ); @@ -181,7 +181,7 @@ public class PartDenseCable extends PartCable ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV ); ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV ); - for( EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) ) + for( final EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) ) { rh.renderInventoryFace( main, side, renderer ); rh.renderInventoryFace( ch1, side, renderer ); @@ -192,7 +192,7 @@ public class PartDenseCable extends PartCable ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 ); ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 ); - for( EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) ) + for( final EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) ) { rh.renderInventoryFace( main, side, renderer ); rh.renderInventoryFace( ch1, side, renderer ); @@ -203,7 +203,7 @@ public class PartDenseCable extends PartCable } @Override - public IAESprite getTexture( AEColor c, ModelGenerator renderer ) + public IAESprite getTexture( final AEColor c, final ModelGenerator renderer ) { if( c == AEColor.Transparent ) { @@ -215,14 +215,14 @@ public class PartDenseCable extends PartCable @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( this.getTexture( this.getCableColor(), renderer ) ); - EnumSet sides = this.connections.clone(); + final EnumSet sides = this.connections.clone(); boolean hasBuses = false; - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { if( !this.isDense( of ) ) { @@ -232,7 +232,7 @@ public class PartDenseCable extends PartCable if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses ) { - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { if( this.isDense( of ) ) { @@ -256,21 +256,21 @@ public class PartDenseCable extends PartCable { AEPartLocation selectedSide = AEPartLocation.INTERNAL; - for( AEPartLocation of : this.connections ) + for( final AEPartLocation of : this.connections ) { selectedSide = of; break; } - int channels = this.channelsOnSide[selectedSide.ordinal()]; - IAESprite def = this.getTexture( this.getCableColor(), renderer ); - IAESprite off = new OffsetIcon( def, 0, -12 ); + final int channels = this.channelsOnSide[selectedSide.ordinal()]; + final IAESprite def = this.getTexture( this.getCableColor(), renderer ); + final IAESprite off = new OffsetIcon( def, 0, -12 ); - IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IAESprite firstOffset = new OffsetIcon( firstIcon, 0, -12 ); + final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IAESprite firstOffset = new OffsetIcon( firstIcon, 0, -12 ); - IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); - IAESprite secondOffset = new OffsetIcon( secondIcon, 0, -12 ); + final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IAESprite secondOffset = new OffsetIcon( secondIcon, 0, -12 ); switch( selectedSide ) { @@ -305,8 +305,8 @@ public class PartDenseCable extends PartCable renderer.uvRotateSouth = 0; renderer.uvRotateNorth = 0; - AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); - FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST ); + final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); + final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST ); ico.setFlip( false, true ); renderer.setRenderBounds( 0, 3 / 16.0, 3 / 16.0, 16 / 16.0, 13 / 16.0, 13 / 16.0 ); @@ -314,8 +314,8 @@ public class PartDenseCable extends PartCable renderer.setBrightness( 15 << 20 | 15 << 4 ); - FlippableIcon fpA = new FlippableIcon( firstIcon ); - FlippableIcon fpB = new FlippableIcon( secondIcon ); + final FlippableIcon fpA = new FlippableIcon( firstIcon ); + final FlippableIcon fpB = new FlippableIcon( secondIcon ); fpA.setFlip( true, false ); fpB.setFlip( true, false ); @@ -359,11 +359,11 @@ public class PartDenseCable extends PartCable } @SideOnly( Side.CLIENT ) - public void renderDenseConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, int channels, AEPartLocation of ) + public void renderDenseConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of ) { - TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) ); - IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; - IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; + final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) ); + final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; + final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; AEColor myColor = this.getCableColor(); /* * ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getPart( @@ -433,13 +433,13 @@ public class PartDenseCable extends PartCable rh.renderBlock( pos, renderer ); rh.setFacesToRender( EnumSet.allOf( EnumFacing.class ) ); - boolean isGlass = false; + final boolean isGlass = false; if( !isGlass ) { this.setSmartConnectionRotations( of, renderer ); - IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); - IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); + final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f ); + final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f ); renderer.setBrightness( 15 << 20 | 15 << 4 ); renderer.setColorOpaque_I( myColor.blackVariant ); @@ -454,18 +454,18 @@ public class PartDenseCable extends PartCable } } - private boolean isSmart( AEPartLocation of ) + private boolean isSmart( final AEPartLocation of ) { - TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) ); + final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) ); if( te instanceof IGridHost ) { - AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() ); + final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() ); return t == AECableType.SMART; } return false; } - private IAESprite getDenseTexture( AEColor c, ModelGenerator renderer ) + private IAESprite getDenseTexture( final AEColor c, final ModelGenerator renderer ) { switch( c ) { @@ -507,25 +507,25 @@ public class PartDenseCable extends PartCable return renderer.getIcon( is ); } - private boolean isDense( AEPartLocation of ) + private boolean isDense( final AEPartLocation of ) { - TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) ); + final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) ); if( te instanceof IGridHost ) { - AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() ); + final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() ); return t == AECableType.DENSE; } return false; } @MENetworkEventSubscribe - public void channelUpdated( MENetworkChannelsChanged c ) + public void channelUpdated( final MENetworkChannelsChanged c ) { this.getHost().markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } diff --git a/src/main/java/appeng/parts/networking/PartQuartzFiber.java b/src/main/java/appeng/parts/networking/PartQuartzFiber.java index 1697c5f5..23e4d02c 100644 --- a/src/main/java/appeng/parts/networking/PartQuartzFiber.java +++ b/src/main/java/appeng/parts/networking/PartQuartzFiber.java @@ -54,7 +54,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.proxy.getMachineRepresentation(), true ); - public PartQuartzFiber( ItemStack is ) + public PartQuartzFiber( final ItemStack is ) { super( is ); this.proxy.setIdlePowerUsage( 0 ); @@ -64,20 +64,20 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.GLASS; } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 6, 6, 10, 10, 10, 16 ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { GL11.glTranslated( -0.2, -0.3, 0.0 ); @@ -89,9 +89,9 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { - IAESprite myIcon = renderer.getIcon( is ); + final IAESprite myIcon = renderer.getIcon( is ); rh.setTexture( myIcon ); rh.setBounds( 6, 6, 10, 10, 10, 16 ); rh.renderBlock( pos, renderer ); @@ -99,14 +99,14 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { super.readFromNBT( extra ); this.outerProxy.readFromNBT( extra ); } @Override - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { super.writeToNBT( extra ); this.outerProxy.writeToNBT( extra ); @@ -127,7 +127,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile ) { super.setPartHostInfo( side, host, tile ); this.outerProxy.setValidSides( EnumSet.of( side.getFacing() ) ); @@ -146,33 +146,33 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side ) { super.onPlacement( player, held, side ); this.outerProxy.setOwner( player ); } @Override - public double extractAEPower( double amt, Actionable mode, Set seen ) + public double extractAEPower( final double amt, final Actionable mode, final Set seen ) { double acquiredPower = 0; try { - IEnergyGrid eg = this.proxy.getEnergy(); + final IEnergyGrid eg = this.proxy.getEnergy(); acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } try { - IEnergyGrid eg = this.outerProxy.getEnergy(); + final IEnergyGrid eg = this.outerProxy.getEnergy(); acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -181,31 +181,31 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public double injectAEPower( double amt, Actionable mode, Set seen ) + public double injectAEPower( final double amt, final Actionable mode, final Set seen ) { try { - IEnergyGrid eg = this.proxy.getEnergy(); + final IEnergyGrid eg = this.proxy.getEnergy(); if( !seen.contains( eg ) ) { return eg.injectAEPower( amt, mode, seen ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } try { - IEnergyGrid eg = this.outerProxy.getEnergy(); + final IEnergyGrid eg = this.outerProxy.getEnergy(); if( !seen.contains( eg ) ) { return eg.injectAEPower( amt, mode, seen ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -214,26 +214,26 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider } @Override - public double getEnergyDemand( double amt, Set seen ) + public double getEnergyDemand( final double amt, final Set seen ) { double demand = 0; try { - IEnergyGrid eg = this.proxy.getEnergy(); + final IEnergyGrid eg = this.proxy.getEnergy(); demand += eg.getEnergyDemand( amt - demand, seen ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } try { - IEnergyGrid eg = this.outerProxy.getEnergy(); + final IEnergyGrid eg = this.outerProxy.getEnergy(); demand += eg.getEnergyDemand( amt - demand, seen ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } diff --git a/src/main/java/appeng/parts/p2p/PartP2PItems.java b/src/main/java/appeng/parts/p2p/PartP2PItems.java index f7c7fe09..4a77cfb3 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PItems.java +++ b/src/main/java/appeng/parts/p2p/PartP2PItems.java @@ -62,7 +62,7 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe boolean requested; IInventory cachedInv; - public PartP2PItems( ItemStack is ) + public PartP2PItems( final ItemStack is ) { super( is ); } @@ -71,7 +71,7 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe public void onNeighborChanged() { this.cachedInv = null; - PartP2PItems input = this.getInput(); + final PartP2PItems input = this.getInput(); if( input != null && this.output ) { input.onTunnelNetworkChange(); @@ -87,21 +87,21 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe return this.cachedInv; } - List outs = new LinkedList(); - TunnelCollection itemTunnels; + final List outs = new LinkedList(); + final TunnelCollection itemTunnels; try { itemTunnels = this.getOutputs(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return new AppEngNullInventory(); } - for( PartP2PItems t : itemTunnels ) + for( final PartP2PItems t : itemTunnels ) { - IInventory inv = t.getOutputInv(); + final IInventory inv = t.getOutputInv(); if( inv != null ) { if( Platform.getRandomInt() % 2 == 0 ) @@ -124,7 +124,7 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe if( this.proxy.isActive() ) { - TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) ); + final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) ); if( this.which.contains( this ) ) { @@ -142,7 +142,7 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe { output = new WrapperBCPipe( te, this.side.getFacing().getOpposite() ); } - catch( Throwable ignore ) + catch( final Throwable ignore ) { } } @@ -177,15 +177,15 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.ItemTunnel.min, TickRates.ItemTunnel.max, false, false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { - boolean wasReq = this.requested; + final boolean wasReq = this.requested; if( this.requested && this.cachedInv != null ) { @@ -197,12 +197,12 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe } @MENetworkEventSubscribe - public void changeStateA( MENetworkBootingStatusChange bs ) + public void changeStateA( final MENetworkBootingStatusChange bs ) { if( !this.output ) { this.cachedInv = null; - int olderSize = this.oldSize; + final int olderSize = this.oldSize; this.oldSize = this.getDestination().getSizeInventory(); if( olderSize != this.oldSize ) { @@ -212,12 +212,12 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe } @MENetworkEventSubscribe - public void changeStateB( MENetworkChannelsChanged bs ) + public void changeStateB( final MENetworkChannelsChanged bs ) { if( !this.output ) { this.cachedInv = null; - int olderSize = this.oldSize; + final int olderSize = this.oldSize; this.oldSize = this.getDestination().getSizeInventory(); if( olderSize != this.oldSize ) { @@ -227,12 +227,12 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe } @MENetworkEventSubscribe - public void changeStateC( MENetworkPowerStatusChange bs ) + public void changeStateC( final MENetworkPowerStatusChange bs ) { if( !this.output ) { this.cachedInv = null; - int olderSize = this.oldSize; + final int olderSize = this.oldSize; this.oldSize = this.getDestination().getSizeInventory(); if( olderSize != this.oldSize ) { @@ -247,7 +247,7 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe if( !this.output ) { this.cachedInv = null; - int olderSize = this.oldSize; + final int olderSize = this.oldSize; this.oldSize = this.getDestination().getSizeInventory(); if( olderSize != this.oldSize ) { @@ -256,7 +256,7 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe } else { - PartP2PItems input = this.getInput(); + final PartP2PItems input = this.getInput(); if( input != null ) { input.getHost().notifyNeighbors(); @@ -266,9 +266,9 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe @Override public int[] getSlotsForFace( - EnumFacing side ) + final EnumFacing side ) { - int[] slots = new int[this.getSizeInventory()]; + final int[] slots = new int[this.getSizeInventory()]; for( int x = 0; x < this.getSizeInventory(); x++ ) { slots[x] = x; @@ -283,25 +283,25 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.getDestination().getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return this.getDestination().decrStackSize( i, j ); } @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 ) { this.getDestination().setInventorySlotContents( i, itemstack ); } @@ -331,35 +331,35 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return false; } @Override - public void openInventory(EntityPlayer p) + public void openInventory( final EntityPlayer p) { } @Override - public void closeInventory(EntityPlayer p) + public void closeInventory( final EntityPlayer p) { } @Override - public boolean isItemValidForSlot( int i, net.minecraft.item.ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final net.minecraft.item.ItemStack itemstack ) { return this.getDestination().isItemValidForSlot( i, itemstack ); } @Override - public boolean canInsertItem( int i, ItemStack itemstack, EnumFacing j ) + public boolean canInsertItem( final int i, final ItemStack itemstack, final EnumFacing j ) { return this.getDestination().isItemValidForSlot( i, itemstack ); } @Override - public boolean canExtractItem( int i, ItemStack itemstack, EnumFacing j ) + public boolean canExtractItem( final int i, final ItemStack itemstack, final EnumFacing j ) { return false; } @@ -370,7 +370,7 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe } @Override - public int getField( int id ) + public int getField( final int id ) { return 0; } @@ -384,8 +384,8 @@ public class PartP2PItems extends PartP2PTunnel implements /*IPipe @Override public void setField( - int id, - int value ) + final int id, + final int value ) { } diff --git a/src/main/java/appeng/parts/p2p/PartP2PLight.java b/src/main/java/appeng/parts/p2p/PartP2PLight.java index 2e4c9ee8..f0bfb15f 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLight.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLight.java @@ -43,34 +43,34 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi int lastValue = 0; float opacity = -1; - public PartP2PLight( ItemStack is ) + public PartP2PLight( final ItemStack is ) { super( is ); } @Override - public void chanRender( MENetworkChannelsChanged c ) + public void chanRender( final MENetworkChannelsChanged c ) { this.onTunnelNetworkChange(); super.chanRender( c ); } @Override - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.onTunnelNetworkChange(); super.powerRender( c ); } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { super.writeToStream( data ); data.writeInt( this.output ? this.lastValue : 0 ); } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { super.readFromStream( data ); this.lastValue = data.readInt(); @@ -85,22 +85,22 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi return false; } - TileEntity te = this.getTile(); - World w = te.getWorld(); + final TileEntity te = this.getTile(); + final World w = te.getWorld(); - int newLevel = w.getLight( te.getPos().offset( side.getFacing() ) ); + final int newLevel = w.getLight( te.getPos().offset( side.getFacing() ) ); if( this.lastValue != newLevel && this.proxy.isActive() ) { this.lastValue = newLevel; try { - for( PartP2PLight out : this.getOutputs() ) + for( final PartP2PLight out : this.getOutputs() ) { out.setLightLevel( this.lastValue ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -133,17 +133,17 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi return 0; } - public void setLightLevel( int out ) + public void setLightLevel( final int out ) { this.lastValue = out; this.getHost().markForUpdate(); } - private int blockLight( int emit ) + private int blockLight( final int emit ) { if( this.opacity < 0 ) { - TileEntity te = this.getTile(); + final TileEntity te = this.getTile(); this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( side.getFacing() ) ); } @@ -151,7 +151,7 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi } @Override - public void readFromNBT( NBTTagCompound tag ) + public void readFromNBT( final NBTTagCompound tag ) { super.readFromNBT( tag ); if( tag.hasKey( "opacity" ) ) @@ -162,7 +162,7 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi } @Override - public void writeToNBT( NBTTagCompound tag ) + public void writeToNBT( final NBTTagCompound tag ) { super.writeToNBT( tag ); tag.setFloat( "opacity", this.opacity ); @@ -180,7 +180,7 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi { if( this.output ) { - PartP2PLight src = this.getInput(); + final PartP2PLight src = this.getInput(); if( src != null && src.proxy.isActive() ) { this.setLightLevel( src.lastValue ); @@ -197,13 +197,13 @@ public class PartP2PLight extends PartP2PTunnel implements IGridTi } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.LightTunnel.min, TickRates.LightTunnel.max, false, false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.doWork() ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } diff --git a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java index 3e4c7bdb..a0d73c98 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java @@ -43,7 +43,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl IFluidHandler cachedTank; private int tmpUsed; - public PartP2PLiquids( ItemStack is ) + public PartP2PLiquids( final ItemStack is ) { super( is ); } @@ -65,7 +65,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl this.cachedTank = null; if( this.output ) { - PartP2PLiquids in = this.getInput(); + final PartP2PLiquids in = this.getInput(); if( in != null ) { in.onTunnelNetworkChange(); @@ -74,11 +74,11 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl } @Override - public int fill( EnumFacing from, FluidStack resource, boolean doFill ) + public int fill( final EnumFacing from, final FluidStack resource, final boolean doFill ) { - Stack stack = this.getDepth(); + final Stack stack = this.getDepth(); - for( PartP2PLiquids t : stack ) + for( final PartP2PLiquids t : stack ) { if( t == this ) { @@ -88,14 +88,14 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl stack.push( this ); - List list = this.getOutputs( resource.getFluid() ); + final List list = this.getOutputs( resource.getFluid() ); int requestTotal = 0; Iterator i = list.iterator(); while( i.hasNext() ) { - PartP2PLiquids l = i.next(); - IFluidHandler tank = l.getTarget(); + final PartP2PLiquids l = i.next(); + final IFluidHandler tank = l.getTarget(); if( tank != null ) { l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), resource.copy(), false ); @@ -141,16 +141,16 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl int used = 0; while( i.hasNext() ) { - PartP2PLiquids l = i.next(); + final PartP2PLiquids l = i.next(); - FluidStack insert = resource.copy(); + final FluidStack insert = resource.copy(); insert.amount = (int) Math.ceil( insert.amount * ( (double) l.tmpUsed / (double) requestTotal ) ); if( insert.amount > available ) { insert.amount = available; } - IFluidHandler tank = l.getTarget(); + final IFluidHandler tank = l.getTarget(); if( tank != null ) { l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), insert.copy(), true ); @@ -184,15 +184,15 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl return s; } - List getOutputs( Fluid input ) + List getOutputs( final Fluid input ) { - List outs = new LinkedList(); + final List outs = new LinkedList(); try { - for( PartP2PLiquids l : this.getOutputs() ) + for( final PartP2PLiquids l : this.getOutputs() ) { - IFluidHandler handler = l.getTarget(); + final IFluidHandler handler = l.getTarget(); if( handler != null ) { if( handler.canFill( l.side.getFacing().getOpposite(), input ) ) @@ -202,7 +202,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -222,7 +222,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl return this.cachedTank; } - TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) ); + final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) ); if( te instanceof IFluidHandler ) { return this.cachedTank = (IFluidHandler) te; @@ -232,31 +232,31 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl } @Override - public FluidStack drain( EnumFacing from, FluidStack resource, boolean doDrain ) + public FluidStack drain( final EnumFacing from, final FluidStack resource, final boolean doDrain ) { return null; } @Override - public FluidStack drain( EnumFacing from, int maxDrain, boolean doDrain ) + public FluidStack drain( final EnumFacing from, final int maxDrain, final boolean doDrain ) { return null; } @Override - public boolean canFill( EnumFacing from, Fluid fluid ) + public boolean canFill( final EnumFacing from, final Fluid fluid ) { return !this.output && from == this.side.getFacing() && !this.getOutputs( fluid ).isEmpty(); } @Override - public boolean canDrain( EnumFacing from, Fluid fluid ) + public boolean canDrain( final EnumFacing from, final Fluid fluid ) { return false; } @Override - public FluidTankInfo[] getTankInfo( EnumFacing from ) + public FluidTankInfo[] getTankInfo( final EnumFacing from ) { if( from == this.side.getFacing() ) { @@ -269,7 +269,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl { if( this.output ) { - PartP2PLiquids tun = this.getInput(); + final PartP2PLiquids tun = this.getInput(); if( tun != null ) { return ACTIVE_TANK; @@ -284,7 +284,7 @@ public class PartP2PLiquids extends PartP2PTunnel implements IFl return ACTIVE_TANK; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } diff --git a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java index 5582c6fa..3e79c43b 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java +++ b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java @@ -41,13 +41,13 @@ public class PartP2PRedstone extends PartP2PTunnel int power; boolean recursive = false; - public PartP2PRedstone( ItemStack is ) + public PartP2PRedstone( final ItemStack is ) { super( is ); } @MENetworkEventSubscribe - public void changeStateA( MENetworkBootingStatusChange bs ) + public void changeStateA( final MENetworkBootingStatusChange bs ) { this.setNetworkReady(); } @@ -56,7 +56,7 @@ public class PartP2PRedstone extends PartP2PTunnel { if( this.output ) { - PartP2PRedstone in = this.getInput(); + final PartP2PRedstone in = this.getInput(); if( in != null ) { this.putInput( in.power ); @@ -64,7 +64,7 @@ public class PartP2PRedstone extends PartP2PTunnel } } - protected void putInput( Object o ) + protected void putInput( final Object o ) { if( this.recursive ) { @@ -74,7 +74,7 @@ public class PartP2PRedstone extends PartP2PTunnel this.recursive = true; if( this.output && this.proxy.isActive() ) { - int newPower = (Integer) o; + final int newPower = (Integer) o; if( this.power != newPower ) { this.power = newPower; @@ -86,36 +86,36 @@ public class PartP2PRedstone extends PartP2PTunnel public void notifyNeighbors() { - World worldObj = this.tile.getWorld(); + final World worldObj = this.tile.getWorld(); Platform.notifyBlocksOfNeighbors( worldObj,tile.getPos()); // and this cause sometimes it can go thought walls. - for ( EnumFacing face : EnumFacing.VALUES ) + for ( final EnumFacing face : EnumFacing.VALUES ) Platform.notifyBlocksOfNeighbors( worldObj,tile.getPos().offset( face ) ); } @MENetworkEventSubscribe - public void changeStateB( MENetworkChannelsChanged bs ) + public void changeStateB( final MENetworkChannelsChanged bs ) { this.setNetworkReady(); } @MENetworkEventSubscribe - public void changeStateC( MENetworkPowerStatusChange bs ) + public void changeStateC( final MENetworkPowerStatusChange bs ) { this.setNetworkReady(); } @Override - public void readFromNBT( NBTTagCompound tag ) + public void readFromNBT( final NBTTagCompound tag ) { super.readFromNBT( tag ); this.power = tag.getInteger( "power" ); } @Override - public void writeToNBT( NBTTagCompound tag ) + public void writeToNBT( final NBTTagCompound tag ) { super.writeToNBT( tag ); tag.setInteger( "power", this.power ); @@ -137,10 +137,10 @@ public class PartP2PRedstone extends PartP2PTunnel { if( !this.output ) { - BlockPos target = tile.getPos().offset( side.getFacing() ); + final BlockPos target = tile.getPos().offset( side.getFacing() ); - IBlockState state = this.tile.getWorld().getBlockState( target ); - Block b = state.getBlock(); + final IBlockState state = this.tile.getWorld().getBlockState( target ); + final Block b = state.getBlock(); if( b != null && !this.output ) { EnumFacing srcSide = this.side.getFacing(); @@ -178,16 +178,16 @@ public class PartP2PRedstone extends PartP2PTunnel return this.output ? this.power : 0; } - private void sendToOutput( int power ) + private void sendToOutput( final int power ) { try { - for( PartP2PRedstone rs : this.getOutputs() ) + for( final PartP2PRedstone rs : this.getOutputs() ) { rs.putInput( power ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java index c204251d..a475c10f 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java @@ -65,12 +65,12 @@ public abstract class PartP2PTunnel extends PartBasicSt public boolean output; public long freq; - public PartP2PTunnel( ItemStack is ) + public PartP2PTunnel( final ItemStack is ) { super( is ); } - public TunnelCollection getCollection( Collection collection, Class c ) + public TunnelCollection getCollection( final Collection collection, final Class c ) { if( this.type.matches( c ) ) { @@ -88,16 +88,15 @@ public abstract class PartP2PTunnel extends PartBasicSt return null; } - PartP2PTunnel tunnel; try { - tunnel = this.proxy.getP2P().getInput( this.freq ); + final PartP2PTunnel tunnel = this.proxy.getP2P().getInput( this.freq ); if( this.getClass().isInstance( tunnel ) ) { return (T) tunnel; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -114,7 +113,7 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public void getBoxes( IPartCollisionHelper bch ) + public void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 5, 5, 12, 11, 11, 13 ); bch.addBox( 3, 3, 13, 13, 13, 14 ); @@ -123,7 +122,7 @@ public abstract class PartP2PTunnel extends PartBasicSt @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( this.getTypeTexture(renderer) ); @@ -140,7 +139,7 @@ public abstract class PartP2PTunnel extends PartBasicSt * @param renderer * @return If enabled it returns the icon of an AE quartz block, else vanilla quartz block icon */ - protected IAESprite getTypeTexture(ModelGenerator renderer ) + protected IAESprite getTypeTexture( final ModelGenerator renderer ) { final Optional maybeBlock = AEApi.instance().definitions().blocks().quartz().maybeBlock(); if( maybeBlock.isPresent() ) @@ -155,7 +154,7 @@ public abstract class PartP2PTunnel extends PartBasicSt @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setTexture( this.getTypeTexture(renderer) ); @@ -182,7 +181,7 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public ItemStack getItemStack( PartItemStack type ) + public ItemStack getItemStack( final PartItemStack type ) { if( type == PartItemStack.World || type == PartItemStack.Network || type == PartItemStack.Wrench || type == PartItemStack.Pick ) { @@ -199,7 +198,7 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.output = data.getBoolean( "output" ); @@ -207,7 +206,7 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setBoolean( "output", this.output ); @@ -227,44 +226,44 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { - ItemStack is = player.inventory.getCurrentItem(); + final ItemStack is = player.inventory.getCurrentItem(); // UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() ); // AELog.info( "ID:" + id.toString() + " : " + is.getItemDamage() ); - TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem( is ); + final TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem( is ); if( is != null && is.getItem() instanceof IMemoryCard ) { - IMemoryCard mc = (IMemoryCard) is.getItem(); - NBTTagCompound data = mc.getData( is ); + final IMemoryCard mc = (IMemoryCard) is.getItem(); + final NBTTagCompound data = mc.getData( is ); - ItemStack newType = ItemStack.loadItemStackFromNBT( data ); - long freq = data.getLong( "freq" ); + final ItemStack newType = ItemStack.loadItemStackFromNBT( data ); + final long freq = data.getLong( "freq" ); if( newType != null ) { if( newType.getItem() instanceof IPartItem ) { - IPart testPart = ( (IPartItem) newType.getItem() ).createPartFromItemStack( newType ); + final IPart testPart = ( (IPartItem) newType.getItem() ).createPartFromItemStack( newType ); if( testPart instanceof PartP2PTunnel ) { this.getHost().removePart( this.side, true ); - AEPartLocation dir = this.getHost().addPart( newType, this.side, player ); - IPart newBus = this.getHost().getPart( dir ); + final AEPartLocation dir = this.getHost().addPart( newType, this.side, player ); + final IPart newBus = this.getHost().getPart( dir ); if( newBus instanceof PartP2PTunnel ) { - PartP2PTunnel newTunnel = (PartP2PTunnel) newBus; + final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus; newTunnel.output = true; try { - P2PCache p2p = newTunnel.proxy.getP2P(); + final P2PCache p2p = newTunnel.proxy.getP2P(); p2p.updateFreq( newTunnel, freq ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -288,7 +287,7 @@ public abstract class PartP2PTunnel extends PartBasicSt switch( tt ) { case LIGHT: - for( ItemStack stack : parts.p2PTunnelLight().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelLight().maybeStack( 1 ).asSet() ) { newType = stack; } @@ -304,7 +303,7 @@ public abstract class PartP2PTunnel extends PartBasicSt */ case FLUID: - for( ItemStack stack : parts.p2PTunnelLiquids().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelLiquids().maybeStack( 1 ).asSet() ) { newType = stack; } @@ -320,21 +319,21 @@ public abstract class PartP2PTunnel extends PartBasicSt */ case ITEM: - for( ItemStack stack : parts.p2PTunnelItems().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelItems().maybeStack( 1 ).asSet() ) { newType = stack; } break; case ME: - for( ItemStack stack : parts.p2PTunnelME().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelME().maybeStack( 1 ).asSet() ) { newType = stack; } break; case REDSTONE: - for( ItemStack stack : parts.p2PTunnelRedstone().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : parts.p2PTunnelRedstone().maybeStack( 1 ).asSet() ) { newType = stack; } @@ -363,25 +362,25 @@ public abstract class PartP2PTunnel extends PartBasicSt if( newType != null && !Platform.isSameItem( newType, this.is ) ) { - boolean oldOutput = this.output; - long myFreq = this.freq; + final boolean oldOutput = this.output; + final long myFreq = this.freq; this.getHost().removePart( this.side, false ); - AEPartLocation dir = this.getHost().addPart( newType, this.side, player ); - IPart newBus = this.getHost().getPart( dir ); + final AEPartLocation dir = this.getHost().addPart( newType, this.side, player ); + final IPart newBus = this.getHost().getPart( dir ); if( newBus instanceof PartP2PTunnel ) { - PartP2PTunnel newTunnel = (PartP2PTunnel) newBus; + final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus; newTunnel.output = oldOutput; newTunnel.onTunnelNetworkChange(); try { - P2PCache p2p = newTunnel.proxy.getP2P(); + final P2PCache p2p = newTunnel.proxy.getP2P(); p2p.updateFreq( newTunnel, myFreq ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -396,16 +395,16 @@ public abstract class PartP2PTunnel extends PartBasicSt } @Override - public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos ) { - ItemStack is = player.inventory.getCurrentItem(); + final ItemStack is = player.inventory.getCurrentItem(); if( is != null && is.getItem() instanceof IMemoryCard ) { - IMemoryCard mc = (IMemoryCard) is.getItem(); - NBTTagCompound data = new NBTTagCompound(); + final IMemoryCard mc = (IMemoryCard) is.getItem(); + final NBTTagCompound data = new NBTTagCompound(); long newFreq = this.freq; - boolean wasOutput = this.output; + final boolean wasOutput = this.output; this.output = false; if( wasOutput || this.freq == 0 ) @@ -417,15 +416,15 @@ public abstract class PartP2PTunnel extends PartBasicSt { this.proxy.getP2P().updateFreq( this, newFreq ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } this.onTunnelConfigChange(); - ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench ); - String type = p2pItem.getUnlocalizedName(); + final ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench ); + final String type = p2pItem.getUnlocalizedName(); p2pItem.writeToNBT( data ); data.setLong( "freq", this.freq ); @@ -448,20 +447,20 @@ public abstract class PartP2PTunnel extends PartBasicSt @Override @SideOnly( Side.CLIENT ) - public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer ) + public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer ) { return CableBusTextures.BlockP2PTunnel2.getIcon().getAtlas(); } - protected void queueTunnelDrain( PowerUnits unit, double f ) + protected void queueTunnelDrain( final PowerUnits unit, final double f ) { - double ae_to_tax = unit.convertTo( PowerUnits.AE, f * AEConfig.TUNNEL_POWER_LOSS ); + final double ae_to_tax = unit.convertTo( PowerUnits.AE, f * AEConfig.TUNNEL_POWER_LOSS ); try { this.proxy.getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java index 2ab9d634..3be587c0 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java @@ -52,7 +52,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I public final Connections connection = new Connections( this ); final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", null, true ); - public PartP2PTunnelME( ItemStack is ) + public PartP2PTunnelME( final ItemStack is ) { super( is ); this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL ); @@ -60,14 +60,14 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } @Override - public void readFromNBT( NBTTagCompound extra ) + public void readFromNBT( final NBTTagCompound extra ) { super.readFromNBT( extra ); this.outerProxy.readFromNBT( extra ); } @Override - public void writeToNBT( NBTTagCompound extra ) + public void writeToNBT( final NBTTagCompound extra ) { super.writeToNBT( extra ); this.outerProxy.writeToNBT( extra ); @@ -83,7 +83,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I { this.proxy.getTick().wakeDevice( this.proxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -91,7 +91,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.DENSE; } @@ -111,7 +111,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } @Override - public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile ) + public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile ) { super.setPartHostInfo( side, host, tile ); this.outerProxy.setValidSides( EnumSet.of( side.getFacing() ) ); @@ -124,20 +124,20 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } @Override - public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side ) + public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side ) { super.onPlacement( player, held, side ); this.outerProxy.setOwner( player ); } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.METunnel.min, TickRates.METunnel.max, true, false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { // just move on... try @@ -166,7 +166,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I return TickRateModulation.SLEEP; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // meh? } @@ -174,11 +174,11 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I return TickRateModulation.IDLE; } - public void updateConnections( Connections connections ) + public void updateConnections( final Connections connections ) { if( connections.destroy ) { - for( TunnelConnection cw : this.connection.connections.values() ) + for( final TunnelConnection cw : this.connection.connections.values() ) { cw.c.destroy(); } @@ -188,10 +188,10 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I else if( connections.create ) { - Iterator i = this.connection.connections.values().iterator(); + final Iterator i = this.connection.connections.values().iterator(); while( i.hasNext() ) { - TunnelConnection cw = i.next(); + final TunnelConnection cw = i.next(); try { if( cw.tunnel.proxy.getGrid() != this.proxy.getGrid() ) @@ -205,16 +205,16 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I i.remove(); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } - LinkedList newSides = new LinkedList(); + final LinkedList newSides = new LinkedList(); try { - for( PartP2PTunnelME me : this.getOutputs() ) + for( final PartP2PTunnelME me : this.getOutputs() ) { if( me.proxy.isActive() && connections.connections.get( me.getGridNode() ) == null ) { @@ -222,13 +222,13 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } } - for( PartP2PTunnelME me : newSides ) + for( final PartP2PTunnelME me : newSides ) { try { connections.connections.put( me.getGridNode(), new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) ); } - catch( FailedConnection e ) + catch( final FailedConnection e ) { final TileEntity start = this.getTile(); final TileEntity end = me.getTile(); @@ -239,7 +239,7 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java b/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java index af80f0e2..06484433 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java @@ -45,14 +45,14 @@ import appeng.client.texture.IAESprite; public abstract class AbstractPartDisplay extends AbstractPartReporting { - public AbstractPartDisplay( ItemStack is ) + public AbstractPartDisplay( final ItemStack is ) { super( is, true ); } @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setBounds( 2, 2, 14, 14, 14, 16 ); @@ -77,7 +77,7 @@ public abstract class AbstractPartDisplay extends AbstractPartReporting @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { final IAESprite sideTexture = CableBusTextures.PartMonitorSides.getIcon(); final IAESprite backTexture = CableBusTextures.PartMonitorBack.getIcon(); diff --git a/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java b/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java index 24a2074b..0310d4f4 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java @@ -88,13 +88,13 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements private Integer dspList; @Reflected - public AbstractPartMonitor( ItemStack is ) + public AbstractPartMonitor( final ItemStack is ) { super( is ); } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); @@ -105,7 +105,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); @@ -121,7 +121,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { super.writeToStream( data ); @@ -134,7 +134,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { boolean needRedraw = super.readFromStream( data ); @@ -159,7 +159,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( Platform.isClient() ) { @@ -225,12 +225,12 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } } - protected void extractItem( EntityPlayer player ) + protected void extractItem( final EntityPlayer player ) { } - private void updateReportingValue( IMEMonitor itemInventory ) + private void updateReportingValue( final IMEMonitor itemInventory ) { if( this.configuredItem != null ) { @@ -260,7 +260,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements @Override @SideOnly( Side.CLIENT ) - public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderDynamic( final double x, final double y, final double z, final IPartRenderHelper rh, final ModelGenerator renderer ) { if( this.dspList == null ) { @@ -310,7 +310,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements return this.configuredItem; } - private void tesrRenderScreen( WorldRenderer wr, IAEItemStack ais ) + private void tesrRenderScreen( final WorldRenderer wr, final IAEItemStack ais ) { // GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); @@ -403,14 +403,14 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public void updateWatcher( IStackWatcher newWatcher ) + public void updateWatcher( final IStackWatcher newWatcher ) { this.myWatcher = newWatcher; this.configureWatchers(); } @Override - public void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan ) + public void onStackChange( final IItemList o, final IAEStack fullStack, final IAEStack diffStack, final BaseActionSource src, final StorageChannel chan ) { if( this.configuredItem != null ) { @@ -435,7 +435,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements } @Override - public boolean showNetworkInfo( MovingObjectPosition where ) + public boolean showNetworkInfo( final MovingObjectPosition where ) { return false; } diff --git a/src/main/java/appeng/parts/reporting/AbstractPartPanel.java b/src/main/java/appeng/parts/reporting/AbstractPartPanel.java index 72371602..17dd49e5 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartPanel.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartPanel.java @@ -48,7 +48,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartMonitor_Colored; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartMonitor_Colored; - public AbstractPartPanel( ItemStack is ) + public AbstractPartPanel( final ItemStack is ) { super( is, false ); } @@ -79,7 +79,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting @Override @SideOnly( Side.CLIENT ) - public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer ) + public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer ) { rh.setBounds( 2, 2, 14, 14, 14, 16 ); @@ -98,7 +98,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting @Override @SideOnly( Side.CLIENT ) - public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) + public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer ) { final IAESprite sideTexture = CableBusTextures.PartMonitorSides.getIcon(); final IAESprite backTexture = CableBusTextures.PartMonitorBack.getIcon(); diff --git a/src/main/java/appeng/parts/reporting/AbstractPartReporting.java b/src/main/java/appeng/parts/reporting/AbstractPartReporting.java index 2b8fa1e3..9413ffa3 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartReporting.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartReporting.java @@ -69,12 +69,12 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM private int clientFlags = 0; // sent as byte. private float opacity = -1; - public AbstractPartReporting( ItemStack is ) + public AbstractPartReporting( final ItemStack is ) { this( is, false ); } - protected AbstractPartReporting( ItemStack is, boolean requireChannel ) + protected AbstractPartReporting( final ItemStack is, final boolean requireChannel ) { super( is ); @@ -90,7 +90,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @MENetworkEventSubscribe - public final void bootingRender( MENetworkBootingStatusChange c ) + public final void bootingRender( final MENetworkBootingStatusChange c ) { if( !this.isLightSource() ) { @@ -99,13 +99,13 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @MENetworkEventSubscribe - public final void powerRender( MENetworkPowerStatusChange c ) + public final void powerRender( final MENetworkPowerStatusChange c ) { this.getHost().markForUpdate(); } @Override - public final void getBoxes( IPartCollisionHelper bch ) + public final void getBoxes( final IPartCollisionHelper bch ) { bch.addBox( 2, 2, 14, 14, 14, 16 ); bch.addBox( 4, 4, 13, 12, 12, 14 ); @@ -119,7 +119,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); if( data.hasKey( "opacity" ) ) @@ -130,7 +130,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setFloat( "opacity", this.opacity ); @@ -138,7 +138,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public void writeToStream( ByteBuf data ) throws IOException + public void writeToStream( final ByteBuf data ) throws IOException { super.writeToStream( data ); this.clientFlags = this.getSpin() & 3; @@ -169,7 +169,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public boolean readFromStream( ByteBuf data ) throws IOException + public boolean readFromStream( final ByteBuf data ) throws IOException { super.readFromStream( data ); final int oldFlags = this.getClientFlags(); @@ -189,7 +189,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { final TileEntity te = this.getTile(); @@ -230,7 +230,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } @Override - public final void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side ) + public final void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side ) { super.onPlacement( player, held, side ); @@ -245,7 +245,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM } } - private final int blockLight( int emit ) + private final int blockLight( final int emit ) { if( this.opacity < 0 ) { diff --git a/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java b/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java index 22c184c8..c8e379f9 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java @@ -64,7 +64,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement private final IConfigManager cm = new ConfigManager( this ); private final AppEngInternalInventory viewCell = new AppEngInternalInventory( this, 5 ); - public AbstractPartTerminal( ItemStack is ) + public AbstractPartTerminal( final ItemStack is ) { super( is ); @@ -74,7 +74,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { super.getDrops( drops, wrenched ); @@ -94,7 +94,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.cm.readFromNBT( data ); @@ -102,7 +102,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.cm.writeToNBT( data ); @@ -110,7 +110,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !super.onPartActivate( player, pos ) ) { @@ -129,7 +129,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement return false; } - public GuiBridge getGui( EntityPlayer player ) + public GuiBridge getGui( final EntityPlayer player ) { return GuiBridge.GUI_ME; } @@ -163,7 +163,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } @@ -175,7 +175,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { this.host.markForSave(); } diff --git a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java index 3e95b07e..6771d6a1 100644 --- a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java @@ -47,13 +47,13 @@ public class PartConversionMonitor extends AbstractPartMonitor private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartConversionMonitor_Colored; @Reflected - public PartConversionMonitor( ItemStack is ) + public PartConversionMonitor( final ItemStack is ) { super( is ); } @Override - public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos ) { if( Platform.isClient() ) { @@ -121,7 +121,7 @@ public class PartConversionMonitor extends AbstractPartMonitor } @Override - protected void extractItem( EntityPlayer player ) + protected void extractItem( final EntityPlayer player ) { final IAEItemStack input = (IAEItemStack) this.getDisplayed(); if( input != null ) diff --git a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java index 1676beaf..2b4b520d 100644 --- a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java @@ -40,13 +40,13 @@ public class PartCraftingTerminal extends AbstractPartTerminal private final AppEngInternalInventory craftingGrid = new AppEngInternalInventory( this, 9 ); @Reflected - public PartCraftingTerminal( ItemStack is ) + public PartCraftingTerminal( final ItemStack is ) { super( is ); } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { super.getDrops( drops, wrenched ); @@ -60,21 +60,21 @@ public class PartCraftingTerminal extends AbstractPartTerminal } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.craftingGrid.readFromNBT( data, "craftingGrid" ); } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); this.craftingGrid.writeToNBT( data, "craftingGrid" ); } @Override - public GuiBridge getGui( EntityPlayer p ) + public GuiBridge getGui( final EntityPlayer p ) { int x = (int) p.posX; int y = (int) p.posY; @@ -94,7 +94,7 @@ public class PartCraftingTerminal extends AbstractPartTerminal } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "crafting" ) ) { diff --git a/src/main/java/appeng/parts/reporting/PartDarkPanel.java b/src/main/java/appeng/parts/reporting/PartDarkPanel.java index feea7196..d5291240 100644 --- a/src/main/java/appeng/parts/reporting/PartDarkPanel.java +++ b/src/main/java/appeng/parts/reporting/PartDarkPanel.java @@ -28,7 +28,7 @@ public class PartDarkPanel extends AbstractPartPanel { @Reflected - public PartDarkPanel( ItemStack is ) + public PartDarkPanel( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java b/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java index 96105eba..c80c738d 100644 --- a/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java @@ -33,13 +33,13 @@ public class PartInterfaceTerminal extends AbstractPartDisplay private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartInterfaceTerm_Dark; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartInterfaceTerm_Colored; - public PartInterfaceTerminal( ItemStack is ) + public PartInterfaceTerminal( final ItemStack is ) { super( is ); } @Override - public boolean onPartActivate( EntityPlayer player, Vec3 pos ) + public boolean onPartActivate( final EntityPlayer player, final Vec3 pos ) { if( !super.onPartActivate( player, pos ) ) { diff --git a/src/main/java/appeng/parts/reporting/PartPanel.java b/src/main/java/appeng/parts/reporting/PartPanel.java index 3e0f796b..073ae6da 100644 --- a/src/main/java/appeng/parts/reporting/PartPanel.java +++ b/src/main/java/appeng/parts/reporting/PartPanel.java @@ -28,7 +28,7 @@ public class PartPanel extends AbstractPartPanel { @Reflected - public PartPanel( ItemStack is ) + public PartPanel( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java index f8ed10ba..32451a55 100644 --- a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java @@ -48,13 +48,13 @@ public class PartPatternTerminal extends AbstractPartTerminal private boolean craftingMode = true; @Reflected - public PartPatternTerminal( ItemStack is ) + public PartPatternTerminal( final ItemStack is ) { super( is ); } @Override - public void getDrops( List drops, boolean wrenched ) + public void getDrops( final List drops, final boolean wrenched ) { for( final ItemStack is : this.pattern ) { @@ -66,7 +66,7 @@ public class PartPatternTerminal extends AbstractPartTerminal } @Override - public void readFromNBT( NBTTagCompound data ) + public void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); this.setCraftingRecipe( data.getBoolean( "craftingMode" ) ); @@ -76,7 +76,7 @@ public class PartPatternTerminal extends AbstractPartTerminal } @Override - public void writeToNBT( NBTTagCompound data ) + public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setBoolean( "craftingMode", this.craftingMode ); @@ -86,7 +86,7 @@ public class PartPatternTerminal extends AbstractPartTerminal } @Override - public GuiBridge getGui( EntityPlayer p ) + public GuiBridge getGui( final EntityPlayer p ) { int x = (int) p.posX; int y = (int) p.posY; @@ -106,7 +106,7 @@ public class PartPatternTerminal extends AbstractPartTerminal } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( inv == this.pattern && slot == 1 ) { @@ -161,14 +161,14 @@ public class PartPatternTerminal extends AbstractPartTerminal return this.craftingMode; } - public void setCraftingRecipe( boolean craftingMode ) + public void setCraftingRecipe( final boolean craftingMode ) { this.craftingMode = craftingMode; this.fixCraftingRecipes(); } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "crafting" ) ) { diff --git a/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java b/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java index 060522a3..6ba84edd 100644 --- a/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java +++ b/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java @@ -28,7 +28,7 @@ public class PartSemiDarkPanel extends AbstractPartPanel { @Reflected - public PartSemiDarkPanel( ItemStack is ) + public PartSemiDarkPanel( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java index 50d30b80..c7596c8b 100644 --- a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java @@ -39,7 +39,7 @@ public class PartStorageMonitor extends AbstractPartMonitor private static final CableBusTextures FRONT_COLORED_ICON_LOCKED = CableBusTextures.PartStorageMonitor_Colored_Locked; @Reflected - public PartStorageMonitor( ItemStack is ) + public PartStorageMonitor( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/parts/reporting/PartTerminal.java b/src/main/java/appeng/parts/reporting/PartTerminal.java index e16de395..a12f39a7 100644 --- a/src/main/java/appeng/parts/reporting/PartTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartTerminal.java @@ -27,7 +27,7 @@ import appeng.client.texture.CableBusTextures; public class PartTerminal extends AbstractPartTerminal { - public PartTerminal( ItemStack is ) + public PartTerminal( final ItemStack is ) { super( is ); } diff --git a/src/main/java/appeng/recipes/AEItemResolver.java b/src/main/java/appeng/recipes/AEItemResolver.java index 5016df86..5211c804 100644 --- a/src/main/java/appeng/recipes/AEItemResolver.java +++ b/src/main/java/appeng/recipes/AEItemResolver.java @@ -41,7 +41,7 @@ public class AEItemResolver implements ISubItemResolver { @Override - public Object resolveItemByName( String nameSpace, String itemName ) + public Object resolveItemByName( final String nameSpace, final String itemName ) { if( nameSpace.equals( AppEng.MOD_ID ) ) @@ -120,8 +120,8 @@ public class AEItemResolver implements ISubItemResolver if( itemName.startsWith( "ItemMaterial." ) ) { - String materialName = itemName.substring( itemName.indexOf( '.' ) + 1 ); - MaterialType mt = MaterialType.valueOf( materialName ); + final String materialName = itemName.substring( itemName.indexOf( '.' ) + 1 ); + final MaterialType mt = MaterialType.valueOf( materialName ); // itemName = itemName.substring( 0, itemName.indexOf( "." ) ); if( mt.itemInstance == MultiItem.instance && mt.damageValue >= 0 && mt.isRegistered() ) { @@ -131,10 +131,10 @@ public class AEItemResolver implements ISubItemResolver if( itemName.startsWith( "ItemPart." ) ) { - String partName = itemName.substring( itemName.indexOf( '.' ) + 1 ); - PartType pt = PartType.valueOf( partName ); + final String partName = itemName.substring( itemName.indexOf( '.' ) + 1 ); + final PartType pt = PartType.valueOf( partName ); // itemName = itemName.substring( 0, itemName.indexOf( "." ) ); - int dVal = ItemMultiPart.instance.getDamageByType( pt ); + final int dVal = ItemMultiPart.instance.getDamageByType( pt ); if( dVal >= 0 ) { return new ResolverResult( "ItemMultiPart", dVal ); @@ -145,7 +145,7 @@ public class AEItemResolver implements ISubItemResolver return null; } - private Object paintBall( AEColoredItemDefinition partType, String substring, boolean lumen ) + private Object paintBall( final AEColoredItemDefinition partType, final String substring, final boolean lumen ) { AEColor col; @@ -153,7 +153,7 @@ public class AEItemResolver implements ISubItemResolver { col = AEColor.valueOf( substring ); } - catch( Throwable t ) + catch( final Throwable t ) { col = AEColor.Transparent; } @@ -163,11 +163,11 @@ public class AEItemResolver implements ISubItemResolver return null; } - ItemStack is = partType.stack( col, 1 ); + final ItemStack is = partType.stack( col, 1 ); return new ResolverResult( "ItemPaintBall", ( lumen ? 20 : 0 ) + is.getItemDamage() ); } - private Object cableItem( AEColoredItemDefinition partType, String substring ) + private Object cableItem( final AEColoredItemDefinition partType, final String substring ) { AEColor col; @@ -175,12 +175,12 @@ public class AEItemResolver implements ISubItemResolver { col = AEColor.valueOf( substring ); } - catch( Throwable t ) + catch( final Throwable t ) { col = AEColor.Transparent; } - ItemStack is = partType.stack( col, 1 ); + final ItemStack is = partType.stack( col, 1 ); return new ResolverResult( "ItemMultiPart", is.getItemDamage() ); } } diff --git a/src/main/java/appeng/recipes/GroupIngredient.java b/src/main/java/appeng/recipes/GroupIngredient.java index 8cacd8a4..49e36638 100644 --- a/src/main/java/appeng/recipes/GroupIngredient.java +++ b/src/main/java/appeng/recipes/GroupIngredient.java @@ -43,7 +43,7 @@ public class GroupIngredient implements IIngredient boolean isInside = false; - public GroupIngredient( String myName, List ingredients, int qty ) throws RecipeError + public GroupIngredient( final String myName, final List ingredients, final int qty ) throws RecipeError { Preconditions.checkNotNull( myName ); Preconditions.checkNotNull( ingredients ); @@ -53,7 +53,7 @@ public class GroupIngredient implements IIngredient this.name = myName; this.qty = qty; - for( IIngredient ingredient : ingredients ) + for( final IIngredient ingredient : ingredients ) { if( ingredient.isAir() ) { @@ -64,7 +64,7 @@ public class GroupIngredient implements IIngredient this.ingredients = ingredients; } - public IIngredient copy( int qty ) throws RecipeError + public IIngredient copy( final int qty ) throws RecipeError { Preconditions.checkState( qty > 0 ); return new GroupIngredient( this.name, this.ingredients, qty ); @@ -89,17 +89,17 @@ public class GroupIngredient implements IIngredient return new ItemStack[0]; } - List out = new LinkedList(); + final List out = new LinkedList(); this.isInside = true; try { - for( IIngredient i : this.ingredients ) + for( final IIngredient i : this.ingredients ) { try { out.addAll( Arrays.asList( i.getItemStackSet() ) ); } - catch( MissingIngredientError mir ) + catch( final MissingIngredientError mir ) { // oh well this is a group! } @@ -115,7 +115,7 @@ public class GroupIngredient implements IIngredient throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." ); } - for( ItemStack is : out ) + for( final ItemStack is : out ) { is.stackSize = this.qty; } diff --git a/src/main/java/appeng/recipes/Ingredient.java b/src/main/java/appeng/recipes/Ingredient.java index dcb27a04..dced342b 100644 --- a/src/main/java/appeng/recipes/Ingredient.java +++ b/src/main/java/appeng/recipes/Ingredient.java @@ -49,7 +49,7 @@ public class Ingredient implements IIngredient private NBTTagCompound nbt = null; private ItemStack[] baked; - public Ingredient( RecipeHandler handler, String input, int qty ) throws RecipeError, MissedIngredientSet + public Ingredient( final RecipeHandler handler, final String input, final int qty ) throws RecipeError, MissedIngredientSet { Preconditions.checkNotNull( handler ); Preconditions.checkNotNull( input ); @@ -68,7 +68,7 @@ public class Ingredient implements IIngredient } this.isAir = false; - String[] parts = input.split( ":" ); + final String[] parts = input.split( ":" ); if( parts.length >= 2 ) { this.nameSpace = handler.alias( parts[0] ); @@ -90,10 +90,10 @@ public class Ingredient implements IIngredient { try { - Object ro = AEApi.instance().registries().recipes().resolveItem( this.nameSpace, tmpName ); + final Object ro = AEApi.instance().registries().recipes().resolveItem( this.nameSpace, tmpName ); if( ro instanceof ResolverResult ) { - ResolverResult rr = (ResolverResult) ro; + final ResolverResult rr = (ResolverResult) ro; tmpName = rr.itemName; sel = rr.damageValue; this.nbt = rr.compound; @@ -103,7 +103,7 @@ public class Ingredient implements IIngredient throw new MissedIngredientSet( (ResolverResultSet) ro ); } } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new RecipeError( tmpName + " is not a valid ae2 item definition." ); } @@ -123,7 +123,7 @@ public class Ingredient implements IIngredient { this.meta = Integer.parseInt( parts[2] ); } - catch( NumberFormatException e ) + catch( final NumberFormatException e ) { throw new RecipeError( "Invalid Metadata." ); } @@ -166,7 +166,7 @@ public class Ingredient implements IIngredient if( blk != null ) { - Item it = Item.getItemFromBlock( blk ); + final Item it = Item.getItemFromBlock( blk ); if( it != null ) { return this.makeItemStack( it, this.qty, this.meta, this.nbt ); @@ -200,9 +200,9 @@ public class Ingredient implements IIngredient throw new MissingIngredientError( "Unable to find item: " + this.toString() ); } - private ItemStack makeItemStack( Item it, int quantity, int damageValue, NBTTagCompound compound ) + private ItemStack makeItemStack( final Item it, final int quantity, final int damageValue, final NBTTagCompound compound ) { - ItemStack is = new ItemStack( it, quantity, damageValue ); + final ItemStack is = new ItemStack( it, quantity, damageValue ); is.setTagCompound( compound ); return is; } @@ -217,13 +217,13 @@ public class Ingredient implements IIngredient if( this.nameSpace.equalsIgnoreCase( "oreDictionary" ) ) { - List ores = OreDictionary.getOres( this.itemName ); - ItemStack[] set = ores.toArray( new ItemStack[ores.size()] ); + final List ores = OreDictionary.getOres( this.itemName ); + final ItemStack[] set = ores.toArray( new ItemStack[ores.size()] ); // clone and set qty. for( int x = 0; x < set.length; x++ ) { - ItemStack is = set[x].copy(); + final ItemStack is = set[x].copy(); is.stackSize = this.qty; set[x] = is; } diff --git a/src/main/java/appeng/recipes/IngredientSet.java b/src/main/java/appeng/recipes/IngredientSet.java index 914ad371..df474a73 100644 --- a/src/main/java/appeng/recipes/IngredientSet.java +++ b/src/main/java/appeng/recipes/IngredientSet.java @@ -41,7 +41,7 @@ public class IngredientSet implements IIngredient private final boolean isInside = false; private ItemStack[] baked; - public IngredientSet( ResolverResultSet rr, int qty ) + public IngredientSet( final ResolverResultSet rr, final int qty ) { Preconditions.checkNotNull( rr ); Preconditions.checkNotNull( rr.name ); @@ -72,7 +72,7 @@ public class IngredientSet implements IIngredient return new ItemStack[0]; } - List out = new LinkedList(); + final List out = new LinkedList(); out.addAll( this.items ); if( out.isEmpty() ) @@ -80,7 +80,7 @@ public class IngredientSet implements IIngredient throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." ); } - for( ItemStack is : out ) + for( final ItemStack is : out ) { is.stackSize = this.qty; } diff --git a/src/main/java/appeng/recipes/MissedIngredientSet.java b/src/main/java/appeng/recipes/MissedIngredientSet.java index 3b1cb4e5..840f0a6a 100644 --- a/src/main/java/appeng/recipes/MissedIngredientSet.java +++ b/src/main/java/appeng/recipes/MissedIngredientSet.java @@ -28,7 +28,7 @@ public class MissedIngredientSet extends Throwable private static final long serialVersionUID = 2672951714376345807L; private final ResolverResultSet resolverResultSet; - public MissedIngredientSet( ResolverResultSet ro ) + public MissedIngredientSet( final ResolverResultSet ro ) { this.resolverResultSet = ro; } diff --git a/src/main/java/appeng/recipes/RecipeHandler.java b/src/main/java/appeng/recipes/RecipeHandler.java index e74a3585..8c662b69 100644 --- a/src/main/java/appeng/recipes/RecipeHandler.java +++ b/src/main/java/appeng/recipes/RecipeHandler.java @@ -84,30 +84,30 @@ public class RecipeHandler implements IRecipeHandler this.data = new RecipeData(); } - RecipeHandler( RecipeHandler parent ) + RecipeHandler( final RecipeHandler parent ) { Preconditions.checkNotNull( parent ); this.data = parent.data; } - private void addCrafting( ICraftHandler ch ) + private void addCrafting( final ICraftHandler ch ) { this.data.handlers.add( ch ); } - public String getName( @Nonnull IIngredient i ) + public String getName( @Nonnull final IIngredient i ) { try { - for( ItemStack is : i.getItemStackSet() ) + for( final ItemStack is : i.getItemStackSet() ) { return this.getName( is ); } } - catch( RecipeError ignored ) + catch( final RecipeError ignored ) { } - catch( Throwable t ) + catch( final Throwable t ) { t.printStackTrace(); // :P @@ -116,11 +116,11 @@ public class RecipeHandler implements IRecipeHandler return i.getNameSpace() + ':' + i.getItemName(); } - public String getName( ItemStack is ) throws RecipeError + public String getName( final ItemStack is ) throws RecipeError { Preconditions.checkNotNull( is ); - UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() ); + final UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() ); String realName = id.modId + ':' + id.name; if( !id.modId.equals( AppEng.MOD_ID ) && !id.modId.equals( "minecraft" ) ) @@ -140,7 +140,7 @@ public class RecipeHandler implements IRecipeHandler if( maybeCrystalSeedItem.isPresent() && is.getItem() == maybeCrystalSeedItem.get() ) { - int dmg = is.getItemDamage(); + final int dmg = is.getItemDamage(); if( dmg < ItemCrystalSeed.NETHER ) { realName += ".Certus"; @@ -224,11 +224,11 @@ public class RecipeHandler implements IRecipeHandler return realName; } - public String alias( String in ) + public String alias( final String in ) { Preconditions.checkNotNull( in ); - String out = this.data.aliases.get( in ); + final String out = this.data.aliases.get( in ); if( out != null ) { @@ -239,7 +239,7 @@ public class RecipeHandler implements IRecipeHandler } @Override - public void parseRecipes( IRecipeLoader loader, String path ) + public void parseRecipes( final IRecipeLoader loader, final String path ) { Preconditions.checkNotNull( loader ); Preconditions.checkNotNull( path ); @@ -251,7 +251,7 @@ public class RecipeHandler implements IRecipeHandler { reader = loader.getFile( path ); } - catch( Exception err ) + catch( final Exception err ) { AELog.warning( "Error Loading Recipe File:" + path ); if( this.data.exceptions ) @@ -270,7 +270,7 @@ public class RecipeHandler implements IRecipeHandler int val = -1; while( ( val = reader.read() ) != -1 ) { - char c = (char) val; + final char c = (char) val; if( c == '\n' ) { @@ -354,7 +354,7 @@ public class RecipeHandler implements IRecipeHandler reader.close(); this.processTokens( loader, path, line ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); if( this.data.crash ) @@ -372,17 +372,17 @@ public class RecipeHandler implements IRecipeHandler throw new IllegalStateException( "Recipes must now be loaded in Init." ); } - Map processed = new HashMap(); + final Map processed = new HashMap(); try { - for( ICraftHandler ch : this.data.handlers ) + for( final ICraftHandler ch : this.data.handlers ) { try { ch.register(); - Class clz = ch.getClass(); - Integer i = processed.get( clz ); + final Class clz = ch.getClass(); + final Integer i = processed.get( clz ); if( i == null ) { processed.put( clz, 1 ); @@ -392,7 +392,7 @@ public class RecipeHandler implements IRecipeHandler processed.put( clz, i + 1 ); } } - catch( RegistrationError e ) + catch( final RegistrationError e ) { AELog.warning( "Unable to register a recipe: " + e.getMessage() ); if( this.data.exceptions ) @@ -404,7 +404,7 @@ public class RecipeHandler implements IRecipeHandler throw e; } } - catch( MissingIngredientError e ) + catch( final MissingIngredientError e ) { if( this.data.errorOnMissing ) { @@ -421,7 +421,7 @@ public class RecipeHandler implements IRecipeHandler } } } - catch( Throwable e ) + catch( final Throwable e ) { if( this.data.exceptions ) { @@ -433,7 +433,7 @@ public class RecipeHandler implements IRecipeHandler } } - for( Entry e : processed.entrySet() ) + for( final Entry e : processed.entrySet() ) { AELog.info( "Recipes Loading: " + e.getKey().getSimpleName() + ": " + e.getValue() + " loaded." ); } @@ -442,52 +442,52 @@ public class RecipeHandler implements IRecipeHandler { try { - ZipOutputStream out = new ZipOutputStream( new FileOutputStream( "recipes.zip" ) ); + final ZipOutputStream out = new ZipOutputStream( new FileOutputStream( "recipes.zip" ) ); - HashMultimap combined = HashMultimap.create(); + final HashMultimap combined = HashMultimap.create(); - for( String s : this.data.knownItem ) + for( final String s : this.data.knownItem ) { try { - IIngredient i = new Ingredient( this, s, 1 ); + final IIngredient i = new Ingredient( this, s, 1 ); - for( ItemStack is : i.getItemStackSet() ) + for( final ItemStack is : i.getItemStackSet() ) { - String realName = this.getName( is ); - List recipes = this.findRecipe( is ); + final String realName = this.getName( is ); + final List recipes = this.findRecipe( is ); if( !recipes.isEmpty() ) { combined.putAll( realName, recipes ); } } } - catch( RecipeError ignored ) + catch( final RecipeError ignored ) { } - catch( MissedIngredientSet ignored ) + catch( final MissedIngredientSet ignored ) { } - catch( RegistrationError ignored ) + catch( final RegistrationError ignored ) { } - catch( MissingIngredientError ignored ) + catch( final MissingIngredientError ignored ) { } } - for( String realName : combined.keySet() ) + for( final String realName : combined.keySet() ) { int offset = 0; - for( IWebsiteSerializer ws : combined.get( realName ) ) + for( final IWebsiteSerializer ws : combined.get( realName ) ) { - String rew = ws.getPattern( this ); + final String rew = ws.getPattern( this ); if( rew != null && rew.length() > 0 ) { out.putNextEntry( new ZipEntry( realName + '_' + offset + ".txt" ) ); @@ -499,22 +499,22 @@ public class RecipeHandler implements IRecipeHandler out.close(); } - catch( FileNotFoundException e1 ) + catch( final FileNotFoundException e1 ) { AELog.error( e1 ); } - catch( IOException e1 ) + catch( final IOException e1 ) { AELog.error( e1 ); } } } - public List findRecipe( ItemStack output ) + public List findRecipe( final ItemStack output ) { - List out = new LinkedList(); + final List out = new LinkedList(); - for( ICraftHandler ch : this.data.handlers ) + for( final ICraftHandler ch : this.data.handlers ) { try { @@ -523,7 +523,7 @@ public class RecipeHandler implements IRecipeHandler out.add( (IWebsiteSerializer) ch ); } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -537,18 +537,18 @@ public class RecipeHandler implements IRecipeHandler return this.data; } - private void processTokens( IRecipeLoader loader, String file, int line ) throws RecipeError + private void processTokens( final IRecipeLoader loader, final String file, final int line ) throws RecipeError { try { - IRecipeHandlerRegistry cr = AEApi.instance().registries().recipes(); + final IRecipeHandlerRegistry cr = AEApi.instance().registries().recipes(); if( this.tokens.isEmpty() ) { return; } - int split = this.tokens.indexOf( "->" ); + final int split = this.tokens.indexOf( "->" ); if( split != -1 ) { final String operation = this.tokens.remove( 0 ).toLowerCase( Locale.ENGLISH ); @@ -566,10 +566,10 @@ public class RecipeHandler implements IRecipeHandler } else if( operation.equals( "group" ) ) { - List pre = this.tokens.subList( 0, split - 1 ); - List post = this.tokens.subList( split, this.tokens.size() ); + final List pre = this.tokens.subList( 0, split - 1 ); + final List post = this.tokens.subList( split, this.tokens.size() ); - List> inputs = this.parseLines( pre ); + final List> inputs = this.parseLines( pre ); if( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 ) { @@ -582,14 +582,14 @@ public class RecipeHandler implements IRecipeHandler } else if( operation.equals( "ore" ) ) { - List pre = this.tokens.subList( 0, split - 1 ); - List post = this.tokens.subList( split, this.tokens.size() ); + final List pre = this.tokens.subList( 0, split - 1 ); + final List post = this.tokens.subList( split, this.tokens.size() ); - List> inputs = this.parseLines( pre ); + final List> inputs = this.parseLines( pre ); if( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 ) { - ICraftHandler ch = new OreRegistration( inputs.get( 0 ), post.get( 0 ) ); + final ICraftHandler ch = new OreRegistration( inputs.get( 0 ), post.get( 0 ) ); this.addCrafting( ch ); } else @@ -599,13 +599,13 @@ public class RecipeHandler implements IRecipeHandler } else { - List pre = this.tokens.subList( 0, split - 1 ); - List post = this.tokens.subList( split, this.tokens.size() ); + final List pre = this.tokens.subList( 0, split - 1 ); + final List post = this.tokens.subList( split, this.tokens.size() ); - List> inputs = this.parseLines( pre ); - List> outputs = this.parseLines( post ); + final List> inputs = this.parseLines( pre ); + final List> outputs = this.parseLines( post ); - ICraftHandler ch = cr.getCraftHandlerFor( operation ); + final ICraftHandler ch = cr.getCraftHandlerFor( operation ); if( ch != null ) { @@ -620,7 +620,7 @@ public class RecipeHandler implements IRecipeHandler } else { - String operation = this.tokens.remove( 0 ).toLowerCase(); + final String operation = this.tokens.remove( 0 ).toLowerCase(); if( operation.equals( "exceptions" ) && ( this.tokens.get( 0 ).equals( "true" ) || this.tokens.get( 0 ).equals( "false" ) ) ) { @@ -672,7 +672,7 @@ public class RecipeHandler implements IRecipeHandler } } } - catch( RecipeError e ) + catch( final RecipeError e ) { AELog.warning( "Recipe Error '" + e.getMessage() + "' near line:" + line + " in " + file + " with: " + this.tokens.toString() ); if( this.data.exceptions ) @@ -688,15 +688,15 @@ public class RecipeHandler implements IRecipeHandler this.tokens.clear(); } - private List> parseLines( Iterable subList ) throws RecipeError + private List> parseLines( final Iterable subList ) throws RecipeError { - List> out = new LinkedList>(); + final List> out = new LinkedList>(); List cList = new LinkedList(); boolean hasQty = false; int qty = 1; - for( String v : subList ) + for( final String v : subList ) { if( v.equals( "," ) ) { @@ -744,9 +744,9 @@ public class RecipeHandler implements IRecipeHandler return out; } - private IIngredient findIngredient( String v, int qty ) throws RecipeError + private IIngredient findIngredient( final String v, final int qty ) throws RecipeError { - GroupIngredient gi = this.data.groups.get( v ); + final GroupIngredient gi = this.data.groups.get( v ); if( gi != null ) { @@ -757,20 +757,20 @@ public class RecipeHandler implements IRecipeHandler { return new Ingredient( this, v, qty ); } - catch( MissedIngredientSet grp ) + catch( final MissedIngredientSet grp ) { return new IngredientSet( grp.getResolverResultSet(), qty ); } } - private boolean isNumber( CharSequence v ) + private boolean isNumber( final CharSequence v ) { if( v.length() <= 0 ) { return false; } - int l = v.length(); + final int l = v.length(); for( int x = 0; x < l; x++ ) { if( !Character.isDigit( v.charAt( x ) ) ) diff --git a/src/main/java/appeng/recipes/game/DisassembleRecipe.java b/src/main/java/appeng/recipes/game/DisassembleRecipe.java index a009869f..c01e46eb 100644 --- a/src/main/java/appeng/recipes/game/DisassembleRecipe.java +++ b/src/main/java/appeng/recipes/game/DisassembleRecipe.java @@ -75,20 +75,20 @@ public final class DisassembleRecipe implements IRecipe } @Override - public boolean matches( InventoryCrafting inv, World w ) + public boolean matches( final InventoryCrafting inv, final World w ) { return this.getOutput( inv ) != null; } @Nullable - private ItemStack getOutput( IInventory inventory ) + private ItemStack getOutput( final IInventory inventory ) { int itemCount = 0; ItemStack output = MISMATCHED_STACK; for( int slotIndex = 0; slotIndex < inventory.getSizeInventory(); slotIndex++ ) { - ItemStack stackInSlot = inventory.getStackInSlot( slotIndex ); + final ItemStack stackInSlot = inventory.getStackInSlot( slotIndex ); if( stackInSlot != null ) { // needs a single input in the recipe @@ -99,13 +99,13 @@ public final class DisassembleRecipe implements IRecipe } // handle storage cells - for( ItemStack storageCellStack : this.getCellOutput( stackInSlot ).asSet() ) + for( final ItemStack storageCellStack : this.getCellOutput( stackInSlot ).asSet() ) { // make sure the storage cell stackInSlot empty... - IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( stackInSlot, null, StorageChannel.ITEMS ); + final IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( stackInSlot, null, StorageChannel.ITEMS ); if( cellInv != null ) { - IItemList list = cellInv.getAvailableItems( StorageChannel.ITEMS.createList() ); + final IItemList list = cellInv.getAvailableItems( StorageChannel.ITEMS.createList() ); if( !list.isEmpty() ) { return null; @@ -116,7 +116,7 @@ public final class DisassembleRecipe implements IRecipe } // handle crafting storage blocks - for( ItemStack craftingStorageStack : this.getNonCellOutput( stackInSlot ).asSet() ) + for( final ItemStack craftingStorageStack : this.getNonCellOutput( stackInSlot ).asSet() ) { output = craftingStorageStack; } @@ -127,9 +127,9 @@ public final class DisassembleRecipe implements IRecipe } @Nonnull - private Optional getCellOutput( ItemStack compared ) + private Optional getCellOutput( final ItemStack compared ) { - for( Map.Entry entry : this.cellMappings.entrySet() ) + for( final Map.Entry entry : this.cellMappings.entrySet() ) { if( entry.getKey().isSameAs( compared ) ) { @@ -141,9 +141,9 @@ public final class DisassembleRecipe implements IRecipe } @Nonnull - private Optional getNonCellOutput( ItemStack compared ) + private Optional getNonCellOutput( final ItemStack compared ) { - for( Map.Entry entry : this.nonCellMappings.entrySet() ) + for( final Map.Entry entry : this.nonCellMappings.entrySet() ) { if( entry.getKey().isSameAs( compared ) ) { @@ -156,7 +156,7 @@ public final class DisassembleRecipe implements IRecipe @Nullable @Override - public ItemStack getCraftingResult( InventoryCrafting inv ) + public ItemStack getCraftingResult( final InventoryCrafting inv ) { return this.getOutput( inv ); } @@ -176,7 +176,7 @@ public final class DisassembleRecipe implements IRecipe @Override public ItemStack[] getRemainingItems( - InventoryCrafting inv ) + final InventoryCrafting inv ) { return ForgeHooks.defaultRecipeGetRemainingItems(inv); } diff --git a/src/main/java/appeng/recipes/game/FacadeRecipe.java b/src/main/java/appeng/recipes/game/FacadeRecipe.java index e13ab1e8..78fe3682 100644 --- a/src/main/java/appeng/recipes/game/FacadeRecipe.java +++ b/src/main/java/appeng/recipes/game/FacadeRecipe.java @@ -50,23 +50,23 @@ public final class FacadeRecipe implements IRecipe } @Override - public boolean matches( InventoryCrafting inv, World w ) + public boolean matches( final InventoryCrafting inv, final World w ) { return this.getOutput( inv, false ) != null; } @Nullable - private ItemStack getOutput( IInventory inv, boolean createFacade ) + private ItemStack getOutput( final IInventory inv, final boolean createFacade ) { if( inv.getStackInSlot( 0 ) == null && inv.getStackInSlot( 2 ) == null && inv.getStackInSlot( 6 ) == null && inv.getStackInSlot( 8 ) == null ) { if( this.anchor.isSameAs( inv.getStackInSlot( 1 ) ) && this.anchor.isSameAs( inv.getStackInSlot( 3 ) ) && this.anchor.isSameAs( inv.getStackInSlot( 5 ) ) && this.anchor.isSameAs( inv.getStackInSlot( 7 ) ) ) { - for( Item facadeItemDefinition : this.maybeFacade.asSet() ) + for( final Item facadeItemDefinition : this.maybeFacade.asSet() ) { final ItemFacade facade = (ItemFacade) facadeItemDefinition; - ItemStack facades = facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade ); + final ItemStack facades = facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade ); if( facades != null && createFacade ) { facades.stackSize = 4; @@ -80,7 +80,7 @@ public final class FacadeRecipe implements IRecipe } @Override - public ItemStack getCraftingResult( InventoryCrafting inv ) + public ItemStack getCraftingResult( final InventoryCrafting inv ) { return this.getOutput( inv, true ); } @@ -99,7 +99,7 @@ public final class FacadeRecipe implements IRecipe @Override public ItemStack[] getRemainingItems( - InventoryCrafting inv ) + final InventoryCrafting inv ) { return ForgeHooks.defaultRecipeGetRemainingItems(inv); } diff --git a/src/main/java/appeng/recipes/game/ShapedRecipe.java b/src/main/java/appeng/recipes/game/ShapedRecipe.java index d0243412..eb9d354e 100644 --- a/src/main/java/appeng/recipes/game/ShapedRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapedRecipe.java @@ -47,11 +47,11 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable private boolean mirrored = true; private boolean disable = false; - public ShapedRecipe( ItemStack result, Object... recipe ) + public ShapedRecipe( final ItemStack result, Object... recipe ) { this.output = result.copy(); - StringBuilder shape = new StringBuilder(); + final StringBuilder shape = new StringBuilder(); int idx = 0; if( recipe[idx] instanceof Boolean ) @@ -69,10 +69,10 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable if( recipe[idx] instanceof String[] ) { - String[] parts = ( (String[]) recipe[idx] ); + final String[] parts = ( (String[]) recipe[idx] ); idx++; - for( String s : parts ) + for( final String s : parts ) { this.width = s.length(); shape.append( s ); @@ -84,7 +84,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { while( recipe[idx] instanceof String ) { - String s = (String) recipe[idx]; + final String s = (String) recipe[idx]; idx++; shape.append( s ); this.width = s.length(); @@ -94,8 +94,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable if( this.width * this.height != shape.length() ) { - StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " ); - for( Object tmp : recipe ) + final StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " ); + for( final Object tmp : recipe ) { ret.append( tmp ).append( ", " ); } @@ -103,12 +103,12 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable throw new IllegalStateException( ret.toString() ); } - Map itemMap = new HashMap(); + final Map itemMap = new HashMap(); for(; idx < recipe.length; idx += 2 ) { - Character chr = (Character) recipe[idx]; - Object in = recipe[idx + 1]; + final Character chr = (Character) recipe[idx]; + final Object in = recipe[idx + 1]; if( in instanceof IIngredient ) { @@ -116,8 +116,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } else { - StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " ); - for( Object tmp : recipe ) + final StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " ); + for( final Object tmp : recipe ) { ret.append( tmp ).append( ", " ); } @@ -128,7 +128,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable this.input = new Object[this.width * this.height]; int x = 0; - for( char chr : shape.toString().toCharArray() ) + for( final char chr : shape.toString().toCharArray() ) { this.input[x] = itemMap.get( chr ); x++; @@ -141,7 +141,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } @Override - public boolean matches( InventoryCrafting inv, World world ) + public boolean matches( final InventoryCrafting inv, final World world ) { if( this.disable ) { @@ -168,7 +168,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } @Override - public ItemStack getCraftingResult( InventoryCrafting var1 ) + public ItemStack getCraftingResult( final InventoryCrafting var1 ) { return this.output.copy(); } @@ -186,7 +186,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } @SuppressWarnings( "unchecked" ) - private boolean checkMatch( InventoryCrafting inv, int startX, int startY, boolean mirror ) + private boolean checkMatch( final InventoryCrafting inv, final int startX, final int startY, final boolean mirror ) { if( this.disable ) { @@ -197,8 +197,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { for( int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++ ) { - int subX = x - startX; - int subY = y - startY; + final int subX = x - startX; + final int subY = y - startY; Object target = null; if( subX >= 0 && subY >= 0 && subX < this.width && subY < this.height ) @@ -213,7 +213,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } } - ItemStack slot = inv.getStackInRowAndColumn( x, y ); + final ItemStack slot = inv.getStackInRowAndColumn( x, y ); if( target instanceof IIngredient ) { @@ -221,16 +221,16 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable try { - for( ItemStack item : ( (IIngredient) target ).getItemStackSet() ) + for( final ItemStack item : ( (IIngredient) target ).getItemStackSet() ) { matched = matched || this.checkItemEquals( item, slot ); } } - catch( RegistrationError e ) + catch( final RegistrationError e ) { // :P } - catch( MissingIngredientError e ) + catch( final MissingIngredientError e ) { // :P } @@ -244,7 +244,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { boolean matched = false; - for( ItemStack item : (Iterable) target ) + for( final ItemStack item : (Iterable) target ) { matched = matched || this.checkItemEquals( item, slot ); } @@ -264,7 +264,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable return true; } - private boolean checkItemEquals( ItemStack target, ItemStack input ) + private boolean checkItemEquals( final ItemStack target, final ItemStack input ) { if( input == null && target != null || input != null && target == null ) { @@ -273,7 +273,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable return ( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) ); } - public ShapedRecipe setMirrored( boolean mirror ) + public ShapedRecipe setMirrored( final boolean mirror ) { this.mirrored = mirror; return this; @@ -311,7 +311,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable try { this.disable = false; - for( Object o : this.input ) + for( final Object o : this.input ) { if( o instanceof IIngredient ) { @@ -319,7 +319,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable } } } - catch( MissingIngredientError err ) + catch( final MissingIngredientError err ) { this.disable = true; } @@ -327,7 +327,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable @Override public ItemStack[] getRemainingItems( - InventoryCrafting inv ) + final InventoryCrafting inv ) { return ForgeHooks.defaultRecipeGetRemainingItems(inv); } diff --git a/src/main/java/appeng/recipes/game/ShapelessRecipe.java b/src/main/java/appeng/recipes/game/ShapelessRecipe.java index d0fd0d96..bbd8ba39 100644 --- a/src/main/java/appeng/recipes/game/ShapelessRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapelessRecipe.java @@ -39,10 +39,10 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable private ItemStack output = null; private boolean disable = false; - public ShapelessRecipe( ItemStack result, Object... recipe ) + public ShapelessRecipe( final ItemStack result, final Object... recipe ) { this.output = result.copy(); - for( Object in : recipe ) + for( final Object in : recipe ) { if( in instanceof IIngredient ) { @@ -50,8 +50,8 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable } else { - StringBuilder ret = new StringBuilder( "Invalid shapeless ore recipe: " ); - for( Object tmp : recipe ) + final StringBuilder ret = new StringBuilder( "Invalid shapeless ore recipe: " ); + for( final Object tmp : recipe ) { ret.append( tmp ).append( ", " ); } @@ -68,24 +68,24 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable @SuppressWarnings( "unchecked" ) @Override - public boolean matches( InventoryCrafting var1, World world ) + public boolean matches( final InventoryCrafting var1, final World world ) { if( this.disable ) { return false; } - ArrayList required = new ArrayList( this.input ); + final ArrayList required = new ArrayList( this.input ); for( int x = 0; x < var1.getSizeInventory(); x++ ) { - ItemStack slot = var1.getStackInSlot( x ); + final ItemStack slot = var1.getStackInSlot( x ); if( slot != null ) { boolean inRecipe = false; - for( Object next : required ) + for( final Object next : required ) { boolean match = false; @@ -93,16 +93,16 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable { try { - for( ItemStack item : ( (IIngredient) next ).getItemStackSet() ) + for( final ItemStack item : ( (IIngredient) next ).getItemStackSet() ) { match = match || this.checkItemEquals( item, slot ); } } - catch( RegistrationError e ) + catch( final RegistrationError e ) { // :P } - catch( MissingIngredientError e ) + catch( final MissingIngredientError e ) { // :P } @@ -127,7 +127,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable } @Override - public ItemStack getCraftingResult( InventoryCrafting var1 ) + public ItemStack getCraftingResult( final InventoryCrafting var1 ) { return this.output.copy(); } @@ -144,7 +144,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable return this.output; } - private boolean checkItemEquals( ItemStack target, ItemStack input ) + private boolean checkItemEquals( final ItemStack target, final ItemStack input ) { return ( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) ); } @@ -166,7 +166,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable try { this.disable = false; - for( Object o : this.input ) + for( final Object o : this.input ) { if( o instanceof IIngredient ) { @@ -174,7 +174,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable } } } - catch( MissingIngredientError e ) + catch( final MissingIngredientError e ) { this.disable = true; } @@ -182,7 +182,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable @Override public ItemStack[] getRemainingItems( - InventoryCrafting inv ) + final InventoryCrafting inv ) { return ForgeHooks.defaultRecipeGetRemainingItems(inv); } diff --git a/src/main/java/appeng/recipes/handlers/Crusher.java b/src/main/java/appeng/recipes/handlers/Crusher.java index c6081c5d..9267f983 100644 --- a/src/main/java/appeng/recipes/handlers/Crusher.java +++ b/src/main/java/appeng/recipes/handlers/Crusher.java @@ -42,11 +42,11 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -62,14 +62,14 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.RC ) ) { - IRC rc = (IRC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.RC ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IRC rc = (IRC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.RC ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { rc.rockCrusher( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "RC not happy - " + err.getMessage() ); } @@ -78,13 +78,13 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/Grind.java b/src/main/java/appeng/recipes/handlers/Grind.java index 3d089291..733cd8df 100644 --- a/src/main/java/appeng/recipes/handlers/Grind.java +++ b/src/main/java/appeng/recipes/handlers/Grind.java @@ -39,11 +39,11 @@ public class Grind implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -57,14 +57,14 @@ public class Grind implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - for( ItemStack is : this.pro_input.getItemStackSet() ) + for( final ItemStack is : this.pro_input.getItemStackSet() ) { AEApi.instance().registries().grinder().addRecipe( is, this.pro_output[0].getItemStack(), 8 ); } } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return "grind\n" + h.getName( this.pro_input ) + '\n' + @@ -72,7 +72,7 @@ public class Grind implements ICraftHandler, IWebsiteSerializer } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/GrindFZ.java b/src/main/java/appeng/recipes/handlers/GrindFZ.java index e1284551..12f7ce6a 100644 --- a/src/main/java/appeng/recipes/handlers/GrindFZ.java +++ b/src/main/java/appeng/recipes/handlers/GrindFZ.java @@ -42,11 +42,11 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -62,14 +62,14 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FZ ) ) { - IFZ fz = (IFZ) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FZ ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IFZ fz = (IFZ) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FZ ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { fz.grinderRecipe( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "FZ not happy - " + err.getMessage() ); } @@ -78,13 +78,13 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/HCCrusher.java b/src/main/java/appeng/recipes/handlers/HCCrusher.java index 9c472000..6b714543 100644 --- a/src/main/java/appeng/recipes/handlers/HCCrusher.java +++ b/src/main/java/appeng/recipes/handlers/HCCrusher.java @@ -41,11 +41,11 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -59,16 +59,16 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - for( ItemStack beginStack : this.pro_input.getItemStackSet() ) + for( final ItemStack beginStack : this.pro_input.getItemStackSet() ) { try { - NBTTagCompound toRegister = new NBTTagCompound(); + final NBTTagCompound toRegister = new NBTTagCompound(); - ItemStack endStack = this.pro_output[0].getItemStack(); + final ItemStack endStack = this.pro_output[0].getItemStack(); - NBTTagCompound itemFrom = new NBTTagCompound(); - NBTTagCompound itemTo = new NBTTagCompound(); + final NBTTagCompound itemFrom = new NBTTagCompound(); + final NBTTagCompound itemTo = new NBTTagCompound(); beginStack.writeToNBT( itemFrom ); endStack.writeToNBT( itemTo ); @@ -79,7 +79,7 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer FMLInterModComms.sendMessage( "HydCraft", "registerCrushingRecipe", toRegister ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "Hydraulicraft not happy - " + err.getMessage() ); } @@ -87,13 +87,13 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/Inscribe.java b/src/main/java/appeng/recipes/handlers/Inscribe.java index d0953cc2..920e8a24 100644 --- a/src/main/java/appeng/recipes/handlers/Inscribe.java +++ b/src/main/java/appeng/recipes/handlers/Inscribe.java @@ -62,7 +62,7 @@ public final class Inscribe extends InscriberProcess final ItemStack output = this.getOutput().getItemStack(); final InscriberProcessType type = InscriberProcessType.Inscribe; - IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type ); + final IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type ); AEApi.instance().registries().inscriber().addRecipe( recipe ); } diff --git a/src/main/java/appeng/recipes/handlers/InscriberProcess.java b/src/main/java/appeng/recipes/handlers/InscriberProcess.java index ce16a385..6303e4bf 100644 --- a/src/main/java/appeng/recipes/handlers/InscriberProcess.java +++ b/src/main/java/appeng/recipes/handlers/InscriberProcess.java @@ -38,7 +38,7 @@ public abstract class InscriberProcess implements ICraftHandler, IWebsiteSeriali private IIngredient output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( output.size() == 1 && output.get( 0 ).size() == 1 ) { @@ -67,13 +67,13 @@ public abstract class InscriberProcess implements ICraftHandler, IWebsiteSeriali } @Override - public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError { return this.output != null && Platform.isSameItemPrecise( this.output.getItemStack(), reqOutput ); } @Override - public String getPattern( RecipeHandler handler ) + public String getPattern( final RecipeHandler handler ) { String pattern = "inscriber "; diff --git a/src/main/java/appeng/recipes/handlers/Macerator.java b/src/main/java/appeng/recipes/handlers/Macerator.java index 3a9b3b83..9f68a15b 100644 --- a/src/main/java/appeng/recipes/handlers/Macerator.java +++ b/src/main/java/appeng/recipes/handlers/Macerator.java @@ -42,11 +42,11 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -62,14 +62,14 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) ) { - IIC2 ic2 = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IIC2 ic2 = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { ic2.maceratorRecipe( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "IC2 not happy - " + err.getMessage() ); } @@ -78,13 +78,13 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/MekCrusher.java b/src/main/java/appeng/recipes/handlers/MekCrusher.java index df3ff6b5..2c5492ef 100644 --- a/src/main/java/appeng/recipes/handlers/MekCrusher.java +++ b/src/main/java/appeng/recipes/handlers/MekCrusher.java @@ -42,11 +42,11 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -63,14 +63,14 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.Mekanism ) ) { - IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { rc.addCrusherRecipe( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "Mekanism not happy - " + err.getMessage() ); } @@ -79,13 +79,13 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/MekEnrichment.java b/src/main/java/appeng/recipes/handlers/MekEnrichment.java index 854e4325..e1a2073b 100644 --- a/src/main/java/appeng/recipes/handlers/MekEnrichment.java +++ b/src/main/java/appeng/recipes/handlers/MekEnrichment.java @@ -42,11 +42,11 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -62,14 +62,14 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.Mekanism ) ) { - IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + final IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism ); + for( final ItemStack is : this.pro_input.getItemStackSet() ) { try { rc.addEnrichmentChamberRecipe( is, this.pro_output[0].getItemStack() ); } - catch( java.lang.RuntimeException err ) + catch( final java.lang.RuntimeException err ) { AELog.info( "Mekanism not happy - " + err.getMessage() ); } @@ -78,13 +78,13 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/OreRegistration.java b/src/main/java/appeng/recipes/handlers/OreRegistration.java index 0c8b802d..3f1f9b78 100644 --- a/src/main/java/appeng/recipes/handlers/OreRegistration.java +++ b/src/main/java/appeng/recipes/handlers/OreRegistration.java @@ -36,14 +36,14 @@ public class OreRegistration implements ICraftHandler final List inputs; final String name; - public OreRegistration( List in, String out ) + public OreRegistration( final List in, final String out ) { this.inputs = in; this.name = out; } @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { } @@ -51,9 +51,9 @@ public class OreRegistration implements ICraftHandler @Override public void register() throws RegistrationError, MissingIngredientError { - for( IIngredient i : this.inputs ) + for( final IIngredient i : this.inputs ) { - for( ItemStack is : i.getItemStackSet() ) + for( final ItemStack is : i.getItemStackSet() ) { OreDictionary.registerOre( this.name, is ); } diff --git a/src/main/java/appeng/recipes/handlers/Press.java b/src/main/java/appeng/recipes/handlers/Press.java index 7dafc7f6..462b6a40 100644 --- a/src/main/java/appeng/recipes/handlers/Press.java +++ b/src/main/java/appeng/recipes/handlers/Press.java @@ -62,7 +62,7 @@ public final class Press extends InscriberProcess final ItemStack output = this.getOutput().getItemStack(); final InscriberProcessType type = InscriberProcessType.Press; - IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type ); + final IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type ); AEApi.instance().registries().inscriber().addRecipe( recipe ); } diff --git a/src/main/java/appeng/recipes/handlers/Pulverizer.java b/src/main/java/appeng/recipes/handlers/Pulverizer.java index 94052b6c..b2b96073 100644 --- a/src/main/java/appeng/recipes/handlers/Pulverizer.java +++ b/src/main/java/appeng/recipes/handlers/Pulverizer.java @@ -40,11 +40,11 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer IIngredient[] pro_output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - int outs = output.get( 0 ).size(); + final int outs = output.get( 0 ).size(); if( input.get( 0 ).size() == 1 && outs == 1 ) { this.pro_input = input.get( 0 ).get( 0 ); @@ -58,13 +58,13 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - NBTTagCompound toSend = new NBTTagCompound(); + final NBTTagCompound toSend = new NBTTagCompound(); toSend.setInteger( "energy", 800 ); toSend.setTag( "primaryOutput", new NBTTagCompound() ); this.pro_output[0].getItemStack().writeToNBT( toSend.getCompoundTag( "primaryOutput" ) ); - for( ItemStack is : this.pro_input.getItemStackSet() ) + for( final ItemStack is : this.pro_input.getItemStackSet() ) { toSend.setTag( "input", new NBTTagCompound() ); is.writeToNBT( toSend.getCompoundTag( "input" ) ); @@ -73,13 +73,13 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return null; } @Override - public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output ); } diff --git a/src/main/java/appeng/recipes/handlers/Shaped.java b/src/main/java/appeng/recipes/handlers/Shaped.java index 5e8f2afd..4778d71a 100644 --- a/src/main/java/appeng/recipes/handlers/Shaped.java +++ b/src/main/java/appeng/recipes/handlers/Shaped.java @@ -44,7 +44,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer private int cols; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( output.size() == 1 && output.get( 0 ).size() == 1 ) { @@ -54,7 +54,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer this.cols = input.get( 0 ).size(); if( this.cols <= 3 && this.cols >= 1 ) { - for( List anInput : input ) + for( final List anInput : input ) { if( anInput.size() != this.cols ) { @@ -85,11 +85,11 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer public void register() throws RegistrationError, MissingIngredientError { char first = 'A'; - List args = new ArrayList(); + final List args = new ArrayList(); for( int y = 0; y < this.rows; y++ ) { - StringBuilder row = new StringBuilder(); + final StringBuilder row = new StringBuilder(); for( int x = 0; x < this.cols; x++ ) { if( this.inputs.get( y ).get( x ).isAir() ) @@ -108,13 +108,13 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer args.add( y, row.toString() ); } - ItemStack outIS = this.output.getItemStack(); + final ItemStack outIS = this.output.getItemStack(); try { GameRegistry.addRecipe( new ShapedRecipe( outIS, args.toArray( new Object[args.size()] ) ) ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); throw new RegistrationError( "Error while adding shaped recipe." ); @@ -122,7 +122,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { String o = "shaped " + this.output.getQty() + ' ' + this.cols + 'x' + this.rows + '\n'; @@ -132,7 +132,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer { for( int x = 0; x < this.cols; x++ ) { - IIngredient i = this.inputs.get( y ).get( x ); + final IIngredient i = this.inputs.get( y ).get( x ); if( i.isAir() ) { @@ -149,17 +149,17 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer } @Override - public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError { for( int y = 0; y < this.rows; y++ ) { for( int x = 0; x < this.cols; x++ ) { - IIngredient i = this.inputs.get( y ).get( x ); + final IIngredient i = this.inputs.get( y ).get( x ); if( !i.isAir() ) { - for( ItemStack r : i.getItemStackSet() ) + for( final ItemStack r : i.getItemStackSet() ) { if( Platform.isSameItemPrecise( r, reqOutput ) ) { diff --git a/src/main/java/appeng/recipes/handlers/Shapeless.java b/src/main/java/appeng/recipes/handlers/Shapeless.java index 26dab88e..8d4b99f5 100644 --- a/src/main/java/appeng/recipes/handlers/Shapeless.java +++ b/src/main/java/appeng/recipes/handlers/Shapeless.java @@ -42,7 +42,7 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer IIngredient output; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( output.size() == 1 && output.get( 0 ).size() == 1 ) { @@ -65,19 +65,19 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer @Override public void register() throws RegistrationError, MissingIngredientError { - List args = new ArrayList(); - for( IIngredient i : this.inputs ) + final List args = new ArrayList(); + for( final IIngredient i : this.inputs ) { args.add( i ); } - ItemStack outIS = this.output.getItemStack(); + final ItemStack outIS = this.output.getItemStack(); try { GameRegistry.addRecipe( new ShapelessRecipe( outIS, args.toArray( new Object[args.size()] ) ) ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); throw new RegistrationError( "Error while adding shapeless recipe." ); @@ -85,15 +85,15 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { - StringBuilder o = new StringBuilder( "shapeless " + this.output.getQty() + '\n' ); + final StringBuilder o = new StringBuilder( "shapeless " + this.output.getQty() + '\n' ); o.append( h.getName( this.output ) ).append( '\n' ); for( int y = 0; y < this.inputs.size(); y++ ) { - IIngredient i = this.inputs.get( y ); + final IIngredient i = this.inputs.get( y ); if( i.isAir() ) { @@ -118,14 +118,14 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer } @Override - public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError { - for( IIngredient i : this.inputs ) + for( final IIngredient i : this.inputs ) { if( !i.isAir() ) { - for( ItemStack r : i.getItemStackSet() ) + for( final ItemStack r : i.getItemStackSet() ) { if( Platform.isSameItemPrecise( r, reqOutput ) ) { diff --git a/src/main/java/appeng/recipes/handlers/Smelt.java b/src/main/java/appeng/recipes/handlers/Smelt.java index 77f1d189..e3451336 100644 --- a/src/main/java/appeng/recipes/handlers/Smelt.java +++ b/src/main/java/appeng/recipes/handlers/Smelt.java @@ -39,12 +39,12 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer IIngredient out; @Override - public void setup( List> input, List> output ) throws RecipeError + public void setup( final List> input, final List> output ) throws RecipeError { if( input.size() == 1 && output.size() == 1 ) { - List inputList = input.get( 0 ); - List outputList = output.get( 0 ); + final List inputList = input.get( 0 ); + final List outputList = output.get( 0 ); if( inputList.size() == 1 && outputList.size() == 1 ) { this.in = inputList.get( 0 ); @@ -72,7 +72,7 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer } @Override - public String getPattern( RecipeHandler h ) + public String getPattern( final RecipeHandler h ) { return "smelt " + this.out.getQty() + '\n' + h.getName( this.out ) + '\n' + @@ -80,7 +80,7 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer } @Override - public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError + public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError { return Platform.isSameItemPrecise( this.out.getItemStack(), reqOutput ); } diff --git a/src/main/java/appeng/recipes/loader/ConfigLoader.java b/src/main/java/appeng/recipes/loader/ConfigLoader.java index e001f3f6..0c66de88 100644 --- a/src/main/java/appeng/recipes/loader/ConfigLoader.java +++ b/src/main/java/appeng/recipes/loader/ConfigLoader.java @@ -36,14 +36,14 @@ public final class ConfigLoader implements IRecipeLoader private final File generatedRecipesDir; private final File userRecipesDir; - public ConfigLoader( File generatedRecipesDir, File userRecipesDir ) + public ConfigLoader( final File generatedRecipesDir, final File userRecipesDir ) { this.generatedRecipesDir = generatedRecipesDir; this.userRecipesDir = userRecipesDir; } @Override - public BufferedReader getFile( @Nonnull String relativeFilePath ) throws Exception + public BufferedReader getFile( @Nonnull final String relativeFilePath ) throws Exception { Preconditions.checkNotNull( relativeFilePath ); Preconditions.checkArgument( !relativeFilePath.isEmpty(), "Supplying an empty String will result creating a reader of a folder." ); diff --git a/src/main/java/appeng/recipes/loader/JarLoader.java b/src/main/java/appeng/recipes/loader/JarLoader.java index 208f6960..26596eb7 100644 --- a/src/main/java/appeng/recipes/loader/JarLoader.java +++ b/src/main/java/appeng/recipes/loader/JarLoader.java @@ -34,13 +34,13 @@ public class JarLoader implements IRecipeLoader private final String rootPath; - public JarLoader( String s ) + public JarLoader( final String s ) { this.rootPath = s; } @Override - public BufferedReader getFile( @Nonnull String s ) throws Exception + public BufferedReader getFile( @Nonnull final String s ) throws Exception { Preconditions.checkNotNull( s ); Preconditions.checkArgument( !s.isEmpty() ); diff --git a/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java b/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java index 94fd5fee..4643d453 100644 --- a/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java +++ b/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java @@ -66,7 +66,7 @@ public class RecipeResourceCopier * * @throws NullPointerException if root is null */ - public RecipeResourceCopier( @Nonnull String root ) + public RecipeResourceCopier( @Nonnull final String root ) { Preconditions.checkNotNull( root ); @@ -83,7 +83,7 @@ public class RecipeResourceCopier * @throws NullPointerException if either parameter is null * @throws IllegalArgumentException if destination is not a directory */ - public void copyTo( @Nonnull File destination ) throws URISyntaxException, IOException + public void copyTo( @Nonnull final File destination ) throws URISyntaxException, IOException { Preconditions.checkNotNull( destination ); Preconditions.checkArgument( destination.isDirectory() ); @@ -100,13 +100,13 @@ public class RecipeResourceCopier * @throws URISyntaxException {@see #getResourceListing} * @throws IOException {@see #getResourceListing} and if copying the detected resource to file is not possible */ - private void copyTo( File destination, String directory ) throws URISyntaxException, IOException + private void copyTo( final File destination, final String directory ) throws URISyntaxException, IOException { assert destination != null; assert directory != null; final String[] listing = this.getResourceListing( this.getClass(), directory ); - for( String list : listing ) + for( final String list : listing ) { if( list.endsWith( ".recipe" ) || list.endsWith( ".html" ) ) { @@ -130,7 +130,7 @@ public class RecipeResourceCopier * * @throws IOException if copying the file is not possible */ - private void copyFile( File destination, String directory, String fileName ) throws IOException + private void copyFile( final File destination, final String directory, final String fileName ) throws IOException { assert destination != null; assert fileName != null; @@ -160,7 +160,7 @@ public class RecipeResourceCopier * @throws UnsupportedOperationException if it is neither in jar nor in file path */ @Nonnull - private String[] getResourceListing( Class clazz, String path ) throws URISyntaxException, IOException + private String[] getResourceListing( final Class clazz, final String path ) throws URISyntaxException, IOException { assert clazz != null; assert path != null; diff --git a/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java b/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java index f97eb802..48b64c1b 100644 --- a/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java +++ b/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java @@ -40,7 +40,7 @@ public class OreDictionaryHandler private boolean enableRebaking = false; @SubscribeEvent - public void onOreDictionaryRegister( OreDictionary.OreRegisterEvent event ) + public void onOreDictionaryRegister( final OreDictionary.OreRegisterEvent event ) { if( event.Name == null || event.Ore == null ) { @@ -49,7 +49,7 @@ public class OreDictionaryHandler if( this.shouldCare( event.Name ) ) { - for( IOreListener v : this.oreListeners ) + for( final IOreListener v : this.oreListeners ) { v.oreRegistered( event.Name, event.Ore ); } @@ -68,7 +68,7 @@ public class OreDictionaryHandler * * @return true if it should care */ - private boolean shouldCare( String name ) + private boolean shouldCare( final String name ) { return true; } @@ -77,7 +77,7 @@ public class OreDictionaryHandler { this.enableRebaking = true; - for( Object o : CraftingManager.getInstance().getRecipeList() ) + for( final Object o : CraftingManager.getInstance().getRecipeList() ) { if( o instanceof IRecipeBakeable ) { @@ -85,7 +85,7 @@ public class OreDictionaryHandler { ( (IRecipeBakeable) o ).bake(); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); } @@ -99,16 +99,16 @@ public class OreDictionaryHandler * * @param n to be added ore listener */ - public void observe( IOreListener n ) + public void observe( final IOreListener n ) { this.oreListeners.add( n ); // notify the listener of any ore already in existence. - for( String name : OreDictionary.getOreNames() ) + for( final String name : OreDictionary.getOreNames() ) { if( name != null && this.shouldCare( name ) ) { - for( ItemStack item : OreDictionary.getOres( name ) ) + for( final ItemStack item : OreDictionary.getOres( name ) ) { if( item != null ) { diff --git a/src/main/java/appeng/server/AECommand.java b/src/main/java/appeng/server/AECommand.java index 59519308..eaac7646 100644 --- a/src/main/java/appeng/server/AECommand.java +++ b/src/main/java/appeng/server/AECommand.java @@ -32,7 +32,7 @@ public final class AECommand extends CommandBase { private final MinecraftServer srv; - public AECommand( MinecraftServer server ) + public AECommand( final MinecraftServer server ) { this.srv = server; } @@ -47,7 +47,7 @@ public final class AECommand extends CommandBase * wtf? */ @Override - public int compareTo( Object arg0 ) + public int compareTo( final Object arg0 ) { return 1; } @@ -59,15 +59,15 @@ 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 ) throws CommandException + final ICommandSender sender, + final String[] args ) throws CommandException { if( args.length == 0 ) { @@ -79,15 +79,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" ); } @@ -100,7 +100,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 ); @@ -110,11 +110,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" ); } diff --git a/src/main/java/appeng/server/Commands.java b/src/main/java/appeng/server/Commands.java index 6b726701..c880ea9f 100644 --- a/src/main/java/appeng/server/Commands.java +++ b/src/main/java/appeng/server/Commands.java @@ -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; diff --git a/src/main/java/appeng/server/ServerHelper.java b/src/main/java/appeng/server/ServerHelper.java index 753936a2..309d4519 100644 --- a/src/main/java/appeng/server/ServerHelper.java +++ b/src/main/java/appeng/server/ServerHelper.java @@ -69,7 +69,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..." ); } @@ -79,7 +79,7 @@ public class ServerHelper extends CommonHelper { if( !Platform.isClient() ) { - MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); + final MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); if( server != null ) { @@ -91,22 +91,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 ) { @@ -117,13 +117,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; } @@ -135,7 +135,7 @@ public class ServerHelper extends CommonHelper } @Override - public void doRenderItem( ItemStack sis, World tile ) + public void doRenderItem( final ItemStack sis, final World tile ) { } @@ -164,7 +164,7 @@ public class ServerHelper extends CommonHelper } @Override - public void updateRenderMode( EntityPlayer player ) + public void updateRenderMode( final EntityPlayer player ) { this.renderModeBased = player; } @@ -176,29 +176,29 @@ public class ServerHelper extends CommonHelper } @Override - public void configureIcon( Object item, String name ) + public void configureIcon( final Object item, final String name ) { } @Override - public ResourceLocation addIcon( String string ) + public ResourceLocation addIcon( final String string ) { // TODO Auto-generated method stub return null; } - 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; diff --git a/src/main/java/appeng/server/subcommands/ChunkLogger.java b/src/main/java/appeng/server/subcommands/ChunkLogger.java index 77730045..9554603c 100644 --- a/src/main/java/appeng/server/subcommands/ChunkLogger.java +++ b/src/main/java/appeng/server/subcommands/ChunkLogger.java @@ -37,7 +37,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 ) { @@ -51,7 +51,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 ) { @@ -66,7 +66,7 @@ public class ChunkLogger implements ISubCommand } @SubscribeEvent - public void onChunkUnloadEvent( ChunkEvent.Unload unload ) + public void onChunkUnloadEvent( final ChunkEvent.Unload unload ) { if( !unload.world.isRemote ) { @@ -76,13 +76,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; diff --git a/src/main/java/appeng/server/subcommands/Supporters.java b/src/main/java/appeng/server/subcommands/Supporters.java index 693c5692..483e15f5 100644 --- a/src/main/java/appeng/server/subcommands/Supporters.java +++ b/src/main/java/appeng/server/subcommands/Supporters.java @@ -31,15 +31,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 ) ) ); } } diff --git a/src/main/java/appeng/services/CompassService.java b/src/main/java/appeng/services/CompassService.java index c07c6fea..57deadad 100644 --- a/src/main/java/appeng/services/CompassService.java +++ b/src/main/java/appeng/services/CompassService.java @@ -67,7 +67,7 @@ public final class CompassService this.jobSize = 0; } - public Future getCompassDirection( DimensionalCoord coord, int maxRange, ICompassCallback cc ) + public Future getCompassDirection( final DimensionalCoord coord, final int maxRange, final ICompassCallback cc ) { this.jobSize++; return this.executor.submit( new CMDirectionRequest( coord, maxRange, cc ) ); @@ -79,7 +79,7 @@ public final class CompassService * @param event the event containing the unloaded world. */ @SubscribeEvent - public void unloadWorld( WorldEvent.Unload event ) + public void unloadWorld( final WorldEvent.Unload event ) { if( Platform.isServer() && this.worldSet.containsKey( event.world ) ) { @@ -102,7 +102,7 @@ public final class CompassService } } - public void updateArea( World w, int chunkX, int chunkZ ) + public void updateArea( final World w, final int chunkX, final int chunkZ ) { final int x = chunkX << 4; final int z = chunkZ << 4; @@ -118,7 +118,7 @@ public final class CompassService this.updateArea( w, x, CHUNK_SIZE + 224, z ); } - public Future updateArea( World w, int x, int y, int z ) + public Future updateArea( final World w, final int x, final int y, final int z ) { this.jobSize++; @@ -140,7 +140,7 @@ public final class CompassService { for( int k = low_y; k < hi_y; k++ ) { - Block blk = c.getBlock( i, k, j ); + final Block blk = c.getBlock( i, k, j ); if( blk == skyStoneBlock ) { return this.executor.submit( new CMUpdatePost( w, cx, cz, cdy, true ) ); @@ -175,7 +175,7 @@ public final class CompassService } } - private CompassReader getReader( World w ) + private CompassReader getReader( final World w ) { CompassReader cr = this.worldSet.get( w ); @@ -188,7 +188,7 @@ public final class CompassService return cr; } - private int dist( int ax, int az, int bx, int bz ) + private int dist( final int ax, final int az, final int bx, final int bz ) { final int up = ( bz - az ) * CHUNK_SIZE; final int side = ( bx - ax ) * CHUNK_SIZE; @@ -196,7 +196,7 @@ public final class CompassService return up * up + side * side; } - private double rad( int ax, int az, int bx, int bz ) + private double rad( final int ax, final int az, final int bx, final int bz ) { final int up = bz - az; final int side = bx - ax; @@ -214,7 +214,7 @@ public final class CompassService public final int doubleChunkY; // 32 blocks instead of 16. public final boolean value; - public CMUpdatePost( World w, int cx, int cz, int dcy, boolean val ) + public CMUpdatePost( final World w, final int cx, final int cz, final int dcy, final boolean val ) { this.world = w; this.chunkX = cx; @@ -246,7 +246,7 @@ public final class CompassService public final DimensionalCoord coord; public final ICompassCallback callback; - public CMDirectionRequest( DimensionalCoord coord, int getMaxRange, ICompassCallback cc ) + public CMDirectionRequest( final DimensionalCoord coord, final int getMaxRange, final ICompassCallback cc ) { this.coord = coord; this.maxRange = getMaxRange; diff --git a/src/main/java/appeng/services/VersionChecker.java b/src/main/java/appeng/services/VersionChecker.java index 86a8a692..6e73e7e6 100644 --- a/src/main/java/appeng/services/VersionChecker.java +++ b/src/main/java/appeng/services/VersionChecker.java @@ -64,7 +64,7 @@ public final class VersionChecker implements Runnable private static final int MS_TO_SEC = 1000; private final VersionCheckerConfig config; - public VersionChecker( VersionCheckerConfig config ) + public VersionChecker( final VersionCheckerConfig config ) { this.config = config; } @@ -92,7 +92,7 @@ public final class VersionChecker implements Runnable * @param nowInMs now in milli seconds * @param lastAfterInterval last version check including the interval defined in the config */ - private void processInterval( long nowInMs, long lastAfterInterval ) + private void processInterval( final long nowInMs, final long lastAfterInterval ) { if( nowInMs > lastAfterInterval ) { @@ -119,7 +119,7 @@ public final class VersionChecker implements Runnable * @param modVersion version of mod * @param githubRelease release retrieved through github */ - private void processVersions( Version modVersion, FormattedRelease githubRelease ) + private void processVersions( final Version modVersion, final FormattedRelease githubRelease ) { final Version githubVersion = githubRelease.version(); final String modFormatted = modVersion.formatted(); @@ -154,7 +154,7 @@ public final class VersionChecker implements Runnable * @param ghFormatted retrieved github version formatted as rv2-beta-8 * @param changelog retrieved github changelog */ - private void interactWithVersionCheckerMod( String modFormatted, String ghFormatted, String changelog ) + private void interactWithVersionCheckerMod( final String modFormatted, final String ghFormatted, final String changelog ) { if( Loader.isModLoaded( "VersionChecker" ) ) { diff --git a/src/main/java/appeng/services/compass/CompassException.java b/src/main/java/appeng/services/compass/CompassException.java index 8d700ffd..61385442 100644 --- a/src/main/java/appeng/services/compass/CompassException.java +++ b/src/main/java/appeng/services/compass/CompassException.java @@ -26,7 +26,7 @@ public class CompassException extends RuntimeException public final Throwable inner; - public CompassException( Throwable t ) + public CompassException( final Throwable t ) { this.inner = t; } diff --git a/src/main/java/appeng/services/compass/CompassReader.java b/src/main/java/appeng/services/compass/CompassReader.java index a74ed740..d360a3f8 100644 --- a/src/main/java/appeng/services/compass/CompassReader.java +++ b/src/main/java/appeng/services/compass/CompassReader.java @@ -34,7 +34,7 @@ public final class CompassReader private final int dimensionId; private final File worldCompassFolder; - public CompassReader( int dimensionId, @Nonnull final File worldCompassFolder ) + public CompassReader( final int dimensionId, @Nonnull final File worldCompassFolder ) { Preconditions.checkNotNull( worldCompassFolder ); Preconditions.checkArgument( worldCompassFolder.isDirectory() ); @@ -45,7 +45,7 @@ public final class CompassReader public void close() { - for( CompassRegion r : this.regions.values() ) + for( final CompassRegion r : this.regions.values() ) { r.close(); } @@ -53,21 +53,21 @@ public final class CompassReader this.regions.clear(); } - public void setHasBeacon( int cx, int cz, int cdy, boolean hasBeacon ) + public void setHasBeacon( final int cx, final int cz, final int cdy, final boolean hasBeacon ) { final CompassRegion r = this.getRegion( cx, cz ); r.setHasBeacon( cx, cz, cdy, hasBeacon ); } - public boolean hasBeacon( int cx, int cz ) + public boolean hasBeacon( final int cx, final int cz ) { final CompassRegion r = this.getRegion( cx, cz ); return r.hasBeacon( cx, cz ); } - private CompassRegion getRegion( int cx, int cz ) + private CompassRegion getRegion( final int cx, final int cz ) { long pos = cx >> 10; pos <<= 32; diff --git a/src/main/java/appeng/services/compass/CompassRegion.java b/src/main/java/appeng/services/compass/CompassRegion.java index 086b34c9..ff47c0ef 100644 --- a/src/main/java/appeng/services/compass/CompassRegion.java +++ b/src/main/java/appeng/services/compass/CompassRegion.java @@ -43,7 +43,7 @@ public final class CompassRegion private RandomAccessFile raf = null; private ByteBuffer buffer; - public CompassRegion( int cx, int cz, int worldID, @Nonnull final File worldCompassFolder ) + public CompassRegion( final int cx, final int cz, final int worldID, @Nonnull final File worldCompassFolder ) { Preconditions.checkNotNull( worldCompassFolder ); Preconditions.checkArgument( worldCompassFolder.isDirectory() ); @@ -73,7 +73,7 @@ public final class CompassRegion this.hasFile = false; } } - catch( Throwable t ) + catch( final Throwable t ) { throw new CompassException( t ); } @@ -96,7 +96,7 @@ public final class CompassRegion return false; } - public void setHasBeacon( int cx, int cz, int cdy, boolean hasBeacon ) + public void setHasBeacon( int cx, int cz, final int cdy, final boolean hasBeacon ) { cx &= 0x3FF; cz &= 0x3FF; @@ -141,7 +141,7 @@ public final class CompassRegion } - private void openFile( boolean create ) + private void openFile( final boolean create ) { if( this.hasFile ) { @@ -172,12 +172,12 @@ public final class CompassRegion return new File( this.worldCompassFolder, fileName ); } - private boolean isFileExistent( File file ) + private boolean isFileExistent( final File file ) { return file.exists() && file.isFile(); } - private int read( int cx, int cz ) + private int read( final int cx, final int cz ) { try { @@ -185,17 +185,17 @@ public final class CompassRegion // raf.seek( cx + cz * 0x400 ); // return raf.readByte(); } - catch( IndexOutOfBoundsException outOfBounds ) + catch( final IndexOutOfBoundsException outOfBounds ) { return 0; } - catch( Throwable t ) + catch( final Throwable t ) { throw new CompassException( t ); } } - private void write( int cx, int cz, int val ) + private void write( final int cx, final int cz, final int val ) { try { @@ -203,7 +203,7 @@ public final class CompassRegion // raf.seek( cx + cz * 0x400 ); // raf.writeByte( val ); } - catch( Throwable t ) + catch( final Throwable t ) { throw new CompassException( t ); } diff --git a/src/main/java/appeng/services/version/BaseVersion.java b/src/main/java/appeng/services/version/BaseVersion.java index 3384a300..c534a0c5 100644 --- a/src/main/java/appeng/services/version/BaseVersion.java +++ b/src/main/java/appeng/services/version/BaseVersion.java @@ -19,7 +19,7 @@ public abstract class BaseVersion implements Version * * @throws AssertionError if assertion are enabled and revision or build are not natural numbers */ - public BaseVersion( int revision, Channel channel, int build ) + public BaseVersion( final int revision, final Channel channel, final int build ) { assert revision >= 0; assert build >= 0; @@ -63,7 +63,7 @@ public abstract class BaseVersion implements Version } @Override - public final boolean equals( Object o ) + public final boolean equals( final Object o ) { if( this == o ) { @@ -74,7 +74,7 @@ public abstract class BaseVersion implements Version return false; } - Version that = (Version) o; + final Version that = (Version) o; if( this.revision != that.revision() ) { diff --git a/src/main/java/appeng/services/version/DefaultVersion.java b/src/main/java/appeng/services/version/DefaultVersion.java index 3c0ad5f3..07376447 100644 --- a/src/main/java/appeng/services/version/DefaultVersion.java +++ b/src/main/java/appeng/services/version/DefaultVersion.java @@ -12,13 +12,13 @@ public final class DefaultVersion extends BaseVersion * @param channel either alpha, beta or release * @param build natural number */ - public DefaultVersion( int revision, Channel channel, int build ) + public DefaultVersion( final int revision, final Channel channel, final int build ) { super( revision, channel, build ); } @Override - public boolean isNewerAs( Version maybeOlder ) + public boolean isNewerAs( final Version maybeOlder ) { if( this.revision() > maybeOlder.revision() ) { diff --git a/src/main/java/appeng/services/version/DoNotCheckVersion.java b/src/main/java/appeng/services/version/DoNotCheckVersion.java index 455f7414..9edff745 100644 --- a/src/main/java/appeng/services/version/DoNotCheckVersion.java +++ b/src/main/java/appeng/services/version/DoNotCheckVersion.java @@ -30,7 +30,7 @@ public final class DoNotCheckVersion extends BaseVersion } @Override - public boolean isNewerAs( Version maybeOlder ) + public boolean isNewerAs( final Version maybeOlder ) { return true; } diff --git a/src/main/java/appeng/services/version/MissingVersion.java b/src/main/java/appeng/services/version/MissingVersion.java index bf0a6298..84a2935b 100644 --- a/src/main/java/appeng/services/version/MissingVersion.java +++ b/src/main/java/appeng/services/version/MissingVersion.java @@ -17,7 +17,7 @@ public final class MissingVersion extends BaseVersion * @return false */ @Override - public boolean isNewerAs( Version maybeOlder ) + public boolean isNewerAs( final Version maybeOlder ) { return false; } diff --git a/src/main/java/appeng/services/version/ModVersionFetcher.java b/src/main/java/appeng/services/version/ModVersionFetcher.java index a687226a..85024452 100644 --- a/src/main/java/appeng/services/version/ModVersionFetcher.java +++ b/src/main/java/appeng/services/version/ModVersionFetcher.java @@ -11,7 +11,7 @@ public final class ModVersionFetcher implements VersionFetcher private final String rawModVersion; private final VersionParser parser; - public ModVersionFetcher( String rawModVersion, VersionParser parser ) + public ModVersionFetcher( final String rawModVersion, final VersionParser parser ) { this.rawModVersion = rawModVersion; this.parser = parser; diff --git a/src/main/java/appeng/services/version/VersionCheckerConfig.java b/src/main/java/appeng/services/version/VersionCheckerConfig.java index 5282bc79..6c034bae 100644 --- a/src/main/java/appeng/services/version/VersionCheckerConfig.java +++ b/src/main/java/appeng/services/version/VersionCheckerConfig.java @@ -49,7 +49,7 @@ public final class VersionCheckerConfig /** * @param file requires fully qualified file in which the config is saved */ - public VersionCheckerConfig( File file ) + public VersionCheckerConfig( final File file ) { this.config = new Configuration( file ); diff --git a/src/main/java/appeng/services/version/VersionParser.java b/src/main/java/appeng/services/version/VersionParser.java index ef219250..5a2460bd 100644 --- a/src/main/java/appeng/services/version/VersionParser.java +++ b/src/main/java/appeng/services/version/VersionParser.java @@ -44,7 +44,7 @@ public final class VersionParser * * @throws AssertionError if raw String does not match pattern of a {@link Version} */ - public Version parse( String raw ) + public Version parse( final String raw ) { final String transformed = this.transformDelimiter( raw ); final String[] split = transformed.split( "_" ); @@ -59,7 +59,7 @@ public final class VersionParser * * @return transformed raw, where "." and "-" are replaced by "_" */ - private String transformDelimiter( String raw ) + private String transformDelimiter( final String raw ) { assert raw.contains( "." ) || raw.contains( "-" ); @@ -78,7 +78,7 @@ public final class VersionParser * * @return {@link Version} represented by the splitRaw */ - private Version parseVersion( String[] splitRaw ) + private Version parseVersion( final String[] splitRaw ) { assert splitRaw.length == 3; @@ -100,7 +100,7 @@ public final class VersionParser * * @return revision number */ - private int parseRevision( String rawRevision ) + private int parseRevision( final String rawRevision ) { assert PATTERN_VALID_REVISION.matcher( rawRevision ).matches(); @@ -120,11 +120,11 @@ public final class VersionParser * * @return matching {@link Channel} to the String */ - private Channel parseChannel( String rawChannel ) + private Channel parseChannel( final String rawChannel ) { assert rawChannel.equalsIgnoreCase( Channel.Alpha.name() ) || rawChannel.equalsIgnoreCase( Channel.Beta.name() ) || rawChannel.equalsIgnoreCase( Channel.Stable.name() ); - for( Channel channel : Channel.values() ) + for( final Channel channel : Channel.values() ) { if( channel.name().equalsIgnoreCase( rawChannel ) ) { @@ -142,7 +142,7 @@ public final class VersionParser * * @return build number */ - private int parseBuild( String rawBuild ) + private int parseBuild( final String rawBuild ) { assert PATTERN_NATURAL.matcher( rawBuild ).matches(); diff --git a/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java b/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java index 1d63a0e4..12ad304d 100644 --- a/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java +++ b/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java @@ -12,7 +12,7 @@ public final class DefaultFormattedRelease implements FormattedRelease private final Version version; private final String changelog; - public DefaultFormattedRelease( Version version, String changelog ) + public DefaultFormattedRelease( final Version version, final String changelog ) { this.version = version; this.changelog = changelog; diff --git a/src/main/java/appeng/services/version/github/ReleaseFetcher.java b/src/main/java/appeng/services/version/github/ReleaseFetcher.java index 676cd85f..0ac1b5e3 100644 --- a/src/main/java/appeng/services/version/github/ReleaseFetcher.java +++ b/src/main/java/appeng/services/version/github/ReleaseFetcher.java @@ -27,7 +27,7 @@ public final class ReleaseFetcher private final VersionCheckerConfig config; private final VersionParser parser; - public ReleaseFetcher( VersionCheckerConfig config, VersionParser parser ) + public ReleaseFetcher( final VersionCheckerConfig config, final VersionParser parser ) { this.config = config; this.parser = parser; @@ -50,11 +50,11 @@ public final class ReleaseFetcher return latestFitRelease; } - catch( MalformedURLException e ) + catch( final MalformedURLException e ) { AELog.error( e ); } - catch( IOException e ) + catch( final IOException e ) { AELog.warning( "Could not connect to %s.", GITHUB_RELEASES_URL ); } @@ -62,18 +62,18 @@ public final class ReleaseFetcher return EXCEPTIONAL_RELEASE; } - private String getRawReleases( URL url ) throws IOException + private String getRawReleases( final URL url ) throws IOException { return IOUtils.toString( url ); } - private FormattedRelease getLatestFitRelease( Iterable releases ) + private FormattedRelease getLatestFitRelease( final Iterable releases ) { final String levelInConfig = this.config.level(); final Channel level = Channel.valueOf( levelInConfig ); final int levelOrdinal = level.ordinal(); - for( Release release : releases ) + for( final Release release : releases ) { final String rawVersion = release.tag_name; final String changelog = release.body; diff --git a/src/main/java/appeng/spatial/BiomeGenStorage.java b/src/main/java/appeng/spatial/BiomeGenStorage.java index 4e262b48..79e9e077 100644 --- a/src/main/java/appeng/spatial/BiomeGenStorage.java +++ b/src/main/java/appeng/spatial/BiomeGenStorage.java @@ -25,7 +25,7 @@ import net.minecraft.world.biome.BiomeGenBase; public class BiomeGenStorage extends BiomeGenBase { - public BiomeGenStorage( int id ) + public BiomeGenStorage( final int id ) { super( id ); this.setBiomeName( "Storage Cell" ); diff --git a/src/main/java/appeng/spatial/CachedPlane.java b/src/main/java/appeng/spatial/CachedPlane.java index f37042e4..08808dc8 100644 --- a/src/main/java/appeng/spatial/CachedPlane.java +++ b/src/main/java/appeng/spatial/CachedPlane.java @@ -63,7 +63,7 @@ public class CachedPlane private final IBlockDefinition matrixFrame = AEApi.instance().definitions().blocks().matrixFrame(); int verticalBits; - public CachedPlane( World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) + public CachedPlane( final World w, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ ) { this.world = w; @@ -76,15 +76,15 @@ public class CachedPlane this.y_offset = minY; this.z_offset = minZ; - int minCX = minX >> 4; - int minCY = minY >> 4; - int minCZ = minZ >> 4; - int maxCX = maxX >> 4; - int maxCY = maxY >> 4; - int maxCZ = maxZ >> 4; + final int minCX = minX >> 4; + final int minCY = minY >> 4; + final int minCZ = minZ >> 4; + final int maxCX = maxX >> 4; + final int maxCY = maxY >> 4; + final int maxCZ = maxZ >> 4; this.cx_size = maxCX - minCX + 1; - int cy_size = maxCY - minCY + 1; + final int cy_size = maxCY - minCY + 1; this.cz_size = maxCZ - minCZ + 1; this.myChunks = new Chunk[this.cx_size][this.cz_size]; @@ -104,25 +104,25 @@ public class CachedPlane } } - IMovableRegistry mr = AEApi.instance().registries().movable(); + final IMovableRegistry mr = AEApi.instance().registries().movable(); for( int cx = 0; cx < this.cx_size; cx++ ) { for( int cz = 0; cz < this.cz_size; cz++ ) { - LinkedList> rawTiles = new LinkedList>(); - LinkedList deadTiles = new LinkedList(); + final LinkedList> rawTiles = new LinkedList>(); + final LinkedList deadTiles = new LinkedList(); - Chunk c = w.getChunkFromChunkCoords( minCX + cx, minCZ + cz ); + final Chunk c = w.getChunkFromChunkCoords( minCX + cx, minCZ + cz ); this.myChunks[cx][cz] = c; rawTiles.addAll( ( (HashMap) c.getTileEntityMap() ).entrySet() ); - for( Entry tx : rawTiles ) + for( final Entry tx : rawTiles ) { - BlockPos cp = tx.getKey(); - TileEntity te = tx.getValue(); + final BlockPos cp = tx.getKey(); + final TileEntity te = tx.getValue(); - BlockPos tePOS = te.getPos(); + final BlockPos tePOS = te.getPos(); if( tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS.getZ() <= maxZ ) { if( mr.askToMove( te ) ) @@ -132,8 +132,8 @@ public class CachedPlane } else { - Object[] details = this.myColumns[tePOS.getX() - minX][tePOS.getZ() - minZ].getDetails( tePOS.getY() ); - Block blk = (Block) details[0]; + final Object[] details = this.myColumns[tePOS.getX() - minX][tePOS.getZ() - minZ].getDetails( tePOS.getY() ); + final Block blk = (Block) details[0]; // don't skip air, just let the code replace it... if( blk != null && blk.isAir( c.getWorld(), tePOS ) && blk.isReplaceable( c.getWorld(), tePOS ) ) @@ -148,22 +148,22 @@ public class CachedPlane } } - for( BlockPos cp : deadTiles ) + for( final BlockPos cp : deadTiles ) { c.getTileEntityMap().remove( cp ); } - long k = this.world.getTotalWorldTime(); - List list = this.world.getPendingBlockUpdates( c, false ); + final long k = this.world.getTotalWorldTime(); + final List list = this.world.getPendingBlockUpdates( c, false ); if( list != null ) { - for( Object o : list ) + for( final Object o : list ) { - NextTickListEntry entry = (NextTickListEntry) o; - BlockPos tePOS = entry.position; + final NextTickListEntry entry = (NextTickListEntry) o; + final BlockPos tePOS = entry.position; if( tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS.getZ() <= maxZ ) { - NextTickListEntry newEntry = new NextTickListEntry( tePOS, entry.getBlock() ); + final NextTickListEntry newEntry = new NextTickListEntry( tePOS, entry.getBlock() ); newEntry.scheduledTime = entry.scheduledTime - k; this.ticks.add( newEntry ); } @@ -172,28 +172,28 @@ public class CachedPlane } } - for( TileEntity te : this.tiles ) + for( final TileEntity te : this.tiles ) { try { this.world.loadedTileEntityList.remove( te ); } - catch( Exception e ) + catch( final Exception e ) { AELog.error( e ); } } } - private IMovableHandler getHandler( TileEntity te ) + private IMovableHandler getHandler( final TileEntity te ) { - IMovableRegistry mr = AEApi.instance().registries().movable(); + final IMovableRegistry mr = AEApi.instance().registries().movable(); return mr.getHandler( te ); } - void swap( CachedPlane dst ) + void swap( final CachedPlane dst ) { - IMovableRegistry mr = AEApi.instance().registries().movable(); + final IMovableRegistry mr = AEApi.instance().registries().movable(); if( dst.x_size == this.x_size && dst.y_size == this.y_size && dst.z_size == this.z_size ) { @@ -205,18 +205,18 @@ public class CachedPlane { for( int z = 0; z < this.z_size; z++ ) { - Column a = this.myColumns[x][z]; - Column b = dst.myColumns[x][z]; + final Column a = this.myColumns[x][z]; + final Column b = dst.myColumns[x][z]; for( int y = 0; y < this.y_size; y++ ) { - int src_y = y + this.y_offset; - int dst_y = y + dst.y_offset; + final int src_y = y + this.y_offset; + final int dst_y = y + dst.y_offset; if( a.doNotSkip( src_y ) && b.doNotSkip( dst_y ) ) { - Object[] aD = a.getDetails( src_y ); - Object[] bD = b.getDetails( dst_y ); + final Object[] aD = a.getDetails( src_y ); + final Object[] bD = b.getDetails( dst_y ); a.setBlockIDWithMetadata( src_y, bD ); b.setBlockIDWithMetadata( dst_y, aD ); @@ -234,27 +234,27 @@ public class CachedPlane long duration = endTime - startTime; AELog.info( "Block Copy Time: " + duration ); - for( TileEntity te : this.tiles ) + for( final TileEntity te : this.tiles ) { - BlockPos tePOS = te.getPos(); + final BlockPos tePOS = te.getPos(); dst.addTile( tePOS.getX() - this.x_offset, tePOS.getY() - this.y_offset, tePOS.getZ() - this.z_offset, te, this, mr ); } - for( TileEntity te : dst.tiles ) + for( final TileEntity te : dst.tiles ) { - BlockPos tePOS = te.getPos(); + final BlockPos tePOS = te.getPos(); this.addTile( tePOS.getX() - dst.x_offset, tePOS.getY() - dst.y_offset, tePOS.getZ() - dst.z_offset, te, dst, mr ); } - for( NextTickListEntry entry : this.ticks ) + for( final NextTickListEntry entry : this.ticks ) { - BlockPos tePOS = entry.position; + final BlockPos tePOS = entry.position; dst.addTick( tePOS.getX() - this.x_offset, tePOS.getY() - this.y_offset, tePOS.getZ() - this.z_offset, entry ); } - for( NextTickListEntry entry : dst.ticks ) + for( final NextTickListEntry entry : dst.ticks ) { - BlockPos tePOS = entry.position; + final BlockPos tePOS = entry.position; this.addTick( tePOS.getX() - dst.x_offset, tePOS.getY() - dst.y_offset, tePOS.getZ() - dst.z_offset, entry ); } @@ -268,39 +268,39 @@ public class CachedPlane } } - private void markForUpdate( int x, int y, int z ) + private void markForUpdate( final int x, final int y, final int z ) { this.updates.add( new WorldCoord( x, y, z ) ); - for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) { this.updates.add( new WorldCoord( x + d.xOffset, y + d.yOffset, z + d.zOffset ) ); } } - private void addTick( int x, int y, int z, NextTickListEntry entry ) + private void addTick( final int x, final int y, final int z, final NextTickListEntry entry ) { this.world.scheduleUpdate( new BlockPos( x + this.x_offset, y + this.y_offset, z + this.z_offset ), entry.getBlock(), (int) entry.scheduledTime ); } - private void addTile( int x, int y, int z, TileEntity te, CachedPlane alternateDestination, IMovableRegistry mr ) + private void addTile( final int x, final int y, final int z, final TileEntity te, final CachedPlane alternateDestination, final IMovableRegistry mr ) { try { - Column c = this.myColumns[x][z]; + final Column c = this.myColumns[x][z]; if( c.doNotSkip( y + this.y_offset ) || alternateDestination == null ) { - IMovableHandler handler = this.getHandler( te ); + final IMovableHandler handler = this.getHandler( te ); try { handler.moveTile( te, this.world, new BlockPos( x + this.x_offset, y + this.y_offset, z + this.z_offset ) ); } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); - BlockPos pos = new BlockPos( x,y,z); + final BlockPos pos = new BlockPos( x,y,z); // attempt recovery... te.setWorldObj( this.world ); @@ -322,7 +322,7 @@ public class CachedPlane alternateDestination.addTile( x, y, z, te, null, mr ); } } - catch( Throwable e ) + catch( final Throwable e ) { AELog.error( e ); } @@ -336,7 +336,7 @@ public class CachedPlane { for( int z = 0; z < this.cz_size; z++ ) { - Chunk c = this.myChunks[x][z]; + final Chunk c = this.myChunks[x][z]; c.resetRelightChecks(); c.generateSkylightMap(); c.setModified( true ); @@ -349,7 +349,7 @@ public class CachedPlane for( int z = 0; z < this.cz_size; z++ ) { - Chunk c = this.myChunks[x][z]; + final Chunk c = this.myChunks[x][z]; for( int y = 1; y < 255; y += 32 ) { @@ -371,7 +371,7 @@ public class CachedPlane private final ExtendedBlockStorage[] storage; private List skipThese = null; - public Column( Chunk chunk, int x, int z, int chunkY, int chunkHeight ) + public Column( final Chunk chunk, final int x, final int z, final int chunkY, final int chunkHeight ) { this.x = x; this.z = z; @@ -381,7 +381,7 @@ public class CachedPlane // make sure storage exists before hand... for( int ay = 0; ay < chunkHeight; ay++ ) { - int by = ( ay + chunkY ); + final int by = ( ay + chunkY ); ExtendedBlockStorage extendedblockstorage = this.storage[by]; if( extendedblockstorage == null ) { @@ -390,9 +390,9 @@ public class CachedPlane } } - public void setBlockIDWithMetadata( int y, Object[] blk ) + public void setBlockIDWithMetadata( final int y, final Object[] blk ) { - for( Block matrixFrameBlock : CachedPlane.this.matrixFrame.maybeBlock().asSet() ) + for( final Block matrixFrameBlock : CachedPlane.this.matrixFrame.maybeBlock().asSet() ) { if( blk[0] == matrixFrameBlock ) { @@ -400,23 +400,23 @@ public class CachedPlane } } - ExtendedBlockStorage extendedBlockStorage = this.storage[y >> 4]; + final ExtendedBlockStorage extendedBlockStorage = this.storage[y >> 4]; extendedBlockStorage.set( this.x, y & 15, this.z, (IBlockState) blk[0] ); // extendedBlockStorage.setExtBlockID( x, y & 15, z, blk[0] ); extendedBlockStorage.setExtBlocklightValue( this.x, y & 15, this.z, (Integer) blk[1] ); } - public Object[] getDetails( int y ) + public Object[] getDetails( final int y ) { - ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; + final ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; this.ch[0] = extendedblockstorage.get( this.x, y & 15, this.z ); this.ch[1] = extendedblockstorage.getExtBlocklightValue( this.x, y & 15, this.z ); return this.ch; } - public boolean doNotSkip( int y ) + public boolean doNotSkip( final int y ) { - ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; + final ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4]; if( CachedPlane.this.reg.isBlacklisted( extendedblockstorage.getBlockByExtId( this.x, y & 15, this.z ) ) ) { return false; @@ -425,7 +425,7 @@ public class CachedPlane return this.skipThese == null || !this.skipThese.contains( y ); } - public void setSkip( int yCoord ) + public void setSkip( final int yCoord ) { if( this.skipThese == null ) { diff --git a/src/main/java/appeng/spatial/DefaultSpatialHandler.java b/src/main/java/appeng/spatial/DefaultSpatialHandler.java index 92242e00..6372bd6a 100644 --- a/src/main/java/appeng/spatial/DefaultSpatialHandler.java +++ b/src/main/java/appeng/spatial/DefaultSpatialHandler.java @@ -37,18 +37,18 @@ public class DefaultSpatialHandler implements IMovableHandler * @return true */ @Override - public boolean canHandle( Class myClass, TileEntity tile ) + public boolean canHandle( final Class myClass, final TileEntity tile ) { return true; } @Override - public void moveTile( TileEntity te, World w, BlockPos newPosition ) + public void moveTile( final TileEntity te, final World w, final BlockPos newPosition ) { te.setWorldObj( w ); te.setPos( newPosition ); - Chunk c = w.getChunkFromBlockCoords( newPosition ); + final Chunk c = w.getChunkFromBlockCoords( newPosition ); c.addTileEntity( newPosition, te ); if( c.isLoaded() ) diff --git a/src/main/java/appeng/spatial/StorageChunkProvider.java b/src/main/java/appeng/spatial/StorageChunkProvider.java index fa072916..67e0222c 100644 --- a/src/main/java/appeng/spatial/StorageChunkProvider.java +++ b/src/main/java/appeng/spatial/StorageChunkProvider.java @@ -43,7 +43,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate { BLOCKS = new Block[255 * SQUARE_CHUNK_SIZE]; - for( Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() ) + for( final Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() ) { for( int x = 0; x < BLOCKS.length; x++ ) { @@ -54,19 +54,19 @@ public class StorageChunkProvider extends ChunkProviderGenerate final World world; - public StorageChunkProvider( World world, long i ) + public StorageChunkProvider( final World world, final long i ) { super( world, i, false, null ); this.world = world; } @Override - public Chunk provideChunk( int x, int z ) + public Chunk provideChunk( final int x, final int z ) { - Chunk chunk = new Chunk( this.world, x, z ); + final Chunk chunk = new Chunk( this.world, x, z ); - byte[] biomes = chunk.getBiomeArray(); - AEConfig config = AEConfig.instance; + final byte[] biomes = chunk.getBiomeArray(); + final AEConfig config = AEConfig.instance; for( int k = 0; k < biomes.length; ++k ) { @@ -83,7 +83,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate } @Override - public void populate( IChunkProvider par1iChunkProvider, int par2, int par3 ) + public void populate( final IChunkProvider par1iChunkProvider, final int par2, final int par3 ) { } @@ -95,7 +95,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate } @Override - public List getPossibleCreatures( EnumCreatureType creatureType, BlockPos pos ) + public List getPossibleCreatures( final EnumCreatureType creatureType, final BlockPos pos ) { return new ArrayList(); } diff --git a/src/main/java/appeng/spatial/StorageHelper.java b/src/main/java/appeng/spatial/StorageHelper.java index 4894af51..5685377c 100644 --- a/src/main/java/appeng/spatial/StorageHelper.java +++ b/src/main/java/appeng/spatial/StorageHelper.java @@ -63,11 +63,11 @@ public class StorageHelper * * @return teleported entity */ - public Entity teleportEntity( Entity entity, TelDestination link ) + public Entity teleportEntity( Entity entity, final TelDestination link ) { - WorldServer oldWorld; - WorldServer newWorld; - EntityPlayerMP player; + final WorldServer oldWorld; + final WorldServer newWorld; + final EntityPlayerMP player; try { @@ -75,7 +75,7 @@ public class StorageHelper newWorld = (WorldServer) link.dim; player = ( entity instanceof EntityPlayerMP ) ? (EntityPlayerMP) entity : null; } - catch( Throwable e ) + catch( final Throwable e ) { return entity; } @@ -106,7 +106,7 @@ public class StorageHelper // load the chunk! WorldServer.class.cast( newWorld ).getChunkProvider().provideChunk( MathHelper.floor_double( link.x ) >> 4, MathHelper.floor_double( link.z ) >> 4 ); - boolean diffDestination = newWorld != oldWorld; + final boolean diffDestination = newWorld != oldWorld; if( diffDestination ) { if( player != null ) @@ -120,8 +120,8 @@ public class StorageHelper } else { - int entX = entity.chunkCoordX; - int entZ = entity.chunkCoordZ; + final int entX = entity.chunkCoordX; + final int entZ = entity.chunkCoordZ; if( ( entity.addedToChunk ) && ( oldWorld.getChunkProvider().chunkExists( entX, entZ ) ) ) { @@ -129,7 +129,7 @@ public class StorageHelper oldWorld.getChunkFromChunkCoords( entX, entZ ).setModified( true ); } - Entity newEntity = EntityList.createEntityByName( EntityList.getEntityString( entity ), newWorld ); + final Entity newEntity = EntityList.createEntityByName( EntityList.getEntityString( entity ), newWorld ); if( newEntity != null ) { entity.lastTickPosX = entity.prevPosX = entity.posX = link.x; @@ -138,7 +138,7 @@ public class StorageHelper if( entity instanceof EntityHanging ) { - EntityHanging h = (EntityHanging) entity; + final EntityHanging h = (EntityHanging) entity; h.setPosition( link.x, link.y, link.z ); // TODO: VERIFIY THIS WORKS } @@ -176,7 +176,7 @@ public class StorageHelper return entity; } - public void transverseEdges( int minX, int minY, int minZ, int maxX, int maxY, int maxZ, ISpatialVisitor visitor ) + public void transverseEdges( final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ, final ISpatialVisitor visitor ) { for( int y = minY; y < maxY; y++ ) { @@ -206,42 +206,42 @@ public class StorageHelper } } - public void swapRegions( World src /** over world **/, World dst /** storage cell **/, int x, int y, int z, int i, int j, int k, int scaleX, int scaleY, int scaleZ ) + public void swapRegions( final World src /** over world **/, final World dst /** storage cell **/, final int x, final int y, final int z, final int i, final int j, final int k, final int scaleX, final int scaleY, final int scaleZ ) { - for( Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() ) + for( final Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() ) { this.transverseEdges( i - 1, j - 1, k - 1, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1, new WrapInMatrixFrame( matrixFrameBlock.getDefaultState(), dst ) ); } - AxisAlignedBB srcBox = AxisAlignedBB.fromBounds( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 ); + final AxisAlignedBB srcBox = AxisAlignedBB.fromBounds( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 ); - AxisAlignedBB dstBox = AxisAlignedBB.fromBounds( i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1 ); + final AxisAlignedBB dstBox = AxisAlignedBB.fromBounds( i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1 ); - CachedPlane cDst = new CachedPlane( dst, i, j, k, i + scaleX, j + scaleY, k + scaleZ ); - CachedPlane cSrc = new CachedPlane( src, x, y, z, x + scaleX, y + scaleY, z + scaleZ ); + final CachedPlane cDst = new CachedPlane( dst, i, j, k, i + scaleX, j + scaleY, k + scaleZ ); + final CachedPlane cSrc = new CachedPlane( src, x, y, z, x + scaleX, y + scaleY, z + scaleZ ); // do nearly all the work... swaps blocks, tiles, and block ticks cSrc.swap( cDst ); - List srcE = src.getEntitiesWithinAABB( Entity.class, srcBox ); - List dstE = dst.getEntitiesWithinAABB( Entity.class, dstBox ); + final List srcE = src.getEntitiesWithinAABB( Entity.class, srcBox ); + final List dstE = dst.getEntitiesWithinAABB( Entity.class, dstBox ); - for( Entity e : dstE ) + for( final Entity e : dstE ) { this.teleportEntity( e, new TelDestination( src, srcBox, e.posX, e.posY, e.posZ, -i + x, -j + y, -k + z ) ); } - for( Entity e : srcE ) + for( final Entity e : srcE ) { this.teleportEntity( e, new TelDestination( dst, dstBox, e.posX, e.posY, e.posZ, -x + i, -y + j, -z + k ) ); } - for( WorldCoord wc : cDst.updates ) + for( final WorldCoord wc : cDst.updates ) { cSrc.world.notifyBlockOfStateChange( wc.getPos(), Platform.AIR_BLOCK ); } - for( WorldCoord wc : cSrc.updates ) + for( final WorldCoord wc : cSrc.updates ) { cSrc.world.notifyBlockOfStateChange( wc.getPos(), Platform.AIR_BLOCK ); } @@ -266,15 +266,15 @@ public class StorageHelper final World dst; - public TriggerUpdates( World dst2 ) + public TriggerUpdates( final World dst2 ) { this.dst = dst2; } @Override - public void visit( BlockPos pos ) + public void visit( final BlockPos pos ) { - Block blk = this.dst.getBlockState( pos ).getBlock(); + final Block blk = this.dst.getBlockState( pos ).getBlock(); blk.onNeighborBlockChange( this.dst, pos, Platform.AIR_BLOCK.getDefaultState(), Platform.AIR_BLOCK); } } @@ -286,14 +286,14 @@ public class StorageHelper final World dst; final IBlockState state; - public WrapInMatrixFrame( IBlockState state, World dst2 ) + public WrapInMatrixFrame( final IBlockState state, final World dst2 ) { this.dst = dst2; this.state = state; } @Override - public void visit( BlockPos pos ) + public void visit( final BlockPos pos ) { this.dst.setBlockState( pos, state ); } @@ -311,7 +311,7 @@ public class StorageHelper final int yOff; final int zOff; - TelDestination( World dimension, AxisAlignedBB srcBox, double x, double y, double z, int tileX, int tileY, int tileZ ) + TelDestination( final World dimension, final AxisAlignedBB srcBox, final double x, final double y, final double z, final int tileX, final int tileY, final int tileZ ) { this.dim = dimension; this.x = Math.min( srcBox.maxX - 0.5, Math.max( srcBox.minX + 0.5, x + tileX ) ); @@ -329,7 +329,7 @@ public class StorageHelper final TelDestination destination; - public METeleporter( WorldServer par1WorldServer, TelDestination d ) + public METeleporter( final WorldServer par1WorldServer, final TelDestination d ) { super( par1WorldServer ); this.destination = d; @@ -337,8 +337,8 @@ public class StorageHelper @Override public void placeInPortal( - Entity par1Entity, - float rotationYaw ) + final Entity par1Entity, + final float rotationYaw ) { par1Entity.setLocationAndAngles( this.destination.x, this.destination.y, this.destination.z, par1Entity.rotationYaw, 0.0F ); par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D; @@ -346,20 +346,20 @@ public class StorageHelper @Override public boolean placeInExistingPortal( - Entity entityIn, - float p_180620_2_ ) + final Entity entityIn, + final float p_180620_2_ ) { return false; } @Override - public boolean makePortal( Entity par1Entity ) + public boolean makePortal( final Entity par1Entity ) { return false; } @Override - public void removeStalePortalLocations( long par1 ) + public void removeStalePortalLocations( final long par1 ) { } diff --git a/src/main/java/appeng/spatial/StorageWorldProvider.java b/src/main/java/appeng/spatial/StorageWorldProvider.java index d3f3355d..96e262f8 100644 --- a/src/main/java/appeng/spatial/StorageWorldProvider.java +++ b/src/main/java/appeng/spatial/StorageWorldProvider.java @@ -54,7 +54,7 @@ public class StorageWorldProvider extends WorldProvider } @Override - public float calculateCelestialAngle( long par1, float par3 ) + public float calculateCelestialAngle( final long par1, final float par3 ) { return 0; } @@ -67,13 +67,13 @@ public class StorageWorldProvider extends WorldProvider @Override @SideOnly( Side.CLIENT ) - public float[] calcSunriseSunsetColors( float celestialAngle, float partialTicks ) + public float[] calcSunriseSunsetColors( final float celestialAngle, final float partialTicks ) { return null; } @Override - public Vec3 getFogColor( float par1, float par2 ) + public Vec3 getFogColor( final float par1, final float par2 ) { return new Vec3( 0.07, 0.07, 0.07 ); } @@ -92,7 +92,7 @@ public class StorageWorldProvider extends WorldProvider } @Override - public boolean doesXZShowFog( int par1, int par2 ) + public boolean doesXZShowFog( final int par1, final int par2 ) { return false; } @@ -116,19 +116,19 @@ public class StorageWorldProvider extends WorldProvider } @Override - public Vec3 getSkyColor( Entity cameraEntity, float partialTicks ) + public Vec3 getSkyColor( final Entity cameraEntity, final float partialTicks ) { return new Vec3( 0.07, 0.07, 0.07 ); } @Override - public float getStarBrightness( float par1 ) + public float getStarBrightness( final float par1 ) { return 0; } @Override - public boolean canSnowAt( BlockPos pos, boolean checkLight ) + public boolean canSnowAt( final BlockPos pos, final boolean checkLight ) { return false; } @@ -140,13 +140,13 @@ public class StorageWorldProvider extends WorldProvider } @Override - public boolean isBlockHighHumidity( BlockPos pos ) + public boolean isBlockHighHumidity( final BlockPos pos ) { return false; } @Override - public boolean canDoLightning( Chunk chunk ) + public boolean canDoLightning( final Chunk chunk ) { return false; } diff --git a/src/main/java/appeng/tile/AEBaseInvTile.java b/src/main/java/appeng/tile/AEBaseInvTile.java index 99cb76c5..3de09325 100644 --- a/src/main/java/appeng/tile/AEBaseInvTile.java +++ b/src/main/java/appeng/tile/AEBaseInvTile.java @@ -47,13 +47,13 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AEBaseInvTile( net.minecraft.nbt.NBTTagCompound data ) + public void readFromNBT_AEBaseInvTile( final net.minecraft.nbt.NBTTagCompound data ) { - IInventory inv = this.getInternalInventory(); - NBTTagCompound opt = data.getCompoundTag( "inv" ); + final IInventory inv = this.getInternalInventory(); + final NBTTagCompound opt = data.getCompoundTag( "inv" ); for( int x = 0; x < inv.getSizeInventory(); x++ ) { - NBTTagCompound item = opt.getCompoundTag( "item" + x ); + final NBTTagCompound item = opt.getCompoundTag( "item" + x ); inv.setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( item ) ); } } @@ -61,14 +61,14 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor public abstract IInventory getInternalInventory(); @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AEBaseInvTile( net.minecraft.nbt.NBTTagCompound data ) + public void writeToNBT_AEBaseInvTile( final net.minecraft.nbt.NBTTagCompound data ) { - IInventory inv = this.getInternalInventory(); - NBTTagCompound opt = new NBTTagCompound(); + final IInventory inv = this.getInternalInventory(); + final NBTTagCompound opt = new NBTTagCompound(); for( int x = 0; x < inv.getSizeInventory(); x++ ) { - NBTTagCompound item = new NBTTagCompound(); - ItemStack is = this.getStackInSlot( x ); + final NBTTagCompound item = new NBTTagCompound(); + final ItemStack is = this.getStackInSlot( x ); if( is != null ) { is.writeToNBT( item ); @@ -85,25 +85,25 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.getInternalInventory().getStackInSlot( i ); } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return this.getInternalInventory().decrStackSize( i, j ); } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return null; } @Override - public void setInventorySlotContents( int i, @Nullable ItemStack itemstack ) + public void setInventorySlotContents( final int i, @Nullable final ItemStack itemstack ) { this.getInternalInventory().setInventorySlotContents( i, itemstack ); } @@ -124,7 +124,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor } @Override - public boolean isUseableByPlayer( EntityPlayer p ) + public boolean isUseableByPlayer( final EntityPlayer p ) { final double squaredMCReach = 64.0D; @@ -132,7 +132,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor } @Override - public void openInventory( EntityPlayer player ) + public void openInventory( final EntityPlayer player ) { } @@ -140,13 +140,13 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor ; @Override - public void closeInventory( EntityPlayer player ) + public void closeInventory( final EntityPlayer player ) { } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return true; } @@ -155,9 +155,9 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor public abstract void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ); @Override - public int[] getSlotsForFace( EnumFacing side ) + public int[] getSlotsForFace( final EnumFacing side ) { - Block blk = this.worldObj.getBlockState( pos ).getBlock(); + final Block blk = this.worldObj.getBlockState( pos ).getBlock(); if( blk instanceof AEBaseBlock ) { return this.getAccessibleSlotsBySide( ( (AEBaseBlock) blk ).mapRotation( this, side ) ); @@ -166,13 +166,13 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, EnumFacing side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side ) { return this.isItemValidForSlot( slotIndex, insertingItem ); } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { return true; } @@ -184,13 +184,13 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor } @Override - public int getField( int id ) + public int getField( final int id ) { return 0; } @Override - public void setField( int id, int value ) + public void setField( final int id, final int value ) { } diff --git a/src/main/java/appeng/tile/AEBaseTile.java b/src/main/java/appeng/tile/AEBaseTile.java index 279a6e30..017d455c 100644 --- a/src/main/java/appeng/tile/AEBaseTile.java +++ b/src/main/java/appeng/tile/AEBaseTile.java @@ -76,22 +76,22 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override public boolean shouldRefresh( - World world, - BlockPos pos, - IBlockState oldState, - IBlockState newSate ) + final World world, + final BlockPos pos, + final IBlockState oldState, + final IBlockState newSate ) { return newSate.getBlock() != oldState.getBlock(); // state dosn't change tile entities in AE2. } - public static void registerTileItem( Class c, IStackSrc wat ) + public static void registerTileItem( final Class c, final IStackSrc wat ) { ITEM_STACKS.put( c, wat ); } public boolean dropItems() { - WeakReference what = DROP_NO_ITEMS.get(); + final WeakReference what = DROP_NO_ITEMS.get(); return what == null || what.get() != this; } @@ -107,9 +107,9 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } @Nullable - protected ItemStack getItemFromTile( Object obj ) + protected ItemStack getItemFromTile( final Object obj ) { - IStackSrc src = ITEM_STACKS.get( obj.getClass() ); + final IStackSrc src = ITEM_STACKS.get( obj.getClass() ); if( src == null ) { return null; @@ -130,7 +130,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override // NOTE: WAS FINAL, changed for Immibis - public final void readFromNBT( NBTTagCompound data ) + public final void readFromNBT( final NBTTagCompound data ) { super.readFromNBT( data ); @@ -151,11 +151,11 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, this.up = EnumFacing.valueOf( data.getString( "up" ) ); } } - catch( IllegalArgumentException ignored ) + catch( final IllegalArgumentException ignored ) { } - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_READ ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_READ ) ) { h.readFromNBT( this, data ); } @@ -163,7 +163,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override // NOTE: WAS FINAL, changed for Immibis - public final void writeToNBT( NBTTagCompound data ) + public final void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); @@ -178,7 +178,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, data.setString( "customName", this.customName ); } - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_WRITE ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.WORLD_NBT_WRITE ) ) { h.writeToNBT( this, data ); } @@ -186,7 +186,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, public final void update() { - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.TICK ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.TICK ) ) { h.tick( this ); } @@ -195,9 +195,9 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, @Override public Packet getDescriptionPacket() { - NBTTagCompound data = new NBTTagCompound(); + final NBTTagCompound data = new NBTTagCompound(); - ByteBuf stream = Unpooled.buffer(); + final ByteBuf stream = Unpooled.buffer(); try { @@ -207,7 +207,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, return null; } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -217,20 +217,20 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, return new S35PacketUpdateTileEntity( pos, 64, data ); } - private boolean hasHandlerFor( TileEventType type ) + private boolean hasHandlerFor( final TileEventType type ) { - List list = this.getHandlerListFor( type ); + final List list = this.getHandlerListFor( type ); return !list.isEmpty(); } @Override - public void onDataPacket( NetworkManager net, S35PacketUpdateTileEntity pkt ) + public void onDataPacket( final NetworkManager net, final S35PacketUpdateTileEntity pkt ) { // / pkt.actionType if( pkt.getTileEntityType() == 64 ) { - ByteBuf stream = Unpooled.copiedBuffer( pkt.getNbtCompound().getByteArray( "X" ) ); + final ByteBuf stream = Unpooled.copiedBuffer( pkt.getNbtCompound().getByteArray( "X" ) ); if( this.readFromStream( stream ) ) { this.markForUpdate(); @@ -247,7 +247,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } } - public final boolean readFromStream( ByteBuf data ) + public final boolean readFromStream( final ByteBuf data ) { boolean output = false; @@ -256,10 +256,10 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, if( this.canBeRotated() ) { - EnumFacing old_Forward = this.forward; - EnumFacing old_Up = this.up; + final EnumFacing old_Forward = this.forward; + final EnumFacing old_Up = this.up; - byte orientation = data.readByte(); + final byte orientation = data.readByte(); this.forward = EnumFacing.VALUES[ orientation & 0x7 ]; this.up = EnumFacing.VALUES[ orientation >> 3 ]; @@ -267,7 +267,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } this.renderFragment = 100; - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_READ ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_READ ) ) { if( h.readFromStream( this, data ) ) { @@ -281,7 +281,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } this.renderFragment = 0; } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -306,22 +306,22 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } } - public final void writeToStream( ByteBuf data ) + public final void writeToStream( final ByteBuf data ) { try { if( this.canBeRotated() ) { - byte orientation = (byte) ( ( this.up.ordinal() << 3 ) | this.forward.ordinal() ); + final byte orientation = (byte) ( ( this.up.ordinal() << 3 ) | this.forward.ordinal() ); data.writeByte( orientation ); } - for( AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_WRITE ) ) + for( final AETileEventHandler h : this.getHandlerListFor( TileEventType.NETWORK_WRITE ) ) { h.writeToStream( this, data ); } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -339,7 +339,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } @Nonnull - private List getHandlerListFor( TileEventType type ) + private List getHandlerListFor( final TileEventType type ) { final Map> eventToHandlers = this.getEventToHandlers(); final List handlers = this.getHandlers( eventToHandlers, type ); @@ -359,9 +359,9 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, HANDLERS.put( clazz, newStoredHandlers ); - for( Method method : clazz.getMethods() ) + for( final Method method : clazz.getMethods() ) { - TileEvent event = method.getAnnotation( TileEvent.class ); + final TileEvent event = method.getAnnotation( TileEvent.class ); if( event != null ) { this.addHandler( newStoredHandlers, event.value(), method ); @@ -377,7 +377,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } @Nonnull - private List getHandlers( Map> eventToHandlers, TileEventType event ) { + private List getHandlers( final Map> eventToHandlers, final TileEventType event ) { final List oldHandlers = eventToHandlers.get( event ); if( oldHandlers == null ) @@ -393,7 +393,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } } - private void addHandler( Map> handlerSet, TileEventType value, Method m ) + private void addHandler( final Map> handlerSet, final TileEventType value, final Method m ) { List list = handlerSet.get( value ); @@ -419,7 +419,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } @Override - public void setOrientation( EnumFacing inForward, EnumFacing inUp ) + public void setOrientation( final EnumFacing inForward, final EnumFacing inUp ) { this.forward = inForward; this.up = inUp; @@ -427,7 +427,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, Platform.notifyBlocksOfNeighbors( this.worldObj, pos ); } - public void onPlacement( ItemStack stack, EntityPlayer player, EnumFacing side ) + public void onPlacement( final ItemStack stack, final EntityPlayer player, final EnumFacing side ) { if( stack.hasTagCompound() ) { @@ -441,11 +441,11 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, * @param from source of settings * @param compound compound of source */ - public void uploadSettings( SettingsFrom from, NBTTagCompound compound ) + public void uploadSettings( final SettingsFrom from, final NBTTagCompound compound ) { if( compound != null && this instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) this ).getConfigManager(); + final IConfigManager cm = ( (IConfigurableObject) this ).getConfigManager(); if( cm != null ) { cm.readFromNBT( compound ); @@ -454,17 +454,17 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, if( this instanceof IPriorityHost ) { - IPriorityHost pHost = (IPriorityHost) this; + final IPriorityHost pHost = (IPriorityHost) this; pHost.setPriority( compound.getInteger( "priority" ) ); } if( this instanceof ISegmentedInventory ) { - IInventory inv = ( (ISegmentedInventory) this ).getInventoryByName( "config" ); + final IInventory inv = ( (ISegmentedInventory) this ).getInventoryByName( "config" ); if( inv instanceof AppEngInternalAEInventory ) { - AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; - AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); + final AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; + final AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() ); tmp.readFromNBT( compound, "config" ); for( int x = 0; x < tmp.getSizeInventory(); x++ ) { @@ -484,15 +484,15 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, * @param drops drops of tile entity */ @Override - public void getDrops( World w, BlockPos pos, List drops ) + public void getDrops( final World w, final BlockPos pos, final List drops ) { if( this instanceof IInventory ) { - IInventory inv = (IInventory) this; + final IInventory inv = (IInventory) this; for( int l = 0; l < inv.getSizeInventory(); l++ ) { - ItemStack is = inv.getStackInSlot( l ); + final ItemStack is = inv.getStackInSlot( l ); if( is != null ) { drops.add( is ); @@ -501,7 +501,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, } } - public void getNoDrops( World w, BlockPos pos, List drops ) + public void getNoDrops( final World w, final BlockPos pos, final List drops ) { } @@ -518,20 +518,20 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, * * @return compound of source */ - public NBTTagCompound downloadSettings( SettingsFrom from ) + public NBTTagCompound downloadSettings( final SettingsFrom from ) { - NBTTagCompound output = new NBTTagCompound(); + final NBTTagCompound output = new NBTTagCompound(); if( this.hasCustomName() ) { - NBTTagCompound dsp = new NBTTagCompound(); + final NBTTagCompound dsp = new NBTTagCompound(); dsp.setString( "Name", this.getCustomName() ); output.setTag( "display", dsp ); } if( this instanceof IConfigurableObject ) { - IConfigManager cm = ( (IConfigurableObject) this ).getConfigManager(); + final IConfigManager cm = ( (IConfigurableObject) this ).getConfigManager(); if( cm != null ) { cm.writeToNBT( output ); @@ -540,13 +540,13 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, if( this instanceof IPriorityHost ) { - IPriorityHost pHost = (IPriorityHost) this; + final IPriorityHost pHost = (IPriorityHost) this; output.setInteger( "priority", pHost.getPriority() ); } if( this instanceof ISegmentedInventory ) { - IInventory inv = ( (ISegmentedInventory) this ).getInventoryByName( "config" ); + final IInventory inv = ( (ISegmentedInventory) this ).getInventoryByName( "config" ); if( inv instanceof AppEngInternalAEInventory ) { ( (AppEngInternalAEInventory) inv ).writeToNBT( output, "config" ); @@ -589,7 +589,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, return false; } - public void setName( String name ) + public void setName( final String name ) { this.customName = name; } diff --git a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java index 1e05d682..b330d0e2 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java @@ -49,12 +49,12 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora AEColor paintedColor = AEColor.Transparent; @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileCraftingMonitorTile( ByteBuf data ) throws IOException + public boolean readFromStream_TileCraftingMonitorTile( final ByteBuf data ) throws IOException { - AEColor oldPaintedColor = this.paintedColor; + final AEColor oldPaintedColor = this.paintedColor; this.paintedColor = AEColor.values()[data.readByte()]; - boolean hasItem = data.readBoolean(); + final boolean hasItem = data.readBoolean(); if( hasItem ) { @@ -70,7 +70,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileCraftingMonitorTile( ByteBuf data ) throws IOException + public void writeToStream_TileCraftingMonitorTile( final ByteBuf data ) throws IOException { data.writeByte( this.paintedColor.ordinal() ); @@ -86,7 +86,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCraftingMonitorTile( NBTTagCompound data ) + public void readFromNBT_TileCraftingMonitorTile( final NBTTagCompound data ) { if( data.hasKey( "paintedColor" ) ) { @@ -95,7 +95,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCraftingMonitorTile( NBTTagCompound data ) + public void writeToNBT_TileCraftingMonitorTile( final NBTTagCompound data ) { data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); } @@ -112,7 +112,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora return true; } - public void setJob( IAEItemStack is ) + public void setJob( final IAEItemStack is ) { if( ( is == null ) != ( this.dspPlay == null ) ) { @@ -147,7 +147,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora } @Override - public boolean recolourBlock( EnumFacing side, AEColor newPaintedColor, EntityPlayer who ) + public boolean recolourBlock( final EnumFacing side, final AEColor newPaintedColor, final EntityPlayer who ) { if( this.paintedColor == newPaintedColor ) { diff --git a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java index 646799d6..68439441 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java @@ -30,7 +30,7 @@ public class TileCraftingStorageTile extends TileCraftingTile public static final int KILO_SCALAR = 1024; @Override - protected ItemStack getItemFromTile( Object obj ) + protected ItemStack getItemFromTile( final Object obj ) { final IBlocks blocks = AEApi.instance().definitions().blocks(); final int storage = ( (TileCraftingTile) obj ).getStorageBytes() / KILO_SCALAR; @@ -38,19 +38,19 @@ public class TileCraftingStorageTile extends TileCraftingTile switch( storage ) { case 4: - for( ItemStack stack : blocks.craftingStorage4k().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : blocks.craftingStorage4k().maybeStack( 1 ).asSet() ) { return stack; } break; case 16: - for( ItemStack stack : blocks.craftingStorage16k().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : blocks.craftingStorage16k().maybeStack( 1 ).asSet() ) { return stack; } break; case 64: - for( ItemStack stack : blocks.craftingStorage64k().maybeStack( 1 ).asSet() ) + for( final ItemStack stack : blocks.craftingStorage64k().maybeStack( 1 ).asSet() ) { return stack; } @@ -80,7 +80,7 @@ public class TileCraftingStorageTile extends TileCraftingTile return 0; } - BlockCraftingUnit unit = (BlockCraftingUnit)this.worldObj.getBlockState( pos ).getBlock(); + final BlockCraftingUnit unit = (BlockCraftingUnit)this.worldObj.getBlockState( pos ).getBlock(); switch( unit.type ) { default: diff --git a/src/main/java/appeng/tile/crafting/TileCraftingTile.java b/src/main/java/appeng/tile/crafting/TileCraftingTile.java index 4eced5a6..140f081a 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingTile.java @@ -77,11 +77,11 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @Override - protected ItemStack getItemFromTile( Object obj ) + protected ItemStack getItemFromTile( final Object obj ) { if( ( (TileCraftingTile) obj ).isAccelerator() ) { - for( ItemStack accelerator : AEApi.instance().definitions().blocks().craftingAccelerator().maybeStack( 1 ).asSet() ) + for( final ItemStack accelerator : AEApi.instance().definitions().blocks().craftingAccelerator().maybeStack( 1 ).asSet() ) { return accelerator; } @@ -98,7 +98,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @Override - public void setName( String name ) + public void setName( final String name ) { super.setName( name ); if( this.cluster != null ) @@ -114,7 +114,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP return false; } - BlockCraftingUnit unit = (BlockCraftingUnit)this.worldObj.getBlockState( pos ).getBlock(); + final BlockCraftingUnit unit = (BlockCraftingUnit)this.worldObj.getBlockState( pos ).getBlock(); return unit.type == CraftingUnitType.ACCELERATOR; } @@ -131,7 +131,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP this.calc.calculateMultiblock( this.worldObj, this.getLocation() ); } - public void updateStatus( CraftingCPUCluster c ) + public void updateStatus( final CraftingCPUCluster c ) { if( this.cluster != null && this.cluster != c ) { @@ -142,14 +142,14 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP this.updateMeta( true ); } - public void updateMeta( boolean updateFormed ) + public void updateMeta( final boolean updateFormed ) { if( this.worldObj == null || this.notLoaded() ) { return; } - boolean formed = this.isFormed(); + final boolean formed = this.isFormed(); boolean power = false; if( this.gridProxy.isReady() ) @@ -157,8 +157,8 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP power = this.gridProxy.isActive(); } - IBlockState current = this.worldObj.getBlockState( pos ); - IBlockState newState = current.withProperty( BlockCraftingUnit.POWERED, power ).withProperty( BlockCraftingUnit.FORMED, formed ); + final IBlockState current = this.worldObj.getBlockState( pos ); + final IBlockState newState = current.withProperty( BlockCraftingUnit.POWERED, power ).withProperty( BlockCraftingUnit.FORMED, formed ); if( current != newState ) { @@ -188,7 +188,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCraftingTile( NBTTagCompound data ) + public void writeToNBT_TileCraftingTile( final NBTTagCompound data ) { data.setBoolean( "core", this.isCoreBlock ); if( this.isCoreBlock && this.cluster != null ) @@ -198,7 +198,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCraftingTile( NBTTagCompound data ) + public void readFromNBT_TileCraftingTile( final NBTTagCompound data ) { this.isCoreBlock = data.getBoolean( "core" ); if( this.isCoreBlock ) @@ -215,7 +215,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @Override - public void disconnect( boolean update ) + public void disconnect( final boolean update ) { if( this.cluster != null ) { @@ -240,13 +240,13 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP } @MENetworkEventSubscribe - public void onPowerStateChange( MENetworkChannelsChanged ev ) + public void onPowerStateChange( final MENetworkChannelsChanged ev ) { this.updateMeta( false ); } @MENetworkEventSubscribe - public void onPowerStateChange( MENetworkPowerStatusChange ev ) + public void onPowerStateChange( final MENetworkPowerStatusChange ev ) { this.updateMeta( false ); } @@ -271,25 +271,25 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP if( this.cluster != null ) { this.cluster.cancel(); - IMEInventory inv = this.cluster.getInventory(); + final IMEInventory inv = this.cluster.getInventory(); - LinkedList places = new LinkedList(); + final LinkedList places = new LinkedList(); - Iterator i = this.cluster.getTiles(); + final Iterator i = this.cluster.getTiles(); while( i.hasNext() ) { - IGridHost h = i.next(); + final IGridHost h = i.next(); if( h == this ) { places.add( new WorldCoord( this ) ); } else { - TileEntity te = (TileEntity) h; + final TileEntity te = (TileEntity) h; - for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) + for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS ) { - WorldCoord wc = new WorldCoord( te ); + final WorldCoord wc = new WorldCoord( te ); wc.add( d, 1 ); if( this.worldObj.isAirBlock( wc.getPos() ) ) { @@ -312,13 +312,13 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP ais.setStackSize( ais.getItemStack().getMaxStackSize() ); while( true ) { - IAEItemStack g = inv.extractItems( ais.copy(), Actionable.MODULATE, this.cluster.getActionSource() ); + final IAEItemStack g = inv.extractItems( ais.copy(), Actionable.MODULATE, this.cluster.getActionSource() ); if( g == null ) { break; } - WorldCoord wc = places.poll(); + final WorldCoord wc = places.poll(); places.add( wc ); Platform.spawnDrops( this.worldObj, wc.getPos(), Collections.singletonList( g.getItemStack() ) ); diff --git a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java index 3d6fb8c9..b1692757 100644 --- a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java +++ b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java @@ -111,7 +111,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table, EnumFacing where ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table, final EnumFacing where ) { if( this.myPattern == null ) { @@ -142,7 +142,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade private void updateSleepiness() { - boolean wasEnabled = this.isAwake; + final boolean wasEnabled = this.isAwake; this.isAwake = this.myPlan != null && this.hasMats() || this.canPush(); if( wasEnabled != this.isAwake ) { @@ -157,7 +157,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -191,34 +191,34 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.upgrades.getInstalledUpgrades( u ); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileMolecularAssembler( ByteBuf data ) + public boolean readFromStream_TileMolecularAssembler( final ByteBuf data ) { - boolean oldPower = this.isPowered; + final boolean oldPower = this.isPowered; this.isPowered = data.readBoolean(); return this.isPowered != oldPower; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileMolecularAssembler( ByteBuf data ) + public void writeToStream_TileMolecularAssembler( final ByteBuf data ) { data.writeBoolean( this.isPowered ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileMolecularAssembler( NBTTagCompound data ) + public void writeToNBT_TileMolecularAssembler( final NBTTagCompound data ) { if( this.forcePlan && this.myPlan != null ) { - ItemStack pattern = this.myPlan.getPattern(); + final ItemStack pattern = this.myPlan.getPattern(); if( pattern != null ) { - NBTTagCompound compound = new NBTTagCompound(); + final NBTTagCompound compound = new NBTTagCompound(); pattern.writeToNBT( compound ); data.setTag( "myPlan", compound ); data.setInteger( "pushDirection", this.pushDirection.ordinal() ); @@ -231,17 +231,17 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileMolecularAssembler( NBTTagCompound data ) + public void readFromNBT_TileMolecularAssembler( final NBTTagCompound data ) { if( data.hasKey( "myPlan" ) ) { - ItemStack myPat = ItemStack.loadItemStackFromNBT( data.getCompoundTag( "myPlan" ) ); + final ItemStack myPat = ItemStack.loadItemStackFromNBT( data.getCompoundTag( "myPlan" ) ); if( myPat != null && myPat.getItem() instanceof ItemEncodedPattern ) { - World w = this.getWorld(); - ItemEncodedPattern iep = (ItemEncodedPattern) myPat.getItem(); - ICraftingPatternDetails ph = iep.getPatternForItem( myPat, w ); + final World w = this.getWorld(); + final ItemEncodedPattern iep = (ItemEncodedPattern) myPat.getItem(); + final ICraftingPatternDetails ph = iep.getPatternForItem( myPat, w ); if( ph != null && ph.isCraftable() ) { this.forcePlan = true; @@ -266,15 +266,15 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade return; } - ItemStack is = this.inv.getStackInSlot( 10 ); + final ItemStack is = this.inv.getStackInSlot( 10 ); if( is != null && is.getItem() instanceof ItemEncodedPattern ) { if( !Platform.isSameItem( is, this.myPattern ) ) { - World w = this.getWorld(); - ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); - ICraftingPatternDetails ph = iep.getPatternForItem( is, w ); + final World w = this.getWorld(); + final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem(); + final ICraftingPatternDetails ph = iep.getPatternForItem( is, w ); if( ph != null && ph.isCraftable() ) { @@ -297,7 +297,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.COVERED; } @@ -315,7 +315,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "upgrades" ) ) { @@ -331,7 +331,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } @@ -349,7 +349,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( i >= 9 ) { @@ -370,7 +370,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( inv == this.inv ) { @@ -379,13 +379,13 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { return slotIndex == 9; } @Override - public int[] getAccessibleSlotsBySide( EnumFacing whichSide ) + public int[] getAccessibleSlotsBySide( final EnumFacing whichSide ) { return SIDES; } @@ -397,15 +397,15 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade @Override public void getDrops( - World w, - BlockPos pos, - List drops ) + final World w, + final BlockPos pos, + final List drops ) { super.getDrops( w, pos, drops ); for( int h = 0; h < this.upgrades.getSizeInventory(); h++ ) { - ItemStack is = this.upgrades.getStackInSlot( h ); + final ItemStack is = this.upgrades.getStackInSlot( h ); if( is != null ) { drops.add( is ); @@ -414,7 +414,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { this.recalculatePlan(); this.updateSleepiness(); @@ -422,7 +422,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, int ticksSinceLastCall ) { if( this.inv.getStackInSlot( 9 ) != null ) { @@ -488,7 +488,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } this.progress = 0; - ItemStack output = this.myPlan.getOutput( this.craftingInv, this.getWorld() ); + final ItemStack output = this.myPlan.getOutput( this.craftingInv, this.getWorld() ); if( output != null ) { FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorld() ), output, this.craftingInv ); @@ -511,11 +511,11 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade try { - TargetPoint where = new TargetPoint( this.worldObj.provider.getDimensionId(), pos.getX(), pos.getY(), pos.getZ(), 32 ); - IAEItemStack item = AEItemStack.create( output ); + final TargetPoint where = new TargetPoint( this.worldObj.provider.getDimensionId(), pos.getX(), pos.getY(), pos.getZ(), 32 ); + final IAEItemStack item = AEItemStack.create( output ); NetworkHandler.instance.sendToAllAround( new PacketAssemblerAnimation( pos, (byte) speed, item ), where ); } - catch( IOException e ) + catch( final IOException e ) { // ;P } @@ -535,7 +535,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade { for( int x = 0; x < 9; x++ ) { - ItemStack is = this.inv.getStackInSlot( x ); + final ItemStack is = this.inv.getStackInSlot( x ); if( is != null ) { if( this.myPlan == null || !this.myPlan.isValidItemForSlot( x, is, this.worldObj ) ) @@ -550,13 +550,13 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } } - private int userPower( int ticksPassed, int bonusValue, double acceleratorTax ) + private int userPower( final int ticksPassed, final int bonusValue, final double acceleratorTax ) { try { return (int) ( this.gridProxy.getEnergy().extractAEPower( ticksPassed * bonusValue * acceleratorTax, Actionable.MODULATE, PowerMultiplier.CONFIG ) / acceleratorTax ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return 0; } @@ -566,7 +566,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade { if( this.pushDirection == AEPartLocation.INTERNAL ) { - for( EnumFacing d : EnumFacing.VALUES ) + for( final EnumFacing d : EnumFacing.VALUES ) { output = this.pushTo( output, d ); } @@ -585,30 +585,30 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade this.inv.setInventorySlotContents( 9, output ); } - private ItemStack pushTo( ItemStack output, EnumFacing d ) + private ItemStack pushTo( ItemStack output, final EnumFacing d ) { if( output == null ) { return output; } - TileEntity te = this.getWorld().getTileEntity( pos.offset( d ) ); + final TileEntity te = this.getWorld().getTileEntity( pos.offset( d ) ); if( te == null ) { return output; } - InventoryAdaptor adaptor = InventoryAdaptor.getAdaptor( te, d.getOpposite() ); + final InventoryAdaptor adaptor = InventoryAdaptor.getAdaptor( te, d.getOpposite() ); if( adaptor == null ) { return output; } - int size = output.stackSize; + final int size = output.stackSize; output = adaptor.addItems( output ); - int newSize = output == null ? 0 : output.stackSize; + final int newSize = output == null ? 0 : output.stackSize; if( size != newSize ) { @@ -619,7 +619,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade } @MENetworkEventSubscribe - public void onPowerEvent( MENetworkPowerStatusChange p ) + public void onPowerEvent( final MENetworkPowerStatusChange p ) { this.updatePowerState(); } @@ -632,7 +632,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade { newState = this.gridProxy.isActive() && this.gridProxy.getEnergy().extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.0001; } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } diff --git a/src/main/java/appeng/tile/events/AETileEventHandler.java b/src/main/java/appeng/tile/events/AETileEventHandler.java index 58cd4f17..86ae307e 100644 --- a/src/main/java/appeng/tile/events/AETileEventHandler.java +++ b/src/main/java/appeng/tile/events/AETileEventHandler.java @@ -35,90 +35,90 @@ public final class AETileEventHandler private final Method method; - public AETileEventHandler( Method method ) + public AETileEventHandler( final Method method ) { this.method = method; } // TICK - public void tick( AEBaseTile tile ) + public void tick( final AEBaseTile tile ) { try { this.method.invoke( tile ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } } // WORLD_NBT - public void writeToNBT( AEBaseTile tile, NBTTagCompound data ) + public void writeToNBT( final AEBaseTile tile, final NBTTagCompound data ) { try { this.method.invoke( tile, data ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } } // WORLD NBT - public void readFromNBT( AEBaseTile tile, NBTTagCompound data ) + public void readFromNBT( final AEBaseTile tile, final NBTTagCompound data ) { try { this.method.invoke( tile, data ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } } // NETWORK - public void writeToStream( AEBaseTile tile, ByteBuf data ) + public void writeToStream( final AEBaseTile tile, final ByteBuf data ) { try { this.method.invoke( tile, data ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } @@ -134,21 +134,21 @@ public final class AETileEventHandler * @return true of method could be invoked */ @SideOnly( Side.CLIENT ) - public boolean readFromStream( AEBaseTile tile, ByteBuf data ) + public boolean readFromStream( final AEBaseTile tile, final ByteBuf data ) { try { return (Boolean) this.method.invoke( tile, data ); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { throw new IllegalStateException( e ); } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { throw new IllegalStateException( e ); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { throw new IllegalStateException( e ); } diff --git a/src/main/java/appeng/tile/grid/AENetworkInvTile.java b/src/main/java/appeng/tile/grid/AENetworkInvTile.java index 48b2c035..7d211960 100644 --- a/src/main/java/appeng/tile/grid/AENetworkInvTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkInvTile.java @@ -36,13 +36,13 @@ public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionH protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true ); @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AENetwork( NBTTagCompound data ) + public void readFromNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.readFromNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AENetwork( NBTTagCompound data ) + public void writeToNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.writeToNBT( data ); } @@ -60,7 +60,7 @@ public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionH } @Override - public IGridNode getGridNode( AEPartLocation dir ) + public IGridNode getGridNode( final AEPartLocation dir ) { return this.gridProxy.getNode(); } @@ -101,7 +101,7 @@ public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionH @Override public int getField( - int id ) + final int id ) { return 0; } diff --git a/src/main/java/appeng/tile/grid/AENetworkPowerTile.java b/src/main/java/appeng/tile/grid/AENetworkPowerTile.java index 316a44f7..d805f190 100644 --- a/src/main/java/appeng/tile/grid/AENetworkPowerTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkPowerTile.java @@ -38,13 +38,13 @@ public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IA protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true ); @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AENetwork( NBTTagCompound data ) + public void readFromNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.readFromNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AENetwork( NBTTagCompound data ) + public void writeToNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.writeToNBT( data ); } @@ -68,13 +68,13 @@ public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IA } @Override - public IGridNode getGridNode( AEPartLocation dir ) + public IGridNode getGridNode( final AEPartLocation dir ) { return this.gridProxy.getNode(); } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.SMART; } diff --git a/src/main/java/appeng/tile/grid/AENetworkTile.java b/src/main/java/appeng/tile/grid/AENetworkTile.java index 1e6a09dd..0e2cd911 100644 --- a/src/main/java/appeng/tile/grid/AENetworkTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkTile.java @@ -38,13 +38,13 @@ public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxy protected final AENetworkProxy gridProxy = this.createProxy(); @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AENetwork( NBTTagCompound data ) + public void readFromNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.readFromNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AENetwork( NBTTagCompound data ) + public void writeToNBT_AENetwork( final NBTTagCompound data ) { this.gridProxy.writeToNBT( data ); } @@ -55,13 +55,13 @@ public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxy } @Override - public IGridNode getGridNode( AEPartLocation dir ) + public IGridNode getGridNode( final AEPartLocation dir ) { return this.gridProxy.getNode(); } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.SMART; } diff --git a/src/main/java/appeng/tile/grindstone/TileCrank.java b/src/main/java/appeng/tile/grindstone/TileCrank.java index 0ba73ea2..c0d94a4c 100644 --- a/src/main/java/appeng/tile/grindstone/TileCrank.java +++ b/src/main/java/appeng/tile/grindstone/TileCrank.java @@ -62,7 +62,7 @@ public class TileCrank extends AEBaseTile implements ICustomCollision, IUpdatePl if( this.charge >= this.ticksPerRotation ) { this.charge -= this.ticksPerRotation; - ICrankable g = this.getGrinder(); + final ICrankable g = this.getGrinder(); if( g != null ) { g.applyTurn(); @@ -80,8 +80,8 @@ public class TileCrank extends AEBaseTile implements ICustomCollision, IUpdatePl return null; } - EnumFacing grinder = this.getUp().getOpposite(); - TileEntity te = this.worldObj.getTileEntity( pos.offset( grinder ) ); + final EnumFacing grinder = this.getUp().getOpposite(); + final TileEntity te = this.worldObj.getTileEntity( pos.offset( grinder ) ); if( te instanceof ICrankable ) { return (ICrankable) te; @@ -90,23 +90,23 @@ public class TileCrank extends AEBaseTile implements ICustomCollision, IUpdatePl } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileCrank( ByteBuf data ) + public boolean readFromStream_TileCrank( final ByteBuf data ) { this.rotation = data.readInt(); return false; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileCrank( ByteBuf data ) + public void writeToStream_TileCrank( final ByteBuf data ) { data.writeInt( this.rotation ); } @Override - public void setOrientation( EnumFacing inForward, EnumFacing inUp ) + public void setOrientation( final EnumFacing inForward, final EnumFacing inUp ) { super.setOrientation( inForward, inUp ); - IBlockState state = this.worldObj.getBlockState( pos ); + final IBlockState state = this.worldObj.getBlockState( pos ); this.getBlockType().onNeighborBlockChange( this.worldObj, pos, state, state.getBlock() ); } @@ -128,7 +128,7 @@ public class TileCrank extends AEBaseTile implements ICustomCollision, IUpdatePl if( this.rotation < 3 ) { - ICrankable g = this.getGrinder(); + final ICrankable g = this.getGrinder(); if( g != null ) { if( g.canTurn() ) @@ -154,28 +154,28 @@ public class TileCrank extends AEBaseTile implements ICustomCollision, IUpdatePl @Override public Iterable getSelectedBoundingBoxesFromPool( - World w, - BlockPos pos, - Entity thePlayer, - boolean b ) + final World w, + final BlockPos pos, + final Entity thePlayer, + final boolean b ) { - double xOff = -0.15 * this.getUp().getFrontOffsetX(); - double yOff = -0.15 * this.getUp().getFrontOffsetY(); - double zOff = -0.15 * this.getUp().getFrontOffsetZ(); + final double xOff = -0.15 * this.getUp().getFrontOffsetX(); + final double yOff = -0.15 * this.getUp().getFrontOffsetY(); + final double zOff = -0.15 * this.getUp().getFrontOffsetZ(); return Collections.singletonList( AxisAlignedBB.fromBounds( xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85 ) ); } @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) { - double xOff = -0.15 * this.getUp().getFrontOffsetX(); - double yOff = -0.15 * this.getUp().getFrontOffsetY(); - double zOff = -0.15 * this.getUp().getFrontOffsetZ(); + final double xOff = -0.15 * this.getUp().getFrontOffsetX(); + final double yOff = -0.15 * this.getUp().getFrontOffsetY(); + final double zOff = -0.15 * this.getUp().getFrontOffsetZ(); out.add( AxisAlignedBB.fromBounds( xOff + 0.15, yOff + 0.15, zOff + 0.15,// ahh xOff + 0.85, yOff + 0.85, zOff + 0.85 ) ); } diff --git a/src/main/java/appeng/tile/grindstone/TileGrinder.java b/src/main/java/appeng/tile/grindstone/TileGrinder.java index b065ad5a..fc435424 100644 --- a/src/main/java/appeng/tile/grindstone/TileGrinder.java +++ b/src/main/java/appeng/tile/grindstone/TileGrinder.java @@ -46,10 +46,10 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable int points; @Override - public void setOrientation( EnumFacing inForward, EnumFacing inUp ) + public void setOrientation( final EnumFacing inForward, final EnumFacing inUp ) { super.setOrientation( inForward, inUp ); - IBlockState state = worldObj.getBlockState( pos ); + final IBlockState state = worldObj.getBlockState( pos ); this.getBlockType().onNeighborBlockChange( this.worldObj, pos, state, state.getBlock() ); } @@ -60,13 +60,13 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, EnumFacing side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side ) { if( AEApi.instance().registries().grinder().getRecipeForInput( insertingItem ) == null ) { @@ -77,13 +77,13 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { return slotIndex >= 3 && slotIndex <= 5; } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { return this.sides; } @@ -98,7 +98,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable if( null == this.getStackInSlot( 6 ) ) // Add if there isn't one... { - IInventory src = new WrapperInventoryRange( this, this.inputs, true ); + final IInventory src = new WrapperInventoryRange( this, this.inputs, true ); for( int x = 0; x < src.getSizeInventory(); x++ ) { ItemStack item = src.getStackInSlot( x ); @@ -107,13 +107,13 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable continue; } - IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( item ); + final IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( item ); if( r != null ) { if( item.stackSize >= r.getInput().stackSize ) { item.stackSize -= r.getInput().stackSize; - ItemStack ais = item.copy(); + final ItemStack ais = item.copy(); ais.stackSize = r.getInput().stackSize; if( item.stackSize <= 0 ) @@ -142,8 +142,8 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable this.points++; - ItemStack processing = this.getStackInSlot( 6 ); - IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( processing ); + final ItemStack processing = this.getStackInSlot( 6 ); + final IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( processing ); if( r != null ) { if( r.getEnergyCost() > this.points ) @@ -152,7 +152,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } this.points = 0; - InventoryAdaptor sia = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this, 3, 3, true ), EnumFacing.EAST ); + final InventoryAdaptor sia = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this, 3, 3, true ), EnumFacing.EAST ); this.addItem( sia, r.getOutput() ); @@ -172,17 +172,17 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } } - private void addItem( InventoryAdaptor sia, ItemStack output ) + private void addItem( final InventoryAdaptor sia, final ItemStack output ) { if( output == null ) { return; } - ItemStack notAdded = sia.addItems( output ); + final ItemStack notAdded = sia.addItems( output ); if( notAdded != null ) { - List out = new ArrayList(); + final List out = new ArrayList(); out.add( notAdded ); Platform.spawnDrops( this.worldObj, pos.offset( this.getForward() ), out ); @@ -190,7 +190,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable } @Override - public boolean canCrankAttach( EnumFacing directionToCrank ) + public boolean canCrankAttach( final EnumFacing directionToCrank ) { return this.getUp() == directionToCrank; } diff --git a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java index 95cce33e..04d1b694 100644 --- a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java @@ -43,7 +43,7 @@ public class AppEngInternalAEInventory implements IInventory, Iterable= split.stackSize ) @@ -177,15 +177,15 @@ public class AppEngInternalAEInventory implements IInventory, Iterable protected IAEAppEngInventory te; protected int maxStack; - public AppEngInternalInventory( IAEAppEngInventory inventory, int size ) + public AppEngInternalInventory( final IAEAppEngInventory inventory, final int size ) { this.te = inventory; this.size = size; @@ -73,17 +73,17 @@ public class AppEngInternalInventory implements IInventory, Iterable } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { return this.inv[var1]; } @Override - public ItemStack decrStackSize( int slot, int qty ) + public ItemStack decrStackSize( final int slot, final int qty ) { if( this.inv[slot] != null ) { - ItemStack split = this.getStackInSlot( slot ); + final ItemStack split = this.getStackInSlot( slot ); ItemStack ns = null; if( qty >= split.stackSize ) @@ -114,15 +114,15 @@ public class AppEngInternalInventory implements IInventory, Iterable } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return null; } @Override - public void setInventorySlotContents( int slot, ItemStack newItemStack ) + public void setInventorySlotContents( final int slot, final ItemStack newItemStack ) { - ItemStack oldStack = this.inv[slot]; + final ItemStack oldStack = this.inv[slot]; this.inv[slot] = newItemStack; if( this.te != null && this.eventsEnabled() ) @@ -184,24 +184,24 @@ public class AppEngInternalInventory implements IInventory, Iterable } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return true; } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return true; } - public void setMaxStackSize( int s ) + public void setMaxStackSize( final int s ) { this.maxStack = s; } // for guis... - public void markDirty( int slotIndex ) + public void markDirty( final int slotIndex ) { if( this.te != null && this.eventsEnabled() ) { @@ -209,20 +209,20 @@ public class AppEngInternalInventory implements IInventory, Iterable } } - public void writeToNBT( NBTTagCompound data, String name ) + public void writeToNBT( final NBTTagCompound data, final String name ) { - NBTTagCompound c = new NBTTagCompound(); + final NBTTagCompound c = new NBTTagCompound(); this.writeToNBT( c ); data.setTag( name, c ); } - public void writeToNBT( NBTTagCompound target ) + public void writeToNBT( final NBTTagCompound target ) { for( int x = 0; x < this.size; x++ ) { try { - NBTTagCompound c = new NBTTagCompound(); + final NBTTagCompound c = new NBTTagCompound(); if( this.inv[x] != null ) { @@ -231,35 +231,35 @@ public class AppEngInternalInventory implements IInventory, Iterable target.setTag( "#" + x, c ); } - catch( Exception ignored ) + catch( final Exception ignored ) { } } } - public void readFromNBT( NBTTagCompound data, String name ) + public void readFromNBT( final NBTTagCompound data, final String name ) { - NBTTagCompound c = data.getCompoundTag( name ); + final NBTTagCompound c = data.getCompoundTag( name ); if( c != null ) { this.readFromNBT( c ); } } - public void readFromNBT( NBTTagCompound target ) + public void readFromNBT( final NBTTagCompound target ) { for( int x = 0; x < this.size; x++ ) { try { - NBTTagCompound c = target.getCompoundTag( "#" + x ); + final NBTTagCompound c = target.getCompoundTag( "#" + x ); if( c != null ) { this.inv[x] = ItemStack.loadItemStackFromNBT( c ); } } - catch( Exception e ) + catch( final Exception e ) { AELog.error( e ); } @@ -280,29 +280,29 @@ public class AppEngInternalInventory implements IInventory, Iterable @Override public void openInventory( - EntityPlayer player ) + final EntityPlayer player ) { } @Override public void closeInventory( - EntityPlayer player ) + final EntityPlayer player ) { } @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 ) { } diff --git a/src/main/java/appeng/tile/inventory/AppEngNullInventory.java b/src/main/java/appeng/tile/inventory/AppEngNullInventory.java index 67c4ccf9..18bf7ead 100644 --- a/src/main/java/appeng/tile/inventory/AppEngNullInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngNullInventory.java @@ -33,7 +33,7 @@ public class AppEngNullInventory implements IInventory { } - public void writeToNBT( NBTTagCompound target ) + public void writeToNBT( final NBTTagCompound target ) { } @@ -44,25 +44,25 @@ public class AppEngNullInventory implements IInventory } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { return null; } @Override - public ItemStack decrStackSize( int slot, int qty ) + public ItemStack decrStackSize( final int slot, final int qty ) { return null; } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return null; } @Override - public void setInventorySlotContents( int slot, ItemStack newItemStack ) + public void setInventorySlotContents( final int slot, final ItemStack newItemStack ) { } @@ -92,13 +92,13 @@ public class AppEngNullInventory implements IInventory } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return false; } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return false; } @@ -111,29 +111,29 @@ public class AppEngNullInventory implements IInventory @Override public void openInventory( - EntityPlayer player ) + final EntityPlayer player ) { } @Override public void closeInventory( - EntityPlayer player ) + final EntityPlayer player ) { } @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 ) { } diff --git a/src/main/java/appeng/tile/misc/TileCellWorkbench.java b/src/main/java/appeng/tile/misc/TileCellWorkbench.java index 54cece73..05331d9b 100644 --- a/src/main/java/appeng/tile/misc/TileCellWorkbench.java +++ b/src/main/java/appeng/tile/misc/TileCellWorkbench.java @@ -64,19 +64,19 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I { if( this.cacheUpgrades == null ) { - ICellWorkbenchItem cell = this.getCell(); + final ICellWorkbenchItem cell = this.getCell(); if( cell == null ) { return null; } - ItemStack is = this.cell.getStackInSlot( 0 ); + final ItemStack is = this.cell.getStackInSlot( 0 ); if( is == null ) { return null; } - IInventory inv = cell.getUpgradesInventory( is ); + final IInventory inv = cell.getUpgradesInventory( is ); if( inv == null ) { return null; @@ -103,7 +103,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCellWorkbench( NBTTagCompound data ) + public void writeToNBT_TileCellWorkbench( final NBTTagCompound data ) { this.cell.writeToNBT( data, "cell" ); this.config.writeToNBT( data, "config" ); @@ -111,7 +111,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCellWorkbench( NBTTagCompound data ) + public void readFromNBT_TileCellWorkbench( final NBTTagCompound data ) { this.cell.readFromNBT( data, "cell" ); this.config.readFromNBT( data, "config" ); @@ -119,7 +119,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "config" ) ) { @@ -135,13 +135,13 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return 0; } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { if( inv == this.cell && !this.locked ) { @@ -150,7 +150,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I this.cacheUpgrades = null; this.cacheConfig = null; - IInventory configInventory = this.getCellConfigInventory(); + final IInventory configInventory = this.getCellConfigInventory(); if( configInventory != null ) { boolean cellHasConfig = false; @@ -194,7 +194,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } else if( inv == this.config && !this.locked ) { - IInventory c = this.getCellConfigInventory(); + final IInventory c = this.getCellConfigInventory(); if( c != null ) { for( int x = 0; x < this.config.getSizeInventory(); x++ ) @@ -211,19 +211,19 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I { if( this.cacheConfig == null ) { - ICellWorkbenchItem cell = this.getCell(); + final ICellWorkbenchItem cell = this.getCell(); if( cell == null ) { return null; } - ItemStack is = this.cell.getStackInSlot( 0 ); + final ItemStack is = this.cell.getStackInSlot( 0 ); if( is == null ) { return null; } - IInventory inv = cell.getConfigInventory( is ); + final IInventory inv = cell.getConfigInventory( is ); if( inv == null ) { return null; @@ -236,9 +236,9 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I @Override public void getDrops( - World w, - BlockPos pos, - List drops ) + final World w, + final BlockPos pos, + final List drops ) { super.getDrops( w, pos, drops ); @@ -255,7 +255,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { // nothing here.. } diff --git a/src/main/java/appeng/tile/misc/TileCharger.java b/src/main/java/appeng/tile/misc/TileCharger.java index 09cef310..c2ac5d19 100644 --- a/src/main/java/appeng/tile/misc/TileCharger.java +++ b/src/main/java/appeng/tile/misc/TileCharger.java @@ -72,21 +72,21 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.COVERED; } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileCharger( ByteBuf data ) + public boolean readFromStream_TileCharger( final ByteBuf data ) { try { - IAEItemStack item = AEItemStack.loadItemStackFromPacket( data ); - ItemStack is = item.getItemStack(); + final IAEItemStack item = AEItemStack.loadItemStackFromPacket( data ); + final ItemStack is = item.getItemStack(); this.inv.setInventorySlotContents( 0, is ); } - catch( Throwable t ) + catch( final Throwable t ) { this.inv.setInventorySlotContents( 0, null ); } @@ -94,9 +94,9 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileCharger( ByteBuf data ) throws IOException + public void writeToStream_TileCharger( final ByteBuf data ) throws IOException { - AEItemStack is = AEItemStack.create( this.getStackInSlot( 0 ) ); + final AEItemStack is = AEItemStack.create( this.getStackInSlot( 0 ) ); if( is != null ) { is.writeToPacket( data ); @@ -121,7 +121,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda } this.tickTickTimer = 0; - ItemStack myItem = this.getStackInSlot( 0 ); + final ItemStack myItem = this.getStackInSlot( 0 ); // charge from the network! if( this.internalCurrentPower < 1499 ) @@ -131,7 +131,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda this.injectExternalPower( PowerUnits.AE, this.gridProxy.getEnergy().extractAEPower( Math.min( 150.0, 1500.0 - this.internalCurrentPower ), Actionable.MODULATE, PowerMultiplier.ONE ) ); this.tickTickTimer = 20; // keep ticking... } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // continue! } @@ -146,12 +146,12 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda if( this.internalCurrentPower > 149 && Platform.isChargeable( myItem ) ) { - IAEItemPowerStorage ps = (IAEItemPowerStorage) myItem.getItem(); + final IAEItemPowerStorage ps = (IAEItemPowerStorage) myItem.getItem(); if( ps.getAEMaxPower( myItem ) > ps.getAECurrentPower( myItem ) ) { - double oldPower = this.internalCurrentPower; + final double oldPower = this.internalCurrentPower; - double adjustment = ps.injectAEPower( myItem, this.extractAEPower( 150.0, Actionable.MODULATE, PowerMultiplier.CONFIG ) ); + final double adjustment = ps.injectAEPower( myItem, this.extractAEPower( 150.0, Actionable.MODULATE, PowerMultiplier.CONFIG ) ); this.internalCurrentPower += adjustment; if( oldPower > this.internalCurrentPower ) { @@ -166,7 +166,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda { this.extractAEPower( this.internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500 - for( ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() ) + for( final ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() ) { this.setInventorySlotContents( 0, charged ); } @@ -175,7 +175,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda } @Override - public void setOrientation( EnumFacing inForward, EnumFacing inUp ) + public void setOrientation( final EnumFacing inForward, final EnumFacing inUp ) { super.setOrientation( inForward, inUp ); this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) ); @@ -199,7 +199,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda { this.injectExternalPower( PowerUnits.AE, 150 ); - ItemStack myItem = this.getStackInSlot( 0 ); + final ItemStack myItem = this.getStackInSlot( 0 ); if( this.internalCurrentPower > 1499 ) { final IMaterials materials = AEApi.instance().definitions().materials(); @@ -208,7 +208,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda { this.extractAEPower( this.internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500 - for( ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() ) + for( final ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() ) { this.setInventorySlotContents( 0, charged ); } @@ -217,7 +217,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda } @Override - public boolean canCrankAttach( EnumFacing directionToCrank ) + public boolean canCrankAttach( final EnumFacing directionToCrank ) { return this.getUp() == directionToCrank || this.getUp().getOpposite() == directionToCrank; } @@ -235,7 +235,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { final IItemDefinition cert = AEApi.instance().definitions().materials().certusQuartzCrystal(); @@ -243,17 +243,17 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { this.markForUpdate(); } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { if( Platform.isChargeable( extractedItem ) ) { - IAEItemPowerStorage ips = (IAEItemPowerStorage) extractedItem.getItem(); + final IAEItemPowerStorage ips = (IAEItemPowerStorage) extractedItem.getItem(); if( ips.getAECurrentPower( extractedItem ) >= ips.getAEMaxPower( extractedItem ) ) { return true; @@ -264,19 +264,19 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda } @Override - public int[] getAccessibleSlotsBySide( EnumFacing whichSide ) + public int[] getAccessibleSlotsBySide( final EnumFacing whichSide ) { return this.sides; } - public void activate( EntityPlayer player ) + public void activate( final EntityPlayer player ) { if( !Platform.hasPermissions( new DimensionalCoord( this ), player ) ) { return; } - ItemStack myItem = this.getStackInSlot( 0 ); + final ItemStack myItem = this.getStackInSlot( 0 ); if( myItem == null ) { ItemStack held = player.inventory.getCurrentItem(); @@ -289,7 +289,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda } else { - List drops = new ArrayList(); + final List drops = new ArrayList(); drops.add( myItem ); this.setInventorySlotContents( 0, null ); Platform.spawnDrops( this.worldObj, pos.offset( getForward() ), drops ); diff --git a/src/main/java/appeng/tile/misc/TileCondenser.java b/src/main/java/appeng/tile/misc/TileCondenser.java index 1d30b775..a11c1431 100644 --- a/src/main/java/appeng/tile/misc/TileCondenser.java +++ b/src/main/java/appeng/tile/misc/TileCondenser.java @@ -60,14 +60,14 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCondenser( NBTTagCompound data ) + public void writeToNBT_TileCondenser( final NBTTagCompound data ) { this.cm.writeToNBT( data ); data.setDouble( "storedPower", this.storedPower ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCondenser( NBTTagCompound data ) + public void readFromNBT_TileCondenser( final NBTTagCompound data ) { this.cm.readFromNBT( data ); this.storedPower = data.getDouble( "storedPower" ); @@ -75,12 +75,12 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf public double getStorage() { - ItemStack is = this.inv.getStackInSlot( 2 ); + final ItemStack is = this.inv.getStackInSlot( 2 ); if( is != null ) { if( is.getItem() instanceof IStorageComponent ) { - IStorageComponent sc = (IStorageComponent) is.getItem(); + final IStorageComponent sc = (IStorageComponent) is.getItem(); if( sc.isStorageComponent( is ) ) { return sc.getBytes( is ) * 8; @@ -90,13 +90,13 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf return 0; } - public void addPower( double rawPower ) + public void addPower( final double rawPower ) { this.storedPower += rawPower; this.storedPower = Math.max( 0.0, Math.min( this.getStorage(), this.storedPower ) ); - double requiredPower = this.getRequiredPower(); - ItemStack output = this.getOutput(); + final double requiredPower = this.getRequiredPower(); + final ItemStack output = this.getOutput(); while( requiredPower <= this.storedPower && output != null && requiredPower > 0 ) { if( this.canAddOutput( output ) ) @@ -111,9 +111,9 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } } - private boolean canAddOutput( ItemStack output ) + private boolean canAddOutput( final ItemStack output ) { - ItemStack outputStack = this.getStackInSlot( 1 ); + final ItemStack outputStack = this.getStackInSlot( 1 ); return outputStack == null || ( Platform.isSameItem( outputStack, output ) && outputStack.stackSize < outputStack.getMaxStackSize() ); } @@ -122,9 +122,9 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf * * @param output to be added output */ - private void addOutput( ItemStack output ) + private void addOutput( final ItemStack output ) { - ItemStack outputStack = this.getStackInSlot( 1 ); + final ItemStack outputStack = this.getStackInSlot( 1 ); if( outputStack == null ) { this.setInventorySlotContents( 1, output.copy() ); @@ -143,13 +143,13 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf switch( (CondenserOutput) this.cm.getSetting( Settings.CONDENSER_OUTPUT ) ) { case MATTER_BALLS: - for( ItemStack matterBallStack : materials.matterBall().maybeStack( 1 ).asSet() ) + for( final ItemStack matterBallStack : materials.matterBall().maybeStack( 1 ).asSet() ) { return matterBallStack; } case SINGULARITY: - for( ItemStack singularityStack : materials.singularity().maybeStack( 1 ).asSet() ) + for( final ItemStack singularityStack : materials.singularity().maybeStack( 1 ).asSet() ) { return singularityStack; } @@ -172,7 +172,7 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { if( i == 0 ) { @@ -188,17 +188,17 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return i == 0; } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( slot == 0 ) { - ItemStack is = inv.getStackInSlot( 0 ); + final ItemStack is = inv.getStackInSlot( 0 ); if( is != null ) { this.addPower( is.stackSize ); @@ -208,25 +208,25 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, EnumFacing side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side ) { return slotIndex == 0; } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { return slotIndex != 0; } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { return this.sides; } @Override - public int fill( EnumFacing from, FluidStack resource, boolean doFill ) + public int fill( final EnumFacing from, final FluidStack resource, final boolean doFill ) { if( doFill ) { @@ -237,37 +237,37 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf } @Override - public FluidStack drain( EnumFacing from, FluidStack resource, boolean doDrain ) + public FluidStack drain( final EnumFacing from, final FluidStack resource, final boolean doDrain ) { return null; } @Override - public FluidStack drain( EnumFacing from, int maxDrain, boolean doDrain ) + public FluidStack drain( final EnumFacing from, final int maxDrain, final boolean doDrain ) { return null; } @Override - public boolean canFill( EnumFacing from, Fluid fluid ) + public boolean canFill( final EnumFacing from, final Fluid fluid ) { return true; } @Override - public boolean canDrain( EnumFacing from, Fluid fluid ) + public boolean canDrain( final EnumFacing from, final Fluid fluid ) { return false; } @Override - public FluidTankInfo[] getTankInfo( EnumFacing from ) + public FluidTankInfo[] getTankInfo( final EnumFacing from ) { return EMPTY; } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.addPower( 0 ); } diff --git a/src/main/java/appeng/tile/misc/TileInscriber.java b/src/main/java/appeng/tile/misc/TileInscriber.java index e279cc5c..e0b73531 100644 --- a/src/main/java/appeng/tile/misc/TileInscriber.java +++ b/src/main/java/appeng/tile/misc/TileInscriber.java @@ -112,13 +112,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.COVERED; } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileInscriber( NBTTagCompound data ) + public void writeToNBT_TileInscriber( final NBTTagCompound data ) { this.inv.writeToNBT( data, "inscriberInv" ); this.upgrades.writeToNBT( data, "upgrades" ); @@ -126,7 +126,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileInscriber( NBTTagCompound data ) + public void readFromNBT_TileInscriber( final NBTTagCompound data ) { this.inv.readFromNBT( data, "inscriberInv" ); this.upgrades.readFromNBT( data, "upgrades" ); @@ -134,12 +134,12 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileInscriber( ByteBuf data ) throws IOException + public boolean readFromStream_TileInscriber( final ByteBuf data ) throws IOException { - int slot = data.readByte(); + final int slot = data.readByte(); - boolean oldSmash = this.smash; - boolean newSmash = ( slot & 64 ) == 64; + final boolean oldSmash = this.smash; + final boolean newSmash = ( slot & 64 ) == 64; if( oldSmash != newSmash && newSmash ) { @@ -163,7 +163,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileInscriber( ByteBuf data ) throws IOException + public void writeToStream_TileInscriber( final ByteBuf data ) throws IOException { int slot = this.smash ? 64 : 0; @@ -180,14 +180,14 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, { if( ( slot & ( 1 << num ) ) > 0 ) { - AEItemStack st = AEItemStack.create( this.inv.getStackInSlot( num ) ); + final AEItemStack st = AEItemStack.create( this.inv.getStackInSlot( num ) ); st.writeToPacket( data ); } } } @Override - public void setOrientation( EnumFacing inForward, EnumFacing inUp ) + public void setOrientation( final EnumFacing inForward, final EnumFacing inUp ) { super.setOrientation( inForward, inUp ); this.gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( this.getForward() ) ) ); @@ -196,15 +196,15 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, @Override public void getDrops( - World w, - BlockPos pos, - List drops ) + final World w, + final BlockPos pos, + final List drops ) { super.getDrops( w, pos, drops ); for( int h = 0; h < this.upgrades.getSizeInventory(); h++ ) { - ItemStack is = this.upgrades.getStackInSlot( h ); + final ItemStack is = this.upgrades.getStackInSlot( h ); if( is != null ) { drops.add( is ); @@ -231,7 +231,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( this.smash ) { @@ -245,7 +245,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, return true; } - for( ItemStack optionals : AEApi.instance().registries().inscriber().getOptionals() ) + for( final ItemStack optionals : AEApi.instance().registries().inscriber().getOptionals() ) { if( Platform.isSameItemPrecise( optionals, itemstack ) ) { @@ -258,7 +258,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { try { @@ -277,14 +277,14 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { if( this.smash ) { @@ -295,7 +295,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public int[] getAccessibleSlotsBySide( EnumFacing d ) + public int[] getAccessibleSlotsBySide( final EnumFacing d ) { if( d == EnumFacing.UP ) { @@ -311,7 +311,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.Inscriber.min, TickRates.Inscriber.max, !this.hasWork(), false ); } @@ -330,8 +330,8 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, @Nullable public IInscriberRecipe getTask() { - ItemStack plateA = this.getStackInSlot( 0 ); - ItemStack plateB = this.getStackInSlot( 1 ); + final ItemStack plateA = this.getStackInSlot( 0 ); + final ItemStack plateB = this.getStackInSlot( 1 ); ItemStack renamedItem = this.getStackInSlot( 2 ); if( plateA != null && plateA.stackSize > 1 ) @@ -350,8 +350,8 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } final IComparableDefinition namePress = AEApi.instance().definitions().materials().namePress(); - boolean isNameA = namePress.isSameAs( plateA ); - boolean isNameB = namePress.isSameAs( plateB ); + final boolean isNameA = namePress.isSameAs( plateA ); + final boolean isNameB = namePress.isSameAs( plateB ); if( ( isNameA || isNameB ) && ( isNameA || plateA == null ) && ( isNameB || plateB == null ) ) { @@ -361,13 +361,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, if( plateA != null ) { - NBTTagCompound tag = Platform.openNbtData( plateA ); + final NBTTagCompound tag = Platform.openNbtData( plateA ); name += tag.getString( "InscribeName" ); } if( plateB != null ) { - NBTTagCompound tag = Platform.openNbtData( plateB ); + final NBTTagCompound tag = Platform.openNbtData( plateB ); if( name.length() > 0 ) { name += " "; @@ -375,11 +375,11 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, name += tag.getString( "InscribeName" ); } - ItemStack startingItem = renamedItem.copy(); + final ItemStack startingItem = renamedItem.copy(); renamedItem = renamedItem.copy(); - NBTTagCompound tag = Platform.openNbtData( renamedItem ); + final NBTTagCompound tag = Platform.openNbtData( renamedItem ); - NBTTagCompound display = tag.getCompoundTag( "display" ); + final NBTTagCompound display = tag.getCompoundTag( "display" ); tag.setTag( "display", display ); if( name.length() > 0 ) @@ -398,18 +398,18 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } } - for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) + for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() ) { - boolean matchA = ( plateA == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateA, recipe.getTopOptional().orNull() ) ) && // and... + final boolean matchA = ( plateA == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateA, recipe.getTopOptional().orNull() ) ) && // and... ( plateB == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( plateB, recipe.getBottomOptional().orNull() ) ); - boolean matchB = ( plateB == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateB, recipe.getTopOptional().orNull() ) ) && // and... + final boolean matchB = ( plateB == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateB, recipe.getTopOptional().orNull() ) ) && // and... ( plateA == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( plateA, recipe.getBottomOptional().orNull() ) ); if( matchA || matchB ) { - for( ItemStack option : recipe.getInputs() ) + for( final ItemStack option : recipe.getInputs() ) { if( Platform.isSameItemPrecise( option, this.getStackInSlot( 2 ) ) ) { @@ -422,7 +422,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( this.smash ) { @@ -433,7 +433,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, if( out != null ) { final ItemStack outputCopy = out.getOutput().copy(); - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), EnumFacing.UP ); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), EnumFacing.UP ); if( ad.addItems( outputCopy ) == null ) { @@ -460,13 +460,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, { try { - IEnergyGrid eg = this.gridProxy.getEnergy(); + final IEnergyGrid eg = this.gridProxy.getEnergy(); IEnergySource src = this; // Base 1, increase by 1 for each card - int speedFactor = 1 + this.upgrades.getInstalledUpgrades( Upgrades.SPEED ); - int powerConsumption = 10 * speedFactor; - double powerThreshold = powerConsumption - 0.01; + final int speedFactor = 1 + this.upgrades.getInstalledUpgrades( Upgrades.SPEED ); + final int powerConsumption = 10 * speedFactor; + final double powerThreshold = powerConsumption - 0.01; double powerReq = this.extractAEPower( powerConsumption, Actionable.SIMULATE, PowerMultiplier.CONFIG ); if( powerReq <= powerThreshold ) @@ -489,7 +489,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -497,11 +497,11 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, if( this.processingTime > this.maxProcessingTime ) { this.processingTime = this.maxProcessingTime; - IInscriberRecipe out = this.getTask(); + final IInscriberRecipe out = this.getTask(); if( out != null ) { - ItemStack outputCopy = out.getOutput().copy(); - InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), EnumFacing.UP ); + final ItemStack outputCopy = out.getOutput().copy(); + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), EnumFacing.UP ); if( ad.simulateAdd( outputCopy ) == null ) { this.smash = true; @@ -522,7 +522,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "inv" ) ) { @@ -538,13 +538,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.upgrades.getInstalledUpgrades( u ); } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } } diff --git a/src/main/java/appeng/tile/misc/TileInterface.java b/src/main/java/appeng/tile/misc/TileInterface.java index fd03f2b8..7dd4c5ba 100644 --- a/src/main/java/appeng/tile/misc/TileInterface.java +++ b/src/main/java/appeng/tile/misc/TileInterface.java @@ -72,18 +72,18 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT AEPartLocation pointAt = AEPartLocation.INTERNAL; @MENetworkEventSubscribe - public void stateChange( MENetworkChannelsChanged c ) + public void stateChange( final MENetworkChannelsChanged c ) { this.duality.notifyNeighbors(); } @MENetworkEventSubscribe - public void stateChange( MENetworkPowerStatusChange c ) + public void stateChange( final MENetworkPowerStatusChange c ) { this.duality.notifyNeighbors(); } - public void setSide( AEPartLocation axis ) + public void setSide( final AEPartLocation axis ) { if( Platform.isClient() ) { @@ -137,9 +137,9 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT @Override public void getDrops( - World w, - BlockPos pos, - List drops ) + final World w, + final BlockPos pos, + final List drops ) { this.duality.addDrops( drops ); } @@ -159,16 +159,16 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileInterface( NBTTagCompound data ) + public void writeToNBT_TileInterface( final NBTTagCompound data ) { data.setInteger( "pointAt", this.pointAt.ordinal() ); this.duality.writeToNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileInterface( NBTTagCompound data ) + public void readFromNBT_TileInterface( final NBTTagCompound data ) { - int val = data.getInteger( "pointAt" ); + final int val = data.getInteger( "pointAt" ); if( val >= 0 && val < AEPartLocation.values().length ) { @@ -183,7 +183,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return this.duality.getCableConnectionType( dir ); } @@ -195,7 +195,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { return this.duality.canInsert( stack ); } @@ -213,19 +213,19 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { return this.duality.getInventoryByName( name ); } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return this.duality.getTickingRequest( node ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { return this.duality.tickingRequest( node, ticksSinceLastCall ); } @@ -237,13 +237,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { this.duality.onChangeInventory( inv, slot, mc, removed, added ); } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { return this.duality.getSlotsForFace( side ); } @@ -271,7 +271,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public IStorageMonitorable getMonitorable( EnumFacing side, BaseActionSource src ) + public IStorageMonitorable getMonitorable( final EnumFacing side, final BaseActionSource src ) { return this.duality.getMonitorable( side, src, this ); } @@ -283,7 +283,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table ) + public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table ) { return this.duality.pushPattern( patternDetails, table ); } @@ -295,13 +295,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public void provideCrafting( ICraftingProviderHelper craftingTracker ) + public void provideCrafting( final ICraftingProviderHelper craftingTracker ) { this.duality.provideCrafting( craftingTracker ); } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.duality.getInstalledUpgrades( u ); } @@ -313,13 +313,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode ) + public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack items, final Actionable mode ) { return this.duality.injectCraftedItems( link, items, mode ); } @Override - public void jobStateChange( ICraftingLink link ) + public void jobStateChange( final ICraftingLink link ) { this.duality.jobStateChange( link ); } @@ -331,7 +331,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.duality.setPriority( newValue ); } diff --git a/src/main/java/appeng/tile/misc/TileLightDetector.java b/src/main/java/appeng/tile/misc/TileLightDetector.java index ba6679aa..51dde87d 100644 --- a/src/main/java/appeng/tile/misc/TileLightDetector.java +++ b/src/main/java/appeng/tile/misc/TileLightDetector.java @@ -50,7 +50,7 @@ public class TileLightDetector extends AEBaseTile implements IUpdatePlayerListBo public void updateLight() { - int val = this.worldObj.getLight( pos ); + final int val = this.worldObj.getLight( pos ); if( this.lastLight != val ) { diff --git a/src/main/java/appeng/tile/misc/TilePaint.java b/src/main/java/appeng/tile/misc/TilePaint.java index 95f7381c..07858830 100644 --- a/src/main/java/appeng/tile/misc/TilePaint.java +++ b/src/main/java/appeng/tile/misc/TilePaint.java @@ -59,9 +59,9 @@ public class TilePaint extends AEBaseTile } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TilePaint( NBTTagCompound data ) + public void writeToNBT_TilePaint( final NBTTagCompound data ) { - ByteBuf myDat = Unpooled.buffer(); + final ByteBuf myDat = Unpooled.buffer(); this.writeBuffer( myDat ); if( myDat.hasArray() ) { @@ -69,7 +69,7 @@ public class TilePaint extends AEBaseTile } } - void writeBuffer( ByteBuf out ) + void writeBuffer( final ByteBuf out ) { if( this.dots == null ) { @@ -79,14 +79,14 @@ public class TilePaint extends AEBaseTile out.writeByte( this.dots.size() ); - for( Splotch s : this.dots ) + for( final Splotch s : this.dots ) { s.writeToStream( out ); } } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TilePaint( NBTTagCompound data ) + public void readFromNBT_TilePaint( final NBTTagCompound data ) { if( data.hasKey( "dots" ) ) { @@ -94,9 +94,9 @@ public class TilePaint extends AEBaseTile } } - void readBuffer( ByteBuf in ) + void readBuffer( final ByteBuf in ) { - byte howMany = in.readByte(); + final byte howMany = in.readByte(); if( howMany == 0 ) { @@ -112,7 +112,7 @@ public class TilePaint extends AEBaseTile } this.isLit = 0; - for( Splotch s : this.dots ) + for( final Splotch s : this.dots ) { if( s.lumen ) { @@ -137,13 +137,13 @@ public class TilePaint extends AEBaseTile } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TilePaint( ByteBuf data ) + public void writeToStream_TilePaint( final ByteBuf data ) { this.writeBuffer( data ); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TilePaint( ByteBuf data ) + public boolean readFromStream_TilePaint( final ByteBuf data ) { this.readBuffer( data ); return true; @@ -156,7 +156,7 @@ public class TilePaint extends AEBaseTile return; } - for( EnumFacing side : EnumFacing.VALUES ) + for( final EnumFacing side : EnumFacing.VALUES ) { if( !this.isSideValid( side ) ) { @@ -167,19 +167,19 @@ public class TilePaint extends AEBaseTile this.updateData(); } - public boolean isSideValid( EnumFacing side ) + public boolean isSideValid( final EnumFacing side ) { - BlockPos p = pos.offset( side ); - IBlockState blk = this.worldObj.getBlockState( p ); + final BlockPos p = pos.offset( side ); + final IBlockState blk = this.worldObj.getBlockState( p ); return blk.getBlock().isSideSolid( this.worldObj, p, side.getOpposite() ); } - private void removeSide( EnumFacing side ) + private void removeSide( final EnumFacing side ) { - Iterator i = this.dots.iterator(); + final Iterator i = this.dots.iterator(); while( i.hasNext() ) { - Splotch s = i.next(); + final Splotch s = i.next(); if( s.side == side ) { i.remove(); @@ -193,7 +193,7 @@ public class TilePaint extends AEBaseTile private void updateData() { this.isLit = 0; - for( Splotch s : this.dots ) + for( final Splotch s : this.dots ) { if( s.lumen ) { @@ -214,7 +214,7 @@ public class TilePaint extends AEBaseTile } } - public void cleanSide( EnumFacing side ) + public void cleanSide( final EnumFacing side ) { if( this.dots == null ) { @@ -231,17 +231,17 @@ public class TilePaint extends AEBaseTile return this.isLit; } - public void addBlot( ItemStack type, EnumFacing side, Vec3 hitVec ) + public void addBlot( final ItemStack type, final EnumFacing side, final Vec3 hitVec ) { - BlockPos p = pos.offset(side); + final BlockPos p = pos.offset(side); - IBlockState blk = this.worldObj.getBlockState( p ); + final IBlockState blk = this.worldObj.getBlockState( p ); if( blk.getBlock().isSideSolid( this.worldObj, p, side.getOpposite() ) ) { - ItemPaintBall ipb = (ItemPaintBall) type.getItem(); + final ItemPaintBall ipb = (ItemPaintBall) type.getItem(); - AEColor col = ipb.getColor( type ); - boolean lit = ipb.isLumen( type ); + final AEColor col = ipb.getColor( type ); + final boolean lit = ipb.isLumen( type ); if( this.dots == null ) { diff --git a/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java b/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java index 07dd16b8..4a960cb5 100644 --- a/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java @@ -50,40 +50,40 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower } @MENetworkEventSubscribe - public void onPower( MENetworkPowerStatusChange ch ) + public void onPower( final MENetworkPowerStatusChange ch ) { this.markForUpdate(); } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.COVERED; } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileQuartzGrowthAccelerator( ByteBuf data ) + public boolean readFromStream_TileQuartzGrowthAccelerator( final ByteBuf data ) { - boolean hadPower = this.hasPower; + final boolean hadPower = this.hasPower; this.hasPower = data.readBoolean(); return this.hasPower != hadPower; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileQuartzGrowthAccelerator( ByteBuf data ) + public void writeToStream_TileQuartzGrowthAccelerator( final ByteBuf data ) { try { data.writeBoolean( this.gridProxy.getEnergy().isNetworkPowered() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { data.writeBoolean( false ); } } @Override - public void setOrientation( EnumFacing inForward, EnumFacing inUp ) + public void setOrientation( final EnumFacing inForward, final EnumFacing inUp ) { super.setOrientation( inForward, inUp ); this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) ); @@ -98,7 +98,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower { return this.gridProxy.getEnergy().isNetworkPowered(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return false; } diff --git a/src/main/java/appeng/tile/misc/TileSecurity.java b/src/main/java/appeng/tile/misc/TileSecurity.java index 881af007..805265b6 100644 --- a/src/main/java/appeng/tile/misc/TileSecurity.java +++ b/src/main/java/appeng/tile/misc/TileSecurity.java @@ -109,23 +109,23 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) { } @Override public void getDrops( - World w, - BlockPos pos, - List drops ) + final World w, + final BlockPos pos, + final List drops ) { if( !this.configSlot.isEmpty() ) { drops.add( this.configSlot.getStackInSlot( 0 ) ); } - for( IAEItemStack ais : this.inventory.storedItems ) + for( final IAEItemStack ais : this.inventory.storedItems ) { drops.add( ais.getItemStack() ); } @@ -137,26 +137,26 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileSecurity( ByteBuf data ) + public boolean readFromStream_TileSecurity( final ByteBuf data ) { - boolean wasActive = this.isActive; + final boolean wasActive = this.isActive; this.isActive = data.readBoolean(); - AEColor oldPaintedColor = this.paintedColor; + final AEColor oldPaintedColor = this.paintedColor; this.paintedColor = AEColor.values()[data.readByte()]; return oldPaintedColor != this.paintedColor || wasActive != this.isActive; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileSecurity( ByteBuf data ) + public void writeToStream_TileSecurity( final ByteBuf data ) { data.writeBoolean( this.gridProxy.isActive() ); data.writeByte( this.paintedColor.ordinal() ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileSecurity( NBTTagCompound data ) + public void writeToNBT_TileSecurity( final NBTTagCompound data ) { this.cm.writeToNBT( data ); data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() ); @@ -164,12 +164,12 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp data.setLong( "securityKey", this.securityKey ); this.configSlot.writeToNBT( data, "config" ); - NBTTagCompound storedItems = new NBTTagCompound(); + final NBTTagCompound storedItems = new NBTTagCompound(); int offset = 0; - for( IAEItemStack ais : this.inventory.storedItems ) + for( final IAEItemStack ais : this.inventory.storedItems ) { - NBTTagCompound it = new NBTTagCompound(); + final NBTTagCompound it = new NBTTagCompound(); ais.getItemStack().writeToNBT( it ); storedItems.setTag( String.valueOf( offset ), it ); offset++; @@ -179,7 +179,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileSecurity( NBTTagCompound data ) + public void readFromNBT_TileSecurity( final NBTTagCompound data ) { this.cm.readFromNBT( data ); if( data.hasKey( "paintedColor" ) ) @@ -190,10 +190,10 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp this.securityKey = data.getLong( "securityKey" ); this.configSlot.readFromNBT( data, "config" ); - NBTTagCompound storedItems = data.getCompoundTag( "storedItems" ); - for( Object key : storedItems.getKeySet() ) + final NBTTagCompound storedItems = data.getCompoundTag( "storedItems" ); + for( final Object key : storedItems.getKeySet() ) { - NBTBase obj = storedItems.getTag( (String) key ); + final NBTBase obj = storedItems.getTag( (String) key ); if( obj instanceof NBTTagCompound ) { this.inventory.storedItems.add( AEItemStack.create( ItemStack.loadItemStackFromNBT( (NBTTagCompound) obj ) ) ); @@ -208,26 +208,26 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp this.saveChanges(); this.gridProxy.getGrid().postEvent( new MENetworkSecurityChange() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @MENetworkEventSubscribe - public void bootUpdate( MENetworkChannelsChanged changed ) + public void bootUpdate( final MENetworkChannelsChanged changed ) { this.markForUpdate(); } @MENetworkEventSubscribe - public void powerUpdate( MENetworkPowerStatusChange changed ) + public void powerUpdate( final MENetworkPowerStatusChange changed ) { this.markForUpdate(); } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.SMART; } @@ -300,7 +300,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } @@ -312,18 +312,18 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @Override - public void readPermissions( HashMap> playerPerms ) + public void readPermissions( final HashMap> playerPerms ) { - IPlayerRegistry pr = AEApi.instance().registries().players(); + final IPlayerRegistry pr = AEApi.instance().registries().players(); // read permissions - for( IAEItemStack ais : this.inventory.storedItems ) + for( final IAEItemStack ais : this.inventory.storedItems ) { - ItemStack is = ais.getItemStack(); - Item i = is.getItem(); + final ItemStack is = ais.getItemStack(); + final Item i = is.getItem(); if( i instanceof IBiometricCard ) { - IBiometricCard bc = (IBiometricCard) i; + final IBiometricCard bc = (IBiometricCard) i; bc.registerPermissions( new PlayerSecurityWrapper( playerPerms ), pr, is ); } } @@ -351,7 +351,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp } @Override - public boolean recolourBlock( EnumFacing side, AEColor newPaintedColor, EntityPlayer who ) + public boolean recolourBlock( final EnumFacing side, final AEColor newPaintedColor, final EntityPlayer who ) { if( this.paintedColor == newPaintedColor ) { diff --git a/src/main/java/appeng/tile/misc/TileVibrationChamber.java b/src/main/java/appeng/tile/misc/TileVibrationChamber.java index 60ba0957..e9e575c1 100644 --- a/src/main/java/appeng/tile/misc/TileVibrationChamber.java +++ b/src/main/java/appeng/tile/misc/TileVibrationChamber.java @@ -71,14 +71,14 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.COVERED; } @Reflected @TileEvent( TileEventType.NETWORK_READ ) - public boolean hasUpdate( ByteBuf data ) + public boolean hasUpdate( final ByteBuf data ) { final boolean wasOn = this.isOn; @@ -89,13 +89,13 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka @Reflected @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToNetwork( ByteBuf data ) + public void writeToNetwork( final ByteBuf data ) { data.writeBoolean( this.burnTime > 0 ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileVibrationChamber( NBTTagCompound data ) + public void writeToNBT_TileVibrationChamber( final NBTTagCompound data ) { data.setDouble( "burnTime", this.burnTime ); data.setDouble( "maxBurnTime", this.maxBurnTime ); @@ -103,7 +103,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileVibrationChamber( NBTTagCompound data ) + public void readFromNBT_TileVibrationChamber( final NBTTagCompound data ) { this.burnTime = data.getDouble( "burnTime" ); this.maxBurnTime = data.getDouble( "maxBurnTime" ); @@ -117,13 +117,13 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return TileEntityFurnace.getItemBurnTime( itemstack ) > 0; } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.burnTime <= 0 ) { @@ -133,7 +133,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka { this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // wake up! } @@ -142,23 +142,23 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { return extractedItem.getItem() == Items.bucket; } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { return ACCESSIBLE_SLOTS; } private boolean canEatFuel() { - ItemStack is = this.getStackInSlot( FUEL_SLOT_INDEX ); + final ItemStack is = this.getStackInSlot( FUEL_SLOT_INDEX ); if( is != null ) { - int newBurnTime = TileEntityFurnace.getItemBurnTime( is ); + final int newBurnTime = TileEntityFurnace.getItemBurnTime( is ); if( newBurnTime > 0 && is.stackSize > 0 ) { return true; @@ -174,7 +174,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { if( this.burnTime <= 0 ) { @@ -185,7 +185,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( this.burnTime <= 0 ) { @@ -201,7 +201,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka } this.burnSpeed = Math.max( MIN_BURN_SPEED, Math.min( this.burnSpeed, MAX_BURN_SPEED ) ); - double dilation = this.burnSpeed / DILATION_SCALING; + final double dilation = this.burnSpeed / DILATION_SCALING; double timePassed = ticksSinceLastCall * dilation; this.burnTime -= timePassed; @@ -213,9 +213,9 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka try { - IEnergyGrid grid = this.gridProxy.getEnergy(); - double newPower = timePassed * POWER_PER_TICK; - double overFlow = grid.injectPower( newPower, Actionable.SIMULATE ); + final IEnergyGrid grid = this.gridProxy.getEnergy(); + final double newPower = timePassed * POWER_PER_TICK; + final double overFlow = grid.injectPower( newPower, Actionable.SIMULATE ); // burn the over flow. grid.injectPower( Math.max( 0.0, newPower - overFlow ), Actionable.MODULATE ); @@ -232,7 +232,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka this.burnSpeed = Math.max( MIN_BURN_SPEED, Math.min( this.burnSpeed, MAX_BURN_SPEED ) ); return overFlow > 0 ? TickRateModulation.SLOWER : TickRateModulation.FASTER; } - catch( GridAccessException e ) + catch( final GridAccessException e ) { this.burnSpeed -= ticksSinceLastCall; this.burnSpeed = Math.max( MIN_BURN_SPEED, Math.min( this.burnSpeed, MAX_BURN_SPEED ) ); @@ -277,7 +277,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka { this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // gah! } diff --git a/src/main/java/appeng/tile/networking/TileCableBus.java b/src/main/java/appeng/tile/networking/TileCableBus.java index 0331f459..1fd92cb9 100644 --- a/src/main/java/appeng/tile/networking/TileCableBus.java +++ b/src/main/java/appeng/tile/networking/TileCableBus.java @@ -69,23 +69,23 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl private int oldLV = -1; // on re-calculate light when it changes @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileCableBus( NBTTagCompound data ) + public void readFromNBT_TileCableBus( final NBTTagCompound data ) { this.cb.readFromNBT( data ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileCableBus( NBTTagCompound data ) + public void writeToNBT_TileCableBus( final NBTTagCompound data ) { this.cb.writeToNBT( data ); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileCableBus( ByteBuf data ) throws IOException + public boolean readFromStream_TileCableBus( final ByteBuf data ) throws IOException { - boolean ret = this.cb.readFromStream( data ); + final boolean ret = this.cb.readFromStream( data ); - int newLV = this.cb.getLightValue(); + final int newLV = this.cb.getLightValue(); if( newLV != this.oldLV ) { this.oldLV = newLV; @@ -102,27 +102,27 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl { try { - TileCableBus tcb = (TileCableBus) BlockCableBus.tesrTile.newInstance(); + final TileCableBus tcb = (TileCableBus) BlockCableBus.tesrTile.newInstance(); tcb.copyFrom( this ); this.getWorld().setTileEntity( pos, tcb ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } } } - protected void copyFrom( TileCableBus oldTile ) + protected void copyFrom( final TileCableBus oldTile ) { - CableBusContainer tmpCB = this.cb; + final CableBusContainer tmpCB = this.cb; this.cb = oldTile.cb; this.oldLV = oldTile.oldLV; oldTile.cb = tmpCB; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileCableBus( ByteBuf data ) throws IOException + public void writeToStream_TileCableBus( final ByteBuf data ) throws IOException { this.cb.writeToStream( data ); } @@ -148,13 +148,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public IGridNode getGridNode( AEPartLocation dir ) + public IGridNode getGridNode( final AEPartLocation dir ) { return this.cb.getGridNode( dir ); } @Override - public AECableType getCableConnectionType( AEPartLocation side ) + public AECableType getCableConnectionType( final AEPartLocation side ) { return this.cb.getCableConnectionType( side ); } @@ -174,7 +174,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl return; } - int newLV = this.cb.getLightValue(); + final int newLV = this.cb.getLightValue(); if( newLV != this.oldLV ) { this.oldLV = newLV; @@ -192,13 +192,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public void getDrops( World w, BlockPos pos, List drops ) + public void getDrops( final World w, final BlockPos pos, final List drops ) { this.cb.getDrops( drops ); } @Override - public void getNoDrops( World w, BlockPos pos, List drops ) + public void getNoDrops( final World w, final BlockPos pos, final List drops ) { this.cb.getNoDrops( drops ); } @@ -233,31 +233,31 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public boolean canAddPart( ItemStack is, AEPartLocation side ) + public boolean canAddPart( final ItemStack is, final AEPartLocation side ) { return this.cb.canAddPart( is, side ); } @Override - public AEPartLocation addPart( ItemStack is, AEPartLocation side, EntityPlayer player ) + public AEPartLocation addPart( final ItemStack is, final AEPartLocation side, final EntityPlayer player ) { return this.cb.addPart( is, side, player ); } @Override - public IPart getPart( AEPartLocation side ) + public IPart getPart( final AEPartLocation side ) { return this.cb.getPart( side ); } @Override - public IPart getPart( EnumFacing side ) + public IPart getPart( final EnumFacing side ) { return this.cb.getPart( side ); } @Override - public void removePart( AEPartLocation side, boolean suppressUpdate ) + public void removePart( final AEPartLocation side, final boolean suppressUpdate ) { this.cb.removePart( side, suppressUpdate ); } @@ -281,19 +281,19 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public boolean isBlocked( EnumFacing side ) + public boolean isBlocked( final EnumFacing side ) { return !this.ImmibisMicroblocks_isSideOpen( side ); } @Override - public Iterable getSelectedBoundingBoxesFromPool( World w, BlockPos pos, Entity e, boolean visual ) + public Iterable getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity e, final boolean visual ) { return this.cb.getSelectedBoundingBoxesFromPool( false, true, e, visual ); } @Override - public SelectedPart selectPart( Vec3 pos ) + public SelectedPart selectPart( final Vec3 pos ) { return this.cb.selectPart( pos ); } @@ -311,7 +311,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl } @Override - public boolean hasRedstone( AEPartLocation side ) + public boolean hasRedstone( final AEPartLocation side ) { return this.cb.hasRedstone( side ); } @@ -333,7 +333,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.ImmibisMicroblocks ) ) { - IImmibisMicroblocks imb = (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks ); + final IImmibisMicroblocks imb = (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks ); if( imb != null && imb.leaveParts( this ) ) { return; @@ -345,13 +345,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl @Override public void addCollidingBlockToList( - World w, - BlockPos pos, - AxisAlignedBB bb, - List out, - Entity e ) + final World w, + final BlockPos pos, + final AxisAlignedBB bb, + final List out, + final Entity e ) { - for( AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, pos, e, false ) ) + for( final AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, pos, e, false ) ) { out.add( AxisAlignedBB.fromBounds( bx.minX, bx.minY, bx.minZ, bx.maxX, bx.maxY, bx.maxZ ) ); } @@ -372,7 +372,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl return this.cb.isInWorld(); } - public boolean ImmibisMicroblocks_isSideOpen( EnumFacing side ) + public boolean ImmibisMicroblocks_isSideOpen( final EnumFacing side ) { return true; } @@ -384,9 +384,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl @Override public boolean recolourBlock( - EnumFacing side, - AEColor colour, - EntityPlayer who ) + final EnumFacing side, + final AEColor colour, + final EntityPlayer who ) { return this.cb.recolourBlock( side, colour, who ); } diff --git a/src/main/java/appeng/tile/networking/TileCableBusTESR.java b/src/main/java/appeng/tile/networking/TileCableBusTESR.java index d8b61a14..f8feb69a 100644 --- a/src/main/java/appeng/tile/networking/TileCableBusTESR.java +++ b/src/main/java/appeng/tile/networking/TileCableBusTESR.java @@ -32,11 +32,11 @@ public class TileCableBusTESR extends TileCableBus { try { - TileCableBus tcb = (TileCableBus) BlockCableBus.noTesrTile.newInstance(); + final TileCableBus tcb = (TileCableBus) BlockCableBus.noTesrTile.newInstance(); tcb.copyFrom( this ); this.getWorld().setTileEntity( pos, tcb ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } diff --git a/src/main/java/appeng/tile/networking/TileController.java b/src/main/java/appeng/tile/networking/TileController.java index c7ede8d1..5a1ba10f 100644 --- a/src/main/java/appeng/tile/networking/TileController.java +++ b/src/main/java/appeng/tile/networking/TileController.java @@ -59,7 +59,7 @@ public class TileController extends AENetworkPowerTile } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.DENSE; } @@ -71,7 +71,7 @@ public class TileController extends AENetworkPowerTile super.onReady(); } - public void onNeighborChange( boolean force ) + public void onNeighborChange( final boolean force ) { final boolean xx = checkController( pos.offset( EnumFacing.EAST ) ) && checkController( pos.offset( EnumFacing.WEST ) ); final boolean yy = checkController( pos.offset( EnumFacing.UP ) ) && checkController( pos.offset( EnumFacing.DOWN ) ); @@ -122,7 +122,7 @@ public class TileController extends AENetworkPowerTile } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { metaState = ControllerBlockState.OFFLINE; } @@ -135,13 +135,13 @@ public class TileController extends AENetworkPowerTile } @Override - protected double getFunnelPowerDemand( double maxReceived ) + protected double getFunnelPowerDemand( final double maxReceived ) { try { return this.gridProxy.getEnergy().getEnergyDemand( 8000 ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // no grid? use local... return super.getFunnelPowerDemand( maxReceived ); @@ -149,18 +149,18 @@ public class TileController extends AENetworkPowerTile } @Override - protected double funnelPowerIntoStorage( double power, Actionable mode ) + protected double funnelPowerIntoStorage( final double power, final Actionable mode ) { try { - double ret = this.gridProxy.getEnergy().injectPower( power, mode ); + final double ret = this.gridProxy.getEnergy().injectPower( power, mode ); if( mode == Actionable.SIMULATE ) { return ret; } return 0; } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // no grid? use local... return super.funnelPowerIntoStorage( power, mode ); @@ -168,26 +168,26 @@ public class TileController extends AENetworkPowerTile } @Override - protected void PowerEvent( PowerEventType x ) + protected void PowerEvent( final PowerEventType x ) { try { this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, x ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // not ready! } } @MENetworkEventSubscribe - public void onControllerChange( MENetworkControllerChange status ) + public void onControllerChange( final MENetworkControllerChange status ) { this.updateMeta(); } @MENetworkEventSubscribe - public void onPowerChange( MENetworkPowerStatusChange status ) + public void onPowerChange( final MENetworkPowerStatusChange status ) { this.updateMeta(); } @@ -199,13 +199,13 @@ public class TileController extends AENetworkPowerTile } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public int[] getAccessibleSlotsBySide( EnumFacing whichSide ) + public int[] getAccessibleSlotsBySide( final EnumFacing whichSide ) { return ACCESSIBLE_SLOTS_BY_SIDE; } @@ -215,7 +215,7 @@ public class TileController extends AENetworkPowerTile * * @return true if there is a loaded controller */ - private boolean checkController( BlockPos pos ) + private boolean checkController( final BlockPos pos ) { final BlockPos ownPos = this.getPos(); if( this.worldObj.getChunkProvider().chunkExists( ownPos.getX() >> 4, ownPos.getZ() >> 4 ) ) diff --git a/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java b/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java index e29d8d3e..8a9dd02a 100644 --- a/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java @@ -37,13 +37,13 @@ public class TileCreativeEnergyCell extends AENetworkTile implements IAEPowerSto } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.COVERED; } @Override - public double injectAEPower( double amt, Actionable mode ) + public double injectAEPower( final double amt, final Actionable mode ) { return 0; } @@ -73,7 +73,7 @@ public class TileCreativeEnergyCell extends AENetworkTile implements IAEPowerSto } @Override - public double extractAEPower( double amt, Actionable mode, PowerMultiplier pm ) + public double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier pm ) { return amt; } diff --git a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java index 7f7ff36f..111e152b 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java +++ b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java @@ -46,7 +46,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } @Override - public void readFromNBT_AENetwork( NBTTagCompound data ) + public void readFromNBT_AENetwork( final NBTTagCompound data ) { /** * Does nothing here since the NBT tag in the parent is not needed anymore @@ -54,7 +54,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } @Override - public void writeToNBT_AENetwork( NBTTagCompound data ) + public void writeToNBT_AENetwork( final NBTTagCompound data ) { /** * Does nothing here since the NBT tag in the parent is not needed anymore @@ -62,39 +62,39 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.COVERED; } @Override - protected double getFunnelPowerDemand( double maxRequired ) + protected double getFunnelPowerDemand( final double maxRequired ) { try { - IEnergyGrid grid = this.gridProxy.getEnergy(); + final IEnergyGrid grid = this.gridProxy.getEnergy(); return grid.getEnergyDemand( maxRequired ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return this.internalMaxPower; } } @Override - protected double funnelPowerIntoStorage( double power, Actionable mode ) + protected double funnelPowerIntoStorage( final double power, final Actionable mode ) { try { - IEnergyGrid grid = this.gridProxy.getEnergy(); - double leftOver = grid.injectPower( power, mode ); + final IEnergyGrid grid = this.gridProxy.getEnergy(); + final double leftOver = grid.injectPower( power, mode ); if( mode == Actionable.SIMULATE ) { return leftOver; } return 0.0; } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return super.funnelPowerIntoStorage( power, mode ); } @@ -107,13 +107,13 @@ public class TileEnergyAcceptor extends AENetworkPowerTile } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { return this.sides; } diff --git a/src/main/java/appeng/tile/networking/TileEnergyCell.java b/src/main/java/appeng/tile/networking/TileEnergyCell.java index 0720aa4d..8b1c0e75 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileEnergyCell.java @@ -51,7 +51,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.COVERED; } @@ -60,7 +60,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage public void onReady() { super.onReady(); - int value = ( Integer ) this.worldObj.getBlockState( pos ).getValue( BlockEnergyCell.ENERGY_STORAGE ); + final int value = ( Integer ) this.worldObj.getBlockState( pos ).getValue( BlockEnergyCell.ENERGY_STORAGE ); currentMeta = (byte)value; this.changePowerLevel(); } @@ -91,7 +91,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileEnergyCell( NBTTagCompound data ) + public void writeToNBT_TileEnergyCell( final NBTTagCompound data ) { if( !this.worldObj.isRemote ) { @@ -100,7 +100,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileEnergyCell( NBTTagCompound data ) + public void readFromNBT_TileEnergyCell( final NBTTagCompound data ) { this.internalCurrentPower = data.getDouble( "internalCurrentPower" ); } @@ -112,7 +112,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public void uploadSettings( SettingsFrom from, NBTTagCompound compound ) + public void uploadSettings( final SettingsFrom from, final NBTTagCompound compound ) { if( from == SettingsFrom.DISMANTLE_ITEM ) { @@ -121,11 +121,11 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public NBTTagCompound downloadSettings( SettingsFrom from ) + public NBTTagCompound downloadSettings( final SettingsFrom from ) { if( from == SettingsFrom.DISMANTLE_ITEM ) { - NBTTagCompound tag = new NBTTagCompound(); + final NBTTagCompound tag = new NBTTagCompound(); tag.setDouble( "internalCurrentPower", this.internalCurrentPower ); tag.setDouble( "internalMaxPower", this.internalMaxPower ); // used for tool tip. return tag; @@ -134,11 +134,11 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public final double injectAEPower( double amt, Actionable mode ) + public final double injectAEPower( double amt, final Actionable mode ) { if( mode == Actionable.SIMULATE ) { - double fakeBattery = this.internalCurrentPower + amt; + final double fakeBattery = this.internalCurrentPower + amt; if( fakeBattery > this.internalMaxPower ) { return fakeBattery - this.internalMaxPower; @@ -191,12 +191,12 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage } @Override - public final double extractAEPower( double amt, Actionable mode, PowerMultiplier pm ) + public final double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier pm ) { return pm.divide( this.extractAEPower( pm.multiply( amt ), mode ) ); } - private double extractAEPower( double amt, Actionable mode ) + private double extractAEPower( double amt, final Actionable mode ) { if( mode == Actionable.SIMULATE ) { @@ -207,7 +207,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage return this.internalCurrentPower; } - boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; + final boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; if( wasFull && amt > 0.001 ) { @@ -215,7 +215,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage { this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) ); } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } diff --git a/src/main/java/appeng/tile/networking/TileWireless.java b/src/main/java/appeng/tile/networking/TileWireless.java index 3ecb1055..28813eb4 100644 --- a/src/main/java/appeng/tile/networking/TileWireless.java +++ b/src/main/java/appeng/tile/networking/TileWireless.java @@ -65,35 +65,35 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi } @Override - public void setOrientation( EnumFacing inForward, EnumFacing inUp ) + public void setOrientation( final EnumFacing inForward, final EnumFacing inUp ) { super.setOrientation( inForward, inUp ); this.gridProxy.setValidSides( EnumSet.of( this.getForward().getOpposite() ) ); } @MENetworkEventSubscribe - public void chanRender( MENetworkChannelsChanged c ) + public void chanRender( final MENetworkChannelsChanged c ) { this.markForUpdate(); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.markForUpdate(); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileWireless( ByteBuf data ) + public boolean readFromStream_TileWireless( final ByteBuf data ) { - int old = this.clientFlags; + final int old = this.clientFlags; this.clientFlags = data.readByte(); return old != this.clientFlags; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileWireless( ByteBuf data ) + public void writeToStream_TileWireless( final ByteBuf data ) { this.clientFlags = 0; @@ -109,7 +109,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi this.clientFlags |= CHANNEL_FLAG; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // meh } @@ -118,7 +118,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.SMART; } @@ -136,19 +136,19 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return AEApi.instance().definitions().materials().wirelessBooster().isSameAs( itemstack ); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { // :P } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { return this.sides; } @@ -167,7 +167,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi private int getBoosters() { - ItemStack boosters = this.inv.getStackInSlot( 0 ); + final ItemStack boosters = this.inv.getStackInSlot( 0 ); return boosters == null ? 0 : boosters.stackSize; } @@ -201,7 +201,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi { return this.gridProxy.getGrid(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return null; } diff --git a/src/main/java/appeng/tile/powersink/AERootPoweredTile.java b/src/main/java/appeng/tile/powersink/AERootPoweredTile.java index 87c8fecd..7aa91d25 100644 --- a/src/main/java/appeng/tile/powersink/AERootPoweredTile.java +++ b/src/main/java/appeng/tile/powersink/AERootPoweredTile.java @@ -52,46 +52,46 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe return this.internalPowerSides.clone(); } - protected void setPowerSides( EnumSet sides ) + protected void setPowerSides( final EnumSet sides ) { this.internalPowerSides = sides; // trigger re-calc! } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_AERootPoweredTile( NBTTagCompound data ) + public void writeToNBT_AERootPoweredTile( final NBTTagCompound data ) { data.setDouble( "internalCurrentPower", this.internalCurrentPower ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_AERootPoweredTile( NBTTagCompound data ) + public void readFromNBT_AERootPoweredTile( final NBTTagCompound data ) { this.internalCurrentPower = data.getDouble( "internalCurrentPower" ); } - protected final double getExternalPowerDemand( PowerUnits externalUnit, double maxPowerRequired ) + protected final double getExternalPowerDemand( final PowerUnits externalUnit, final double maxPowerRequired ) { return PowerUnits.AE.convertTo( externalUnit, Math.max( 0.0, this.getFunnelPowerDemand( externalUnit.convertTo( PowerUnits.AE, maxPowerRequired ) ) ) ); } - protected double getFunnelPowerDemand( double maxRequired ) + protected double getFunnelPowerDemand( final double maxRequired ) { return this.internalMaxPower - this.internalCurrentPower; } - public final double injectExternalPower( PowerUnits input, double amt ) + public final double injectExternalPower( final PowerUnits input, final double amt ) { return PowerUnits.AE.convertTo( input, this.funnelPowerIntoStorage( input.convertTo( PowerUnits.AE, amt ), Actionable.MODULATE ) ); } - protected double funnelPowerIntoStorage( double power, Actionable mode ) + protected double funnelPowerIntoStorage( final double power, final Actionable mode ) { return this.injectAEPower( power, mode ); } @Override - public final double injectAEPower( double amt, Actionable mode ) + public final double injectAEPower( double amt, final Actionable mode ) { if( amt < 0.000001 ) { @@ -100,7 +100,7 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe if( mode == Actionable.SIMULATE ) { - double fakeBattery = this.internalCurrentPower + amt; + final double fakeBattery = this.internalCurrentPower + amt; if( fakeBattery > this.internalMaxPower ) { @@ -128,7 +128,7 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe } } - protected void PowerEvent( PowerEventType x ) + protected void PowerEvent( final PowerEventType x ) { // nothing. } @@ -158,12 +158,12 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe } @Override - public final double extractAEPower( double amt, Actionable mode, PowerMultiplier multiplier ) + public final double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier multiplier ) { return multiplier.divide( this.extractAEPower( multiplier.multiply( amt ), mode ) ); } - protected double extractAEPower( double amt, Actionable mode ) + protected double extractAEPower( double amt, final Actionable mode ) { if( mode == Actionable.SIMULATE ) { @@ -174,7 +174,7 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe return this.internalCurrentPower; } - boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; + final boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001; if( wasFull && amt > 0.001 ) { this.PowerEvent( PowerEventType.REQUEST_POWER ); diff --git a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java index a9983148..0270b495 100644 --- a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java +++ b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java @@ -92,7 +92,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @TileEvent( TileEventType.NETWORK_WRITE ) - public void onNetworkWriteEvent( ByteBuf data ) + public void onNetworkWriteEvent( final ByteBuf data ) { int out = this.constructed; @@ -110,9 +110,9 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @TileEvent( TileEventType.NETWORK_READ ) - public boolean onNetworkReadEvent( ByteBuf data ) + public boolean onNetworkReadEvent( final ByteBuf data ) { - int oldValue = this.constructed; + final int oldValue = this.constructed; this.constructed = data.readByte(); this.bridgePowered = ( this.constructed | this.powered ) == this.powered; return this.constructed != oldValue; @@ -125,7 +125,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.cluster != null ) { @@ -134,7 +134,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { if( this.isCenter() ) { @@ -145,7 +145,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public boolean isCenter() { - for( Block link : AEApi.instance().definitions().blocks().quantumLink().maybeBlock().asSet() ) + for( final Block link : AEApi.instance().definitions().blocks().quantumLink().maybeBlock().asSet() ) { return this.getBlockType() == link; } @@ -154,7 +154,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @MENetworkEventSubscribe - public void onPowerStatusChange( MENetworkPowerStatusChange c ) + public void onPowerStatusChange( final MENetworkPowerStatusChange c ) { this.updateStatus = true; } @@ -193,7 +193,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @Override - public void disconnect( boolean affectWorld ) + public void disconnect( final boolean affectWorld ) { if( this.cluster != null ) { @@ -225,7 +225,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock return !this.isInvalid(); } - public void updateStatus( QuantumCluster c, byte flags, boolean affectWorld ) + public void updateStatus( final QuantumCluster c, final byte flags, final boolean affectWorld ) { this.cluster = c; @@ -239,8 +239,8 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock if( this.isCorner() || this.isCenter() ) { - EnumSet sides = EnumSet.noneOf( EnumFacing.class ); - for ( AEPartLocation dir : this.getConnections() ) + final EnumSet sides = EnumSet.noneOf( EnumFacing.class ); + for ( final AEPartLocation dir : this.getConnections() ) if ( dir != AEPartLocation.INTERNAL ) sides.add( dir.getFacing()); @@ -260,11 +260,11 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public EnumSet getConnections() { - EnumSet set = EnumSet.noneOf( AEPartLocation.class ); + final EnumSet set = EnumSet.noneOf( AEPartLocation.class ); - for( AEPartLocation d : AEPartLocation.values() ) + for( final AEPartLocation d : AEPartLocation.values() ) { - TileEntity te = this.worldObj.getTileEntity( d == AEPartLocation.INTERNAL ? pos : pos.offset( d.getFacing() ) ); + final TileEntity te = this.worldObj.getTileEntity( d == AEPartLocation.INTERNAL ? pos : pos.offset( d.getFacing() ) ); if( te instanceof TileQuantumBridge ) { set.add( d ); @@ -276,10 +276,10 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock public long getQEFrequency() { - ItemStack is = this.internalInventory.getStackInSlot( 0 ); + final ItemStack is = this.internalInventory.getStackInSlot( 0 ); if( is != null ) { - NBTTagCompound c = is.getTagCompound(); + final NBTTagCompound c = is.getTagCompound(); if( c != null ) { return c.getLong( "freq" ); @@ -299,7 +299,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock { return this.gridProxy.getEnergy().isNetworkPowered(); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -313,7 +313,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.DENSE; } diff --git a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java index e82e2c14..b6bc5bee 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java @@ -63,13 +63,13 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileSpatialIOPort( NBTTagCompound data ) + public void writeToNBT_TileSpatialIOPort( final NBTTagCompound data ) { data.setInteger( "lastRedstoneState", this.lastRedstoneState.ordinal() ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileSpatialIOPort( NBTTagCompound data ) + public void readFromNBT_TileSpatialIOPort( final NBTTagCompound data ) { if( data.hasKey( "lastRedstoneState" ) ) { @@ -89,7 +89,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl public void updateRedstoneState() { - YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( pos ) != 0 ? YesNo.YES : YesNo.NO; + final YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( pos ) != 0 ? YesNo.YES : YesNo.NO; if( this.lastRedstoneState != currentState ) { this.lastRedstoneState = currentState; @@ -104,7 +104,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl { if( Platform.isServer() ) { - ItemStack cell = this.getStackInSlot( 0 ); + final ItemStack cell = this.getStackInSlot( 0 ); if( this.isSpatialCell( cell ) ) { TickHandler.INSTANCE.addCallable( null, this );// this needs to be cross world synced. @@ -112,38 +112,38 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl } } - private boolean isSpatialCell( ItemStack cell ) + private boolean isSpatialCell( final ItemStack cell ) { if( cell != null && cell.getItem() instanceof ISpatialStorageCell ) { - ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem(); + final ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem(); return sc != null && sc.isSpatialStorage( cell ); } return false; } @Override - public Void call( World world ) throws Exception + public Void call( final World world ) throws Exception { - ItemStack cell = this.getStackInSlot( 0 ); + final ItemStack cell = this.getStackInSlot( 0 ); if( this.isSpatialCell( cell ) && this.getStackInSlot( 1 ) == null ) { - IGrid gi = this.gridProxy.getGrid(); - IEnergyGrid energy = this.gridProxy.getEnergy(); + final IGrid gi = this.gridProxy.getGrid(); + final IEnergyGrid energy = this.gridProxy.getEnergy(); - ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem(); + final ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem(); - SpatialPylonCache spc = gi.getCache( ISpatialCache.class ); + final SpatialPylonCache spc = gi.getCache( ISpatialCache.class ); if( spc.hasRegion() && spc.isValidRegion() ) { - double req = spc.requiredPower(); - double pr = energy.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + final double req = spc.requiredPower(); + final double pr = energy.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); if( Math.abs( pr - req ) < req * 0.001 ) { - MENetworkEvent res = gi.postEvent( new MENetworkSpatialEvent( this, req ) ); + final MENetworkEvent res = gi.postEvent( new MENetworkSpatialEvent( this, req ) ); if( !res.isCanceled() ) { - TransitionResult tr = sc.doSpatialTransition( cell, this.worldObj, spc.getMin(), spc.getMax(), true ); + final TransitionResult tr = sc.doSpatialTransition( cell, this.worldObj, spc.getMin(), spc.getMax(), true ); if( tr.success ) { energy.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG ); @@ -159,7 +159,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.SMART; } @@ -177,31 +177,31 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return ( i == 0 && this.isSpatialCell( itemstack ) ); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, EnumFacing side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side ) { return this.isItemValidForSlot( slotIndex, insertingItem ); } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { return slotIndex == 1; } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { return this.sides; } diff --git a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java index 823c12b6..69620eed 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java @@ -98,7 +98,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock } @Override - public void disconnect( boolean b ) + public void disconnect( final boolean b ) { if( this.cluster != null ) { @@ -119,7 +119,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock return true; } - public void updateStatus( SpatialPylonCluster c ) + public void updateStatus( final SpatialPylonCluster c ) { this.cluster = c; this.gridProxy.setValidSides( c == null ? EnumSet.noneOf( EnumFacing.class ) : EnumSet.allOf( EnumFacing.class ) ); @@ -128,7 +128,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock public void recalculateDisplay() { - int oldBits = this.displayBits; + final int oldBits = this.displayBits; this.displayBits = 0; @@ -175,7 +175,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock this.displayBits |= DISPLAY_ENABLED; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // nothing? } @@ -191,7 +191,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock public void markForUpdate() { super.markForUpdate(); - boolean hasLight = this.getLightValue() > 0; + final boolean hasLight = this.getLightValue() > 0; if( hasLight != this.didHaveLight ) { this.didHaveLight = hasLight; @@ -216,27 +216,27 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileSpatialPylon( ByteBuf data ) + public boolean readFromStream_TileSpatialPylon( final ByteBuf data ) { - int old = this.displayBits; + final int old = this.displayBits; this.displayBits = data.readByte(); return old != this.displayBits; } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileSpatialPylon( ByteBuf data ) + public void writeToStream_TileSpatialPylon( final ByteBuf data ) { data.writeByte( this.displayBits ); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.recalculateDisplay(); } @MENetworkEventSubscribe - public void activeRender( MENetworkChannelsChanged c ) + public void activeRender( final MENetworkChannelsChanged c ) { this.recalculateDisplay(); } diff --git a/src/main/java/appeng/tile/storage/TileChest.java b/src/main/java/appeng/tile/storage/TileChest.java index 2c0644e3..0d445f0d 100644 --- a/src/main/java/appeng/tile/storage/TileChest.java +++ b/src/main/java/appeng/tile/storage/TileChest.java @@ -126,7 +126,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - protected void PowerEvent( PowerEventType x ) + protected void PowerEvent( final PowerEventType x ) { if( x == PowerEventType.REQUEST_POWER ) { @@ -134,7 +134,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } @@ -147,7 +147,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan private void recalculateDisplay() { - int oldState = this.state; + final int oldState = this.state; for( int x = 0; x < this.getCellCount(); x++ ) { @@ -163,7 +163,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan this.state &= ~0x40; } - boolean currentActive = this.gridProxy.isActive(); + final boolean currentActive = this.gridProxy.isActive(); if( this.wasActive != currentActive ) { this.wasActive = currentActive; @@ -171,7 +171,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -189,14 +189,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return 1; } - public IMEInventoryHandler getHandler( StorageChannel channel ) throws ChestNoHandler + public IMEInventoryHandler getHandler( final StorageChannel channel ) throws ChestNoHandler { if( !this.isCached ) { this.itemCell = null; this.fluidCell = null; - ItemStack is = this.inv.getStackInSlot( 1 ); + final ItemStack is = this.inv.getStackInSlot( 1 ); if( is != null ) { this.isCached = true; @@ -205,8 +205,8 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { double power = 1.0; - IMEInventoryHandler itemCell = this.cellHandler.getCellInventory( is, this, StorageChannel.ITEMS ); - IMEInventoryHandler fluidCell = this.cellHandler.getCellInventory( is, this, StorageChannel.FLUIDS ); + final IMEInventoryHandler itemCell = this.cellHandler.getCellInventory( is, this, StorageChannel.ITEMS ); + final IMEInventoryHandler fluidCell = this.cellHandler.getCellInventory( is, this, StorageChannel.FLUIDS ); if( itemCell != null ) { @@ -245,56 +245,56 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return null; } - private MEMonitorHandler wrap( IMEInventoryHandler h ) + private MEMonitorHandler wrap( final IMEInventoryHandler h ) { if( h == null ) { return null; } - MEInventoryHandler ih = new MEInventoryHandler( h, h.getChannel() ); + final MEInventoryHandler ih = new MEInventoryHandler( h, h.getChannel() ); ih.setPriority( this.priority ); - MEMonitorHandler g = new ChestMonitorHandler( ih ); + final MEMonitorHandler g = new ChestMonitorHandler( ih ); g.addListener( new ChestNetNotifier( h.getChannel() ), g ); return g; } @Override - public int getCellStatus( int slot ) + public int getCellStatus( final int slot ) { if( Platform.isClient() ) { return ( this.state >> ( slot * 3 ) ) & 3; } - ItemStack cell = this.inv.getStackInSlot( 1 ); - ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); + final ItemStack cell = this.inv.getStackInSlot( 1 ); + final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); if( ch != null ) { try { - IMEInventoryHandler handler = this.getHandler( StorageChannel.ITEMS ); + final IMEInventoryHandler handler = this.getHandler( StorageChannel.ITEMS ); if( handler instanceof ChestMonitorHandler ) { return ch.getStatusForCell( cell, ( (ChestMonitorHandler) handler ).getInternalHandler() ); } } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } try { - IMEInventoryHandler handler = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler handler = this.getHandler( StorageChannel.FLUIDS ); if( handler instanceof ChestMonitorHandler ) { return ch.getStatusForCell( cell, ( (ChestMonitorHandler) handler ).getInternalHandler() ); } } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } } @@ -318,7 +318,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { gridPowered = this.gridProxy.getEnergy().isNetworkPowered(); } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } } @@ -327,9 +327,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public boolean isCellBlinking( int slot ) + public boolean isCellBlinking( final int slot ) { - long now = this.worldObj.getTotalWorldTime(); + final long now = this.worldObj.getTotalWorldTime(); if( now - this.lastStateChange > 8 ) { return false; @@ -339,20 +339,20 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - protected double extractAEPower( double amt, Actionable mode ) + protected double extractAEPower( final double amt, final Actionable mode ) { double stash = 0.0; try { - IEnergyGrid eg = this.gridProxy.getEnergy(); + final IEnergyGrid eg = this.gridProxy.getEnergy(); stash = eg.extractAEPower( amt, mode, PowerMultiplier.ONE ); if( stash >= amt ) { return stash; } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // no grid :( } @@ -369,22 +369,22 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return; } - double idleUsage = this.gridProxy.getIdlePowerUsage(); + final double idleUsage = this.gridProxy.getIdlePowerUsage(); try { if( !this.gridProxy.getEnergy().isNetworkPowered() ) { - double powerUsed = this.extractAEPower( idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain + final double powerUsed = this.extractAEPower( idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain if( powerUsed + 0.1 >= idleUsage != ( this.state & 0x40 ) > 0 ) { this.recalculateDisplay(); } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { - double powerUsed = this.extractAEPower( this.gridProxy.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain + final double powerUsed = this.extractAEPower( this.gridProxy.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain if( powerUsed + 0.1 >= idleUsage != ( this.state & 0x40 ) > 0 ) { this.recalculateDisplay(); @@ -398,7 +398,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileChest( ByteBuf data ) + public void writeToStream_TileChest( final ByteBuf data ) { if( this.worldObj.getTotalWorldTime() - this.lastStateChange > 8 ) { @@ -426,7 +426,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan data.writeByte( this.state ); data.writeByte( this.paintedColor.ordinal() ); - ItemStack is = this.inv.getStackInSlot( 1 ); + final ItemStack is = this.inv.getStackInSlot( 1 ); if( is == null ) { @@ -439,16 +439,16 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileChest( ByteBuf data ) + public boolean readFromStream_TileChest( final ByteBuf data ) { - int oldState = this.state; - ItemStack oldType = this.storageType; + final int oldState = this.state; + final ItemStack oldType = this.storageType; this.state = data.readByte(); - AEColor oldPaintedColor = this.paintedColor; + final AEColor oldPaintedColor = this.paintedColor; this.paintedColor = AEColor.values()[data.readByte()]; - int item = data.readInt(); + final int item = data.readInt(); if( item == 0 ) { @@ -465,7 +465,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileChest( NBTTagCompound data ) + public void readFromNBT_TileChest( final NBTTagCompound data ) { this.config.readFromNBT( data ); this.priority = data.getInteger( "priority" ); @@ -476,7 +476,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileChest( NBTTagCompound data ) + public void writeToNBT_TileChest( final NBTTagCompound data ) { this.config.writeToNBT( data ); data.setInteger( "priority", this.priority ); @@ -484,13 +484,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.recalculateDisplay(); } @MENetworkEventSubscribe - public void channelRender( MENetworkChannelsChanged c ) + public void channelRender( final MENetworkChannelsChanged c ) { this.recalculateDisplay(); } @@ -514,14 +514,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { this.inv.setInventorySlotContents( i, itemstack ); this.tryToStoreContents(); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( slot == 1 ) { @@ -533,10 +533,10 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); - IStorageGrid gs = this.gridProxy.getStorage(); + final IStorageGrid gs = this.gridProxy.getStorage(); Platform.postChanges( gs, removed, added, this.mySrc ); } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } @@ -551,7 +551,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, EnumFacing side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side ) { if( slotIndex == 1 ) { @@ -568,11 +568,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { try { - IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); - IAEItemStack returns = cell.injectItems( AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), Actionable.SIMULATE, this.mySrc ); + final IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); + final IAEItemStack returns = cell.injectItems( AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), Actionable.SIMULATE, this.mySrc ); return returns == null || returns.getStackSize() != insertingItem.stackSize; } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } } @@ -580,13 +580,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { return slotIndex == 1; } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { if( EnumFacing.SOUTH == side ) { @@ -602,7 +602,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return SIDES; } } - catch( ChestNoHandler e ) + catch( final ChestNoHandler e ) { // nope! } @@ -616,9 +616,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { if( this.getStackInSlot( 0 ) != null ) { - IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); + final IMEInventory cell = this.getHandler( StorageChannel.ITEMS ); - IAEItemStack returns = Platform.poweredInsert( this, cell, AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), this.mySrc ); + final IAEItemStack returns = Platform.poweredInsert( this, cell, AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), this.mySrc ); if( returns == null ) { @@ -630,13 +630,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } } } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { if( this.gridProxy.isActive() ) { @@ -644,7 +644,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { return Collections.singletonList( this.getHandler( channel ) ); } - catch( ChestNoHandler e ) + catch( final ChestNoHandler e ) { // :P } @@ -659,7 +659,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; @@ -671,16 +671,16 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @Override - public void blinkCell( int slot ) + public void blinkCell( final int slot ) { - long now = this.worldObj.getTotalWorldTime(); + final long now = this.worldObj.getTotalWorldTime(); if( now - this.lastStateChange > 8 ) { this.state = 0; @@ -693,18 +693,18 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public int fill( EnumFacing from, FluidStack resource, boolean doFill ) + public int fill( final EnumFacing from, final FluidStack resource, final boolean doFill ) { - double req = resource.amount / 500.0; - double available = this.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + final double req = resource.amount / 500.0; + final double available = this.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG ); if( available >= req - 0.01 ) { try { - IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); this.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG ); - IAEStack results = h.injectItems( AEFluidStack.create( resource ), doFill ? Actionable.MODULATE : Actionable.SIMULATE, this.mySrc ); + final IAEStack results = h.injectItems( AEFluidStack.create( resource ), doFill ? Actionable.MODULATE : Actionable.SIMULATE, this.mySrc ); if( results == null ) { @@ -713,7 +713,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return resource.amount - (int) results.getStackSize(); } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } } @@ -721,49 +721,49 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public FluidStack drain( EnumFacing from, FluidStack resource, boolean doDrain ) + public FluidStack drain( final EnumFacing from, final FluidStack resource, final boolean doDrain ) { return null; } @Override - public FluidStack drain( EnumFacing from, int maxDrain, boolean doDrain ) + public FluidStack drain( final EnumFacing from, final int maxDrain, final boolean doDrain ) { return null; } @Override - public boolean canFill( EnumFacing from, Fluid fluid ) + public boolean canFill( final EnumFacing from, final Fluid fluid ) { try { - IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); return h.canAccept( AEFluidStack.create( new FluidStack( fluid, 1 ) ) ); } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } return false; } @Override - public boolean canDrain( EnumFacing from, Fluid fluid ) + public boolean canDrain( final EnumFacing from, final Fluid fluid ) { return false; } @Override - public FluidTankInfo[] getTankInfo( EnumFacing from ) + public FluidTankInfo[] getTankInfo( final EnumFacing from ) { try { - IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS ); if( h.getChannel() == StorageChannel.FLUIDS ) { return new FluidTankInfo[] { new FluidTankInfo( null, 1 ) }; // eh? } } - catch( ChestNoHandler ignored ) + catch( final ChestNoHandler ignored ) { } @@ -771,7 +771,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public IStorageMonitorable getMonitorable( EnumFacing side, BaseActionSource src ) + public IStorageMonitorable getMonitorable( final EnumFacing side, final BaseActionSource src ) { if( Platform.canAccess( this.gridProxy, src ) && side != this.getForward() ) { @@ -796,37 +796,37 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { } - public boolean openGui( EntityPlayer p, ICellHandler ch, ItemStack cell, EnumFacing side ) + public boolean openGui( final EntityPlayer p, final ICellHandler ch, final ItemStack cell, final EnumFacing side ) { try { - IMEInventoryHandler invHandler = this.getHandler( StorageChannel.ITEMS ); + final IMEInventoryHandler invHandler = this.getHandler( StorageChannel.ITEMS ); if( ch != null && invHandler != null ) { ch.openChestGui( p, this, ch, invHandler, cell, StorageChannel.ITEMS ); return true; } } - catch( ChestNoHandler e ) + catch( final ChestNoHandler e ) { // :P } try { - IMEInventoryHandler invHandler = this.getHandler( StorageChannel.FLUIDS ); + final IMEInventoryHandler invHandler = this.getHandler( StorageChannel.FLUIDS ); if( ch != null && invHandler != null ) { ch.openChestGui( p, this, ch, invHandler, cell, StorageChannel.FLUIDS ); return true; } } - catch( ChestNoHandler e ) + catch( final ChestNoHandler e ) { // :P } @@ -842,9 +842,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan @Override public boolean recolourBlock( - EnumFacing side, - AEColor newPaintedColor, - EntityPlayer who ) + final EnumFacing side, + final AEColor newPaintedColor, + final EntityPlayer who ) { if( this.paintedColor == newPaintedColor ) { @@ -858,7 +858,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void saveChanges( IMEInventory cellInventory ) + public void saveChanges( final IMEInventory cellInventory ) { this.worldObj.markChunkDirty( pos, this ); } @@ -874,13 +874,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan final StorageChannel chan; - public ChestNetNotifier( StorageChannel chan ) + public ChestNetNotifier( final StorageChannel chan ) { this.chan = chan; } @Override - public boolean isValid( Object verificationToken ) + public boolean isValid( final Object verificationToken ) { if( this.chan == StorageChannel.ITEMS ) { @@ -894,7 +894,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource source ) + public void postChange( final IBaseMonitor monitor, final Iterable change, final BaseActionSource source ) { if( source == TileChest.this.mySrc || ( source instanceof PlayerSource && ( (PlayerSource) source ).via == TileChest.this ) ) { @@ -905,7 +905,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan TileChest.this.gridProxy.getStorage().postAlterationOfStoredItems( this.chan, change, TileChest.this.mySrc ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :( } @@ -925,14 +925,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan class ChestMonitorHandler extends MEMonitorHandler { - public ChestMonitorHandler( IMEInventoryHandler t ) + public ChestMonitorHandler( final IMEInventoryHandler t ) { super( t ); } public IMEInventoryHandler getInternalHandler() { - IMEInventoryHandler h = this.getHandler(); + final IMEInventoryHandler h = this.getHandler(); if( h instanceof MEInventoryHandler ) { return (IMEInventoryHandler) ( (MEInventoryHandler) h ).getInternal(); @@ -941,7 +941,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public T injectItems( T input, Actionable mode, BaseActionSource src ) + public T injectItems( final T input, final Actionable mode, final BaseActionSource src ) { if( src.isPlayer() && !this.securityCheck( ( (PlayerSource) src ).player, SecurityPermissions.INJECT ) ) { @@ -950,28 +950,28 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan return super.injectItems( input, mode, src ); } - private boolean securityCheck( EntityPlayer player, SecurityPermissions requiredPermission ) + private boolean securityCheck( final EntityPlayer player, final SecurityPermissions requiredPermission ) { if( TileChest.this.getTile() instanceof IActionHost && requiredPermission != null ) { - IGridNode gn = ( (IActionHost) TileChest.this.getTile() ).getActionableNode(); + final IGridNode gn = ( (IActionHost) TileChest.this.getTile() ).getActionableNode(); if( gn != null ) { - IGrid g = gn.getGrid(); + final IGrid g = gn.getGrid(); if( g != null ) { - boolean requirePower = false; + final boolean requirePower = false; if( requirePower ) { - IEnergyGrid eg = g.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = g.getCache( IEnergyGrid.class ); if( !eg.isNetworkPowered() ) { return false; } } - ISecurityGrid sg = g.getCache( ISecurityGrid.class ); + final ISecurityGrid sg = g.getCache( ISecurityGrid.class ); if( sg.hasPermission( player, requiredPermission ) ) { return true; @@ -985,7 +985,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan } @Override - public T extractItems( T request, Actionable mode, BaseActionSource src ) + public T extractItems( final T request, final Actionable mode, final BaseActionSource src ) { if( src.isPlayer() && !this.securityCheck( ( (PlayerSource) src ).player, SecurityPermissions.EXTRACT ) ) { diff --git a/src/main/java/appeng/tile/storage/TileDrive.java b/src/main/java/appeng/tile/storage/TileDrive.java index 2d713ec4..556597b7 100644 --- a/src/main/java/appeng/tile/storage/TileDrive.java +++ b/src/main/java/appeng/tile/storage/TileDrive.java @@ -82,7 +82,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileDrive( ByteBuf data ) + public void writeToStream_TileDrive( final ByteBuf data ) { if( this.worldObj.getTotalWorldTime() - this.lastStateChange > 8 ) { @@ -117,17 +117,17 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public int getCellStatus( int slot ) + public int getCellStatus( final int slot ) { if( Platform.isClient() ) { return ( this.state >> ( slot * 3 ) ) & 3; } - ItemStack cell = this.inv.getStackInSlot( 2 ); - ICellHandler ch = this.handlersBySlot[slot]; + final ItemStack cell = this.inv.getStackInSlot( 2 ); + final ICellHandler ch = this.handlersBySlot[slot]; - MEInventoryHandler handler = this.invBySlot[slot]; + final MEInventoryHandler handler = this.invBySlot[slot]; if( handler == null ) { return 0; @@ -164,9 +164,9 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public boolean isCellBlinking( int slot ) + public boolean isCellBlinking( final int slot ) { - long now = this.worldObj.getTotalWorldTime(); + final long now = this.worldObj.getTotalWorldTime(); if( now - this.lastStateChange > 8 ) { return false; @@ -176,29 +176,29 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileDrive( ByteBuf data ) + public boolean readFromStream_TileDrive( final ByteBuf data ) { - int oldState = this.state; + final int oldState = this.state; this.state = data.readInt(); this.lastStateChange = this.worldObj.getTotalWorldTime(); return ( this.state & 0xDB6DB6DB ) != ( oldState & 0xDB6DB6DB ); } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileDrive( NBTTagCompound data ) + public void readFromNBT_TileDrive( final NBTTagCompound data ) { this.isCached = false; this.priority = data.getInteger( "priority" ); } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileDrive( NBTTagCompound data ) + public void writeToNBT_TileDrive( final NBTTagCompound data ) { data.setInteger( "priority", this.priority ); } @MENetworkEventSubscribe - public void powerRender( MENetworkPowerStatusChange c ) + public void powerRender( final MENetworkPowerStatusChange c ) { this.recalculateDisplay(); } @@ -206,7 +206,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior private void recalculateDisplay() { - boolean currentActive = this.gridProxy.isActive(); + final boolean currentActive = this.gridProxy.isActive(); if( currentActive ) { this.state |= 0x80000000; @@ -223,7 +223,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -234,7 +234,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior this.state |= ( this.getCellStatus( x ) << ( 3 * x ) ); } - int oldState = 0; + final int oldState = 0; if( oldState != this.state ) { this.markForUpdate(); @@ -242,13 +242,13 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @MENetworkEventSubscribe - public void channelRender( MENetworkChannelsChanged c ) + public void channelRender( final MENetworkChannelsChanged c ) { this.recalculateDisplay(); } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.SMART; } @@ -266,13 +266,13 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return itemstack != null && AEApi.instance().registries().cell().isCellHandled( itemstack ); } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.isCached ) { @@ -284,10 +284,10 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); - IStorageGrid gs = this.gridProxy.getStorage(); + final IStorageGrid gs = this.gridProxy.getStorage(); Platform.postChanges( gs, removed, added, this.mySrc ); } - catch( GridAccessException ignored ) + catch( final GridAccessException ignored ) { } @@ -295,7 +295,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { return this.sides; } @@ -311,7 +311,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior for( int x = 0; x < this.inv.getSizeInventory(); x++ ) { - ItemStack is = this.inv.getStackInSlot( x ); + final ItemStack is = this.inv.getStackInSlot( x ); this.invBySlot[x] = null; this.handlersBySlot[x] = null; @@ -327,7 +327,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { power += this.handlersBySlot[x].cellIdleDrain( is, cell ); - DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); + final DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); ih.setPriority( this.priority ); this.invBySlot[x] = ih; this.items.add( ih ); @@ -340,7 +340,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { power += this.handlersBySlot[x].cellIdleDrain( is, cell ); - DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); + final DriveWatcher ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this ); ih.setPriority( this.priority ); this.invBySlot[x] = ih; this.fluids.add( ih ); @@ -364,7 +364,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public List getCellArray( StorageChannel channel ) + public List getCellArray( final StorageChannel channel ) { if( this.gridProxy.isActive() ) { @@ -381,7 +381,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public void setPriority( int newValue ) + public void setPriority( final int newValue ) { this.priority = newValue; this.markDirty(); @@ -393,16 +393,16 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior { this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } } @Override - public void blinkCell( int slot ) + public void blinkCell( final int slot ) { - long now = this.worldObj.getTotalWorldTime(); + final long now = this.worldObj.getTotalWorldTime(); if( now - this.lastStateChange > 8 ) { this.state = 0; @@ -415,7 +415,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior } @Override - public void saveChanges( IMEInventory cellInventory ) + public void saveChanges( final IMEInventory cellInventory ) { this.worldObj.markChunkDirty( pos, this ); } diff --git a/src/main/java/appeng/tile/storage/TileIOPort.java b/src/main/java/appeng/tile/storage/TileIOPort.java index 6c491576..b2a510d4 100644 --- a/src/main/java/appeng/tile/storage/TileIOPort.java +++ b/src/main/java/appeng/tile/storage/TileIOPort.java @@ -121,7 +121,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @TileEvent( TileEventType.WORLD_NBT_WRITE ) - public void writeToNBT_TileIOPort( NBTTagCompound data ) + public void writeToNBT_TileIOPort( final NBTTagCompound data ) { this.manager.writeToNBT( data ); this.cells.writeToNBT( data, "cells" ); @@ -130,7 +130,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @TileEvent( TileEventType.WORLD_NBT_READ ) - public void readFromNBT_TileIOPort( NBTTagCompound data ) + public void readFromNBT_TileIOPort( final NBTTagCompound data ) { this.manager.readFromNBT( data ); this.cells.readFromNBT( data, "cells" ); @@ -142,7 +142,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public AECableType getCableConnectionType( AEPartLocation dir ) + public AECableType getCableConnectionType( final AEPartLocation dir ) { return AECableType.SMART; } @@ -166,7 +166,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { // :P } @@ -174,7 +174,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC public void updateRedstoneState() { - YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( pos ) != 0 ? YesNo.YES : YesNo.NO; + final YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( pos ) != 0 ? YesNo.YES : YesNo.NO; if( this.lastRedstoneState != currentState ) { this.lastRedstoneState = currentState; @@ -199,7 +199,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return true; } - RedstoneMode rs = (RedstoneMode) this.manager.getSetting( Settings.REDSTONE_CONTROLLED ); + final RedstoneMode rs = (RedstoneMode) this.manager.getSetting( Settings.REDSTONE_CONTROLLED ); if( rs == RedstoneMode.HIGH_SIGNAL ) { return this.getRedstoneState(); @@ -214,7 +214,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public IInventory getInventoryByName( String name ) + public IInventory getInventoryByName( final String name ) { if( name.equals( "upgrades" ) ) { @@ -230,7 +230,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) + public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue ) { this.updateTask(); } @@ -258,7 +258,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { if( this.cells == inv ) { @@ -267,9 +267,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public boolean canInsertItem( int slotIndex, ItemStack insertingItem, EnumFacing side ) + public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side ) { - for( int inputSlotIndex : this.input ) + for( final int inputSlotIndex : this.input ) { if( inputSlotIndex == slotIndex ) { @@ -281,9 +281,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side ) + public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side ) { - for( int outputSlotIndex : this.output ) + for( final int outputSlotIndex : this.output ) { if( outputSlotIndex == slotIndex ) { @@ -295,7 +295,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public int[] getAccessibleSlotsBySide( EnumFacing d ) + public int[] getAccessibleSlotsBySide( final EnumFacing d ) { if( d == EnumFacing.UP || d == EnumFacing.DOWN ) { @@ -306,13 +306,13 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public TickingRequest getTickingRequest( IGridNode node ) + public TickingRequest getTickingRequest( final IGridNode node ) { return new TickingRequest( TickRates.IOPort.min, TickRates.IOPort.max, this.hasWork(), false ); } @Override - public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall ) + public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall ) { if( !this.gridProxy.isActive() ) { @@ -336,18 +336,18 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC try { - IMEInventory itemNet = this.gridProxy.getStorage().getItemInventory(); - IMEInventory fluidNet = this.gridProxy.getStorage().getFluidInventory(); - IEnergySource energy = this.gridProxy.getEnergy(); + final IMEInventory itemNet = this.gridProxy.getStorage().getItemInventory(); + final IMEInventory fluidNet = this.gridProxy.getStorage().getFluidInventory(); + final IEnergySource energy = this.gridProxy.getEnergy(); for( int x = 0; x < 6; x++ ) { - ItemStack is = this.cells.getStackInSlot( x ); + final ItemStack is = this.cells.getStackInSlot( x ); if( is != null ) { if( ItemsToMove > 0 ) { - IMEInventory itemInv = this.getInv( is, StorageChannel.ITEMS ); - IMEInventory fluidInv = this.getInv( is, StorageChannel.FLUIDS ); + final IMEInventory itemInv = this.getInv( is, StorageChannel.ITEMS ); + final IMEInventory fluidInv = this.getInv( is, StorageChannel.FLUIDS ); if( this.manager.getSetting( Settings.OPERATION_MODE ) == OperationMode.EMPTY ) { @@ -386,7 +386,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } } } - catch( GridAccessException e ) + catch( final GridAccessException e ) { return TickRateModulation.IDLE; } @@ -396,12 +396,12 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC } @Override - public int getInstalledUpgrades( Upgrades u ) + public int getInstalledUpgrades( final Upgrades u ) { return this.upgrades.getInstalledUpgrades( u ); } - private IMEInventory getInv( ItemStack is, StorageChannel chan ) + private IMEInventory getInv( final ItemStack is, final StorageChannel chan ) { if( this.currentCell != is ) { @@ -418,9 +418,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return this.cachedFluid; } - private long transferContents( IEnergySource energy, IMEInventory src, IMEInventory destination, long itemsToMove, StorageChannel chan ) + private long transferContents( final IEnergySource energy, final IMEInventory src, final IMEInventory destination, long itemsToMove, final StorageChannel chan ) { - IItemList myList; + final IItemList myList; if( src instanceof IMEMonitor ) { myList = ( (IMEMonitor) src ).getStorageList(); @@ -436,12 +436,12 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC { didStuff = false; - for( IAEStack s : myList ) + for( final IAEStack s : myList ) { - long totalStackSize = s.getStackSize(); + final long totalStackSize = s.getStackSize(); if( totalStackSize > 0 ) { - IAEStack stack = destination.injectItems( s, Actionable.SIMULATE, this.mySrc ); + final IAEStack stack = destination.injectItems( s, Actionable.SIMULATE, this.mySrc ); long possible = 0; if( stack == null ) @@ -458,11 +458,11 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC possible = Math.min( possible, itemsToMove ); s.setStackSize( possible ); - IAEStack extracted = src.extractItems( s, Actionable.MODULATE, this.mySrc ); + final IAEStack extracted = src.extractItems( s, Actionable.MODULATE, this.mySrc ); if( extracted != null ) { possible = extracted.getStackSize(); - IAEStack failed = Platform.poweredInsert( energy, destination, extracted, this.mySrc ); + final IAEStack failed = Platform.poweredInsert( energy, destination, extracted, this.mySrc ); if( failed != null ) { @@ -487,9 +487,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return itemsToMove; } - private boolean shouldMove( IMEInventory itemInv, IMEInventory fluidInv ) + private boolean shouldMove( final IMEInventory itemInv, final IMEInventory fluidInv ) { - FullnessMode fm = (FullnessMode) this.manager.getSetting( Settings.FULLNESS_MODE ); + final FullnessMode fm = (FullnessMode) this.manager.getSetting( Settings.FULLNESS_MODE ); if( itemInv != null && fluidInv != null ) { @@ -507,10 +507,10 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return true; } - private boolean moveSlot( int x ) + private boolean moveSlot( final int x ) { - WrapperInventoryRange wir = new WrapperInventoryRange( this, this.output, true ); - ItemStack result = InventoryAdaptor.getAdaptor( wir, EnumFacing.UP ).addItems( this.getStackInSlot( x ) ); + final WrapperInventoryRange wir = new WrapperInventoryRange( this, this.output, true ); + final ItemStack result = InventoryAdaptor.getAdaptor( wir, EnumFacing.UP ).addItems( this.getStackInSlot( x ) ); if( result == null ) { @@ -521,14 +521,14 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return false; } - private boolean matches( FullnessMode fm, IMEInventory src ) + private boolean matches( final FullnessMode fm, final IMEInventory src ) { if( fm == FullnessMode.HALF ) { return true; } - IItemList myList; + final IItemList myList; if( src instanceof IMEMonitor ) { @@ -544,7 +544,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return myList.isEmpty(); } - IAEStack test = myList.getFirstItem(); + final IAEStack test = myList.getFirstItem(); if( test != null ) { test.setStackSize( 1 ); @@ -564,15 +564,15 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC */ @Override public void getDrops( - World w, - BlockPos pos, - List drops ) + final World w, + final BlockPos pos, + final List drops ) { super.getDrops( w, pos, drops ); for( int upgradeIndex = 0; upgradeIndex < this.upgrades.getSizeInventory(); upgradeIndex++ ) { - ItemStack stackInSlot = this.upgrades.getStackInSlot( upgradeIndex ); + final ItemStack stackInSlot = this.upgrades.getStackInSlot( upgradeIndex ); if( stackInSlot != null ) { diff --git a/src/main/java/appeng/tile/storage/TileSkyChest.java b/src/main/java/appeng/tile/storage/TileSkyChest.java index 11e0173f..487a91e6 100644 --- a/src/main/java/appeng/tile/storage/TileSkyChest.java +++ b/src/main/java/appeng/tile/storage/TileSkyChest.java @@ -44,15 +44,15 @@ public class TileSkyChest extends AEBaseInvTile public float lidAngle; @TileEvent( TileEventType.NETWORK_WRITE ) - public void writeToStream_TileSkyChest( ByteBuf data ) + public void writeToStream_TileSkyChest( final ByteBuf data ) { data.writeBoolean( this.playerOpen > 0 ); } @TileEvent( TileEventType.NETWORK_READ ) - public boolean readFromStream_TileSkyChest( ByteBuf data ) + public boolean readFromStream_TileSkyChest( final ByteBuf data ) { - int wasOpen = this.playerOpen; + final int wasOpen = this.playerOpen; this.playerOpen = data.readBoolean() ? 1 : 0; if( wasOpen != this.playerOpen ) @@ -76,7 +76,7 @@ public class TileSkyChest extends AEBaseInvTile } @Override - public void openInventory( EntityPlayer player ) + public void openInventory( final EntityPlayer player ) { if( Platform.isClient() ) { @@ -93,7 +93,7 @@ public class TileSkyChest extends AEBaseInvTile } @Override - public void closeInventory( EntityPlayer player ) + public void closeInventory( final EntityPlayer player ) { if( Platform.isClient() ) { @@ -115,13 +115,13 @@ public class TileSkyChest extends AEBaseInvTile } @Override - public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added ) + public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added ) { } @Override - public int[] getAccessibleSlotsBySide( EnumFacing side ) + public int[] getAccessibleSlotsBySide( final EnumFacing side ) { return this.sides; } diff --git a/src/main/java/appeng/transformer/AppEngCore.java b/src/main/java/appeng/transformer/AppEngCore.java index 287f154a..0237c58b 100644 --- a/src/main/java/appeng/transformer/AppEngCore.java +++ b/src/main/java/appeng/transformer/AppEngCore.java @@ -56,7 +56,7 @@ public final class AppEngCore extends DummyModContainer implements IFMLLoadingPl } @EventHandler - public void load( FMLInitializationEvent event ) + public void load( final FMLInitializationEvent event ) { } @@ -80,7 +80,7 @@ public final class AppEngCore extends DummyModContainer implements IFMLLoadingPl } @Override - public void injectData( Map data ) + public void injectData( final Map data ) { } @@ -116,7 +116,7 @@ public final class AppEngCore extends DummyModContainer implements IFMLLoadingPl } @Override - public boolean registerBus( EventBus bus, LoadController controller ) + public boolean registerBus( final EventBus bus, final LoadController controller ) { return true; } diff --git a/src/main/java/appeng/transformer/MissingCoreMod.java b/src/main/java/appeng/transformer/MissingCoreMod.java index 20377b70..559fd182 100644 --- a/src/main/java/appeng/transformer/MissingCoreMod.java +++ b/src/main/java/appeng/transformer/MissingCoreMod.java @@ -37,22 +37,22 @@ public final class MissingCoreMod extends CustomModLoadingErrorDisplayException private boolean deobf = false; @Override - public void initGui( GuiErrorScreen errorScreen, FontRenderer fontRenderer ) + public void initGui( final GuiErrorScreen errorScreen, final FontRenderer fontRenderer ) { - Class clz = errorScreen.getClass(); + final Class clz = errorScreen.getClass(); try { clz.getField( "mc" ); this.deobf = true; } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } } @Override - public void drawScreen( GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime ) + public void drawScreen( final GuiErrorScreen errorScreen, final FontRenderer fontRenderer, final int mouseRelX, final int mouseRelY, final float tickTime ) { int offset = 10; this.drawCenteredString( fontRenderer, "Sorry, couldn't load AE2 properly.", errorScreen.width / 2, offset, COLOR_WHITE ); @@ -89,7 +89,7 @@ public final class MissingCoreMod extends CustomModLoadingErrorDisplayException } } - private void drawCenteredString( FontRenderer fontRenderer, String string, int x, int y, int colour ) + private void drawCenteredString( final FontRenderer fontRenderer, final String string, final int x, final int y, final int colour ) { final String reEncoded = string.replaceAll( "\\P{InBasic_Latin}", "" ); final int reEncodedWidth = fontRenderer.getStringWidth( reEncoded ); diff --git a/src/main/java/appeng/transformer/asm/ASMIntegration.java b/src/main/java/appeng/transformer/asm/ASMIntegration.java index 459fdeab..b67fa92d 100644 --- a/src/main/java/appeng/transformer/asm/ASMIntegration.java +++ b/src/main/java/appeng/transformer/asm/ASMIntegration.java @@ -51,7 +51,7 @@ public final class ASMIntegration implements IClassTransformer * Side, Display Name, ModID ClassPostFix */ - for( IntegrationType type : IntegrationType.values() ) + for( final IntegrationType type : IntegrationType.values() ) { IntegrationRegistry.INSTANCE.add( type ); } @@ -69,7 +69,7 @@ public final class ASMIntegration implements IClassTransformer @Nullable @Override - public byte[] transform( String name, String transformedName, byte[] basicClass ) + public byte[] transform( final String name, final String transformedName, final byte[] basicClass ) { if( basicClass == null || transformedName.startsWith( "appeng.transformer" ) ) { @@ -78,22 +78,22 @@ public final class ASMIntegration implements IClassTransformer if( transformedName.startsWith( "appeng." ) ) { - ClassNode classNode = new ClassNode(); - ClassReader classReader = new ClassReader( basicClass ); + final ClassNode classNode = new ClassNode(); + final ClassReader classReader = new ClassReader( basicClass ); classReader.accept( classNode, 0 ); try { - boolean reWrite = this.removeOptionals( classNode ); + final boolean reWrite = this.removeOptionals( classNode ); if( reWrite ) { - ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS ); + final ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS ); classNode.accept( writer ); return writer.toByteArray(); } } - catch( Throwable t ) + catch( final Throwable t ) { t.printStackTrace(); } @@ -101,13 +101,13 @@ public final class ASMIntegration implements IClassTransformer return basicClass; } - private boolean removeOptionals( ClassNode classNode ) + private boolean removeOptionals( final ClassNode classNode ) { boolean changed = false; if( classNode.visibleAnnotations != null ) { - for( AnnotationNode an : classNode.visibleAnnotations ) + for( final AnnotationNode an : classNode.visibleAnnotations ) { if( this.hasAnnotation( an, Integration.Interface.class ) ) { @@ -118,7 +118,7 @@ public final class ASMIntegration implements IClassTransformer } else if( this.hasAnnotation( an, Integration.InterfaceList.class ) ) { - for( Object o : ( (Iterable) an.values.get( 1 ) ) ) + for( final Object o : ( (Iterable) an.values.get( 1 ) ) ) { if( this.stripInterface( classNode, Integration.InterfaceList.class, (AnnotationNode) o ) ) { @@ -129,14 +129,14 @@ public final class ASMIntegration implements IClassTransformer } } - Iterator i = classNode.methods.iterator(); + final Iterator i = classNode.methods.iterator(); while( i.hasNext() ) { - MethodNode mn = i.next(); + final MethodNode mn = i.next(); if( mn.visibleAnnotations != null ) { - for( AnnotationNode an : mn.visibleAnnotations ) + for( final AnnotationNode an : mn.visibleAnnotations ) { if( this.hasAnnotation( an, Integration.Method.class ) ) { @@ -157,12 +157,12 @@ public final class ASMIntegration implements IClassTransformer return changed; } - private boolean hasAnnotation( AnnotationNode ann, Class annotation ) + private boolean hasAnnotation( final AnnotationNode ann, final Class annotation ) { return ann.desc.equals( Type.getDescriptor( annotation ) ); } - private boolean stripInterface( ClassNode classNode, Class class1, AnnotationNode an ) + private boolean stripInterface( final ClassNode classNode, final Class class1, final AnnotationNode an ) { if( an.values.size() != 4 ) { @@ -212,7 +212,7 @@ public final class ASMIntegration implements IClassTransformer return false; } - private boolean stripMethod( ClassNode classNode, MethodNode mn, Iterator i, Class class1, AnnotationNode an ) + private boolean stripMethod( final ClassNode classNode, final MethodNode mn, final Iterator i, final Class class1, final AnnotationNode an ) { if( an.values.size() != 2 ) { @@ -228,7 +228,7 @@ public final class ASMIntegration implements IClassTransformer if( iName != null ) { - IntegrationType type = IntegrationType.valueOf( iName ); + final IntegrationType type = IntegrationType.valueOf( iName ); if( !IntegrationRegistry.INSTANCE.isEnabled( type ) ) { this.log( "Removing Method " + mn.name + " from " + classNode.name + " because " + iName + " integration is disabled." ); @@ -248,7 +248,7 @@ public final class ASMIntegration implements IClassTransformer return false; } - private void log( String string ) + private void log( final String string ) { FMLRelaunchLog.log( "AE2-CORE", Level.INFO, string ); } diff --git a/src/main/java/appeng/transformer/asm/ASMTweaker.java b/src/main/java/appeng/transformer/asm/ASMTweaker.java index 7296f412..7bf9c12d 100644 --- a/src/main/java/appeng/transformer/asm/ASMTweaker.java +++ b/src/main/java/appeng/transformer/asm/ASMTweaker.java @@ -66,7 +66,7 @@ public final class ASMTweaker implements IClassTransformer @Nullable @Override - public byte[] transform( String name, String transformedName, byte[] basicClass ) + public byte[] transform( final String name, final String transformedName, final byte[] basicClass ) { if( basicClass == null ) { @@ -77,11 +77,11 @@ public final class ASMTweaker implements IClassTransformer { if( transformedName != null && this.privateToPublicMethods.containsKey( transformedName ) ) { - ClassNode classNode = new ClassNode(); - ClassReader classReader = new ClassReader( basicClass ); + final ClassNode classNode = new ClassNode(); + final ClassReader classReader = new ClassReader( basicClass ); classReader.accept( classNode, 0 ); - for( PublicLine set : this.privateToPublicMethods.get( transformedName ) ) + for( final PublicLine set : this.privateToPublicMethods.get( transformedName ) ) { this.makePublic( classNode, set ); } @@ -89,11 +89,11 @@ public final class ASMTweaker implements IClassTransformer // CALL VIRTUAL! if( transformedName.equals( "net.minecraft.client.gui.inventory.GuiContainer" ) ) { - for( MethodNode mn : classNode.methods ) + for( final MethodNode mn : classNode.methods ) { if( mn.name.equals( "func_146977_a" ) || ( mn.name.equals( "a" ) && mn.desc.equals( "(Lzk;)V" ) ) ) { - MethodNode newNode = new MethodNode( Opcodes.ACC_PUBLIC, "func_146977_a_original", mn.desc, mn.signature, EXCEPTIONS ); + final MethodNode newNode = new MethodNode( Opcodes.ACC_PUBLIC, "func_146977_a_original", mn.desc, mn.signature, EXCEPTIONS ); newNode.instructions.add( new VarInsnNode( Opcodes.ALOAD, 0 ) ); newNode.instructions.add( new VarInsnNode( Opcodes.ALOAD, 1 ) ); newNode.instructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, classNode.name, mn.name, mn.desc, false ) ); @@ -104,17 +104,17 @@ public final class ASMTweaker implements IClassTransformer } } - for( MethodNode mn : classNode.methods ) + for( final MethodNode mn : classNode.methods ) { if( mn.name.equals( "func_73863_a" ) || mn.name.equals( "drawScreen" ) || ( mn.name.equals( "a" ) && mn.desc.equals( "(IIF)V" ) ) ) { - Iterator i = mn.instructions.iterator(); + final Iterator i = mn.instructions.iterator(); while( i.hasNext() ) { - AbstractInsnNode in = i.next(); + final AbstractInsnNode in = i.next(); if( in.getOpcode() == Opcodes.INVOKESPECIAL ) { - MethodInsnNode n = (MethodInsnNode) in; + final MethodInsnNode n = (MethodInsnNode) in; if( n.name.equals( "func_146977_a" ) || ( n.name.equals( "a" ) && n.desc.equals( "(Lzk;)V" ) ) ) { this.log( n.name + n.desc + " - Invoke Virtual" ); @@ -128,21 +128,21 @@ public final class ASMTweaker implements IClassTransformer } } - ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS ); + final ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS ); classNode.accept( writer ); return writer.toByteArray(); } } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } return basicClass; } - private void makePublic( ClassNode classNode, PublicLine set ) + private void makePublic( final ClassNode classNode, final PublicLine set ) { - for( MethodNode mn : classNode.methods ) + for( final MethodNode mn : classNode.methods ) { if( mn.name.equals( set.name ) && mn.desc.equals( set.desc ) ) { @@ -152,7 +152,7 @@ public final class ASMTweaker implements IClassTransformer } } - private void log( String string ) + private void log( final String string ) { FMLRelaunchLog.log( "AE2-CORE", Level.INFO, string ); } @@ -162,7 +162,7 @@ public final class ASMTweaker implements IClassTransformer private final String name; private final String desc; - public PublicLine( String name, String desc ) + public PublicLine( final String name, final String desc ) { this.name = name; this.desc = desc; diff --git a/src/main/java/appeng/util/BlockUpdate.java b/src/main/java/appeng/util/BlockUpdate.java index 78e136c1..d76b6c70 100644 --- a/src/main/java/appeng/util/BlockUpdate.java +++ b/src/main/java/appeng/util/BlockUpdate.java @@ -27,13 +27,13 @@ public class BlockUpdate implements IWorldCallable { final BlockPos pos; - public BlockUpdate( BlockPos pos ) + public BlockUpdate( final BlockPos pos ) { this.pos=pos; } @Override - public Boolean call( World world ) throws Exception + public Boolean call( final World world ) throws Exception { if ( world.isBlockLoaded( this.pos ) ) { diff --git a/src/main/java/appeng/util/ClassInstantiation.java b/src/main/java/appeng/util/ClassInstantiation.java index b445b3d5..3e54292c 100644 --- a/src/main/java/appeng/util/ClassInstantiation.java +++ b/src/main/java/appeng/util/ClassInstantiation.java @@ -32,7 +32,7 @@ public class ClassInstantiation private final Class template; private final Object[] args; - public ClassInstantiation( Class template, Object... args ) + public ClassInstantiation( final Class template, final Object... args ) { this.template = template; this.args = args; @@ -41,18 +41,18 @@ public class ClassInstantiation public Optional get() { @SuppressWarnings( "unchecked" ) - Constructor[] constructors = (Constructor[]) this.template.getConstructors(); + final Constructor[] constructors = (Constructor[]) this.template.getConstructors(); - for( Constructor constructor : constructors ) + for( final Constructor constructor : constructors ) { - Class[] paramTypes = constructor.getParameterTypes(); + final Class[] paramTypes = constructor.getParameterTypes(); if( paramTypes.length == this.args.length ) { boolean valid = true; for( int idx = 0; idx < paramTypes.length; idx++ ) { - Class cz = this.args[idx].getClass(); + final Class cz = this.args[idx].getClass(); if( !this.isClassMatch( paramTypes[idx], cz, this.args[idx] ) ) { valid = false; @@ -65,15 +65,15 @@ public class ClassInstantiation { return Optional.of( constructor.newInstance( this.args ) ); } - catch( InstantiationException e ) + catch( final InstantiationException e ) { e.printStackTrace(); } - catch( IllegalAccessException e ) + catch( final IllegalAccessException e ) { e.printStackTrace(); } - catch( InvocationTargetException e ) + catch( final InvocationTargetException e ) { e.printStackTrace(); } @@ -85,7 +85,7 @@ public class ClassInstantiation return Optional.absent(); } - private boolean isClassMatch( Class expected, Class got, Object value ) + private boolean isClassMatch( Class expected, Class got, final Object value ) { if( value == null && !expected.isPrimitive() ) { @@ -98,11 +98,11 @@ public class ClassInstantiation return expected == got || expected.isAssignableFrom( got ); } - private Class condense( Class expected, Class... wrappers ) + private Class condense( final Class expected, final Class... wrappers ) { if( expected.isPrimitive() ) { - for( Class clz : wrappers ) + for( final Class clz : wrappers ) { try { @@ -111,7 +111,7 @@ public class ClassInstantiation return clz; } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } diff --git a/src/main/java/appeng/util/ConfigManager.java b/src/main/java/appeng/util/ConfigManager.java index 28f5e4df..0ac0f638 100644 --- a/src/main/java/appeng/util/ConfigManager.java +++ b/src/main/java/appeng/util/ConfigManager.java @@ -36,7 +36,7 @@ public final class ConfigManager implements IConfigManager private final Map> settings = new EnumMap>( Settings.class ); private final IConfigManagerHost target; - public ConfigManager( IConfigManagerHost tile ) + public ConfigManager( final IConfigManagerHost tile ) { this.target = tile; } @@ -48,15 +48,15 @@ public final class ConfigManager implements IConfigManager } @Override - public void registerSetting( Settings settingName, Enum defaultValue ) + public void registerSetting( final Settings settingName, final Enum defaultValue ) { this.settings.put( settingName, defaultValue ); } @Override - public Enum getSetting( Settings settingName ) + public Enum getSetting( final Settings settingName ) { - Enum oldValue = this.settings.get( settingName ); + final Enum oldValue = this.settings.get( settingName ); if( oldValue != null ) { @@ -67,9 +67,9 @@ public final class ConfigManager implements IConfigManager } @Override - public Enum putSetting( Settings settingName, Enum newValue ) + public Enum putSetting( final Settings settingName, final Enum newValue ) { - Enum oldValue = this.getSetting( settingName ); + final Enum oldValue = this.getSetting( settingName ); this.settings.put( settingName, newValue ); this.target.updateSetting( this, settingName, newValue ); return oldValue; @@ -81,9 +81,9 @@ public final class ConfigManager implements IConfigManager * @param tagCompound to be written to compound */ @Override - public void writeToNBT( NBTTagCompound tagCompound ) + public void writeToNBT( final NBTTagCompound tagCompound ) { - for( Map.Entry> entry : this.settings.entrySet() ) + for( final Map.Entry> entry : this.settings.entrySet() ) { tagCompound.setString( entry.getKey().name(), this.settings.get( entry.getKey() ).toString() ); } @@ -95,9 +95,9 @@ public final class ConfigManager implements IConfigManager * @param tagCompound to be read from compound */ @Override - public void readFromNBT( NBTTagCompound tagCompound ) + public void readFromNBT( final NBTTagCompound tagCompound ) { - for( Map.Entry> entry : this.settings.entrySet() ) + for( final Map.Entry> entry : this.settings.entrySet() ) { try { @@ -115,14 +115,14 @@ public final class ConfigManager implements IConfigManager value = LevelEmitterMode.STORABLE_AMOUNT.toString(); } - Enum oldValue = this.settings.get( entry.getKey() ); + final Enum oldValue = this.settings.get( entry.getKey() ); - Enum newValue = Enum.valueOf( oldValue.getClass(), value ); + final Enum newValue = Enum.valueOf( oldValue.getClass(), value ); this.putSetting( entry.getKey(), newValue ); } } - catch( IllegalArgumentException e ) + catch( final IllegalArgumentException e ) { AELog.error( e ); } diff --git a/src/main/java/appeng/util/InWorldToolOperationResult.java b/src/main/java/appeng/util/InWorldToolOperationResult.java index 303c11b3..ff1f1b6f 100644 --- a/src/main/java/appeng/util/InWorldToolOperationResult.java +++ b/src/main/java/appeng/util/InWorldToolOperationResult.java @@ -39,28 +39,28 @@ public class InWorldToolOperationResult this.Drops = null; } - public InWorldToolOperationResult( ItemStack block, List drops ) + public InWorldToolOperationResult( final ItemStack block, final List drops ) { this.BlockItem = block; this.Drops = drops; } - public InWorldToolOperationResult( ItemStack block ) + public InWorldToolOperationResult( final ItemStack block ) { this.BlockItem = block; this.Drops = null; } - public static InWorldToolOperationResult getBlockOperationResult( ItemStack[] items ) + public static InWorldToolOperationResult getBlockOperationResult( final ItemStack[] items ) { - List temp = new ArrayList(); + final List temp = new ArrayList(); ItemStack b = null; - for( ItemStack l : items ) + for( final ItemStack l : items ) { if( b == null ) { - Block bl = Block.getBlockFromItem( l.getItem() ); + final Block bl = Block.getBlockFromItem( l.getItem() ); if( bl != null && !( bl instanceof BlockAir ) ) { diff --git a/src/main/java/appeng/util/InventoryAdaptor.java b/src/main/java/appeng/util/InventoryAdaptor.java index a90920d7..6bc16574 100644 --- a/src/main/java/appeng/util/InventoryAdaptor.java +++ b/src/main/java/appeng/util/InventoryAdaptor.java @@ -43,14 +43,14 @@ public abstract class InventoryAdaptor implements Iterable { // returns an appropriate adaptor, or null - public static InventoryAdaptor getAdaptor( Object te, EnumFacing d ) + public static InventoryAdaptor getAdaptor( final Object te, final EnumFacing d ) { if( te == null ) { return null; } - IBetterStorage bs = (IBetterStorage) ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BetterStorage ) ? IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BetterStorage ) : null ); + final IBetterStorage bs = (IBetterStorage) ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BetterStorage ) ? IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BetterStorage ) : null ); if( te instanceof EntityPlayer ) { @@ -73,8 +73,8 @@ public abstract class InventoryAdaptor implements Iterable } else if( te instanceof ISidedInventory ) { - ISidedInventory si = (ISidedInventory) te; - int[] slots = si.getSlotsForFace( d ); + final ISidedInventory si = (ISidedInventory) te; + final int[] slots = si.getSlotsForFace( d ); if( si.getSizeInventory() > 0 && slots != null && slots.length > 0 ) { return new AdaptorIInventory( new WrapperMCISidedInventory( si, d ) ); @@ -82,7 +82,7 @@ public abstract class InventoryAdaptor implements Iterable } else if( te instanceof IInventory ) { - IInventory i = (IInventory) te; + final IInventory i = (IInventory) te; if( i.getSizeInventory() > 0 ) { return new AdaptorIInventory( i ); diff --git a/src/main/java/appeng/util/ItemSorters.java b/src/main/java/appeng/util/ItemSorters.java index afde6796..6f0ad451 100644 --- a/src/main/java/appeng/util/ItemSorters.java +++ b/src/main/java/appeng/util/ItemSorters.java @@ -37,7 +37,7 @@ public class ItemSorters { @Override - public int compare( IAEItemStack o1, IAEItemStack o2 ) + public int compare( final IAEItemStack o1, final IAEItemStack o2 ) { if( Direction == SortDir.ASCENDING ) { @@ -50,10 +50,10 @@ public class ItemSorters { @Override - public int compare( IAEItemStack o1, IAEItemStack o2 ) + public int compare( final IAEItemStack o1, final IAEItemStack o2 ) { - AEItemStack op1 = (AEItemStack) o1; - AEItemStack op2 = (AEItemStack) o2; + final AEItemStack op1 = (AEItemStack) o1; + final AEItemStack op2 = (AEItemStack) o2; if( Direction == SortDir.ASCENDING ) { @@ -62,7 +62,7 @@ public class ItemSorters return this.secondarySort( op1.getModID().compareToIgnoreCase( op2.getModID() ), o2, o1 ); } - private int secondarySort( int compareToIgnoreCase, IAEItemStack o1, IAEItemStack o2 ) + private int secondarySort( final int compareToIgnoreCase, final IAEItemStack o1, final IAEItemStack o2 ) { if( compareToIgnoreCase == 0 ) { @@ -76,7 +76,7 @@ public class ItemSorters { @Override - public int compare( IAEItemStack o1, IAEItemStack o2 ) + public int compare( final IAEItemStack o1, final IAEItemStack o2 ) { if( Direction == SortDir.ASCENDING ) { @@ -90,14 +90,14 @@ public class ItemSorters { @Override - public int compare( IAEItemStack o1, IAEItemStack o2 ) + public int compare( final IAEItemStack o1, final IAEItemStack o2 ) { if( api == null ) { return CONFIG_BASED_SORT_BY_NAME.compare( o1, o2 ); } - int cmp = api.compareItems( o1.getItemStack(), o2.getItemStack() ); + final int cmp = api.compareItems( o1.getItemStack(), o2.getItemStack() ); if( Direction == SortDir.ASCENDING ) { @@ -124,7 +124,7 @@ public class ItemSorters } } - public static int compareInt( int a, int b ) + public static int compareInt( final int a, final int b ) { if( a == b ) { @@ -137,7 +137,7 @@ public class ItemSorters return 1; } - public static int compareLong( long a, long b ) + public static int compareLong( final long a, final long b ) { if( a == b ) { @@ -150,7 +150,7 @@ public class ItemSorters return 1; } - public static int compareDouble( double a, double b ) + public static int compareDouble( final double a, final double b ) { if( a == b ) { diff --git a/src/main/java/appeng/util/LookDirection.java b/src/main/java/appeng/util/LookDirection.java index 2821db1f..525a8a11 100644 --- a/src/main/java/appeng/util/LookDirection.java +++ b/src/main/java/appeng/util/LookDirection.java @@ -28,7 +28,7 @@ public class LookDirection public final Vec3 a; public final Vec3 b; - public LookDirection( Vec3 a, Vec3 b ) + public LookDirection( final Vec3 a, final Vec3 b ) { this.a = a; this.b = b; diff --git a/src/main/java/appeng/util/Platform.java b/src/main/java/appeng/util/Platform.java index 0d925143..7570a7f6 100644 --- a/src/main/java/appeng/util/Platform.java +++ b/src/main/java/appeng/util/Platform.java @@ -180,14 +180,14 @@ public class Platform * * @return formatted long value */ - public static String formatPowerLong( long n, boolean isRate ) + public static String formatPowerLong( final long n, final boolean isRate ) { double p = ( (double) n ) / 100; - PowerUnits displayUnits = AEConfig.instance.selectedPowerUnit(); + final PowerUnits displayUnits = AEConfig.instance.selectedPowerUnit(); p = PowerUnits.AE.convertTo( displayUnits, p ); - String[] preFixes = { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" }; + final String[] preFixes = { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" }; String unitName = displayUnits.name(); if( displayUnits == PowerUnits.WA ) @@ -209,15 +209,15 @@ public class Platform offset++; } - DecimalFormat df = new DecimalFormat( "#.##" ); + final DecimalFormat df = new DecimalFormat( "#.##" ); return df.format( p ) + ' ' + level + unitName + ( isRate ? "/t" : "" ); } - public static AEPartLocation crossProduct( AEPartLocation forward, AEPartLocation up ) + public static AEPartLocation crossProduct( final AEPartLocation forward, final AEPartLocation up ) { - int west_x = forward.yOffset * up.zOffset - forward.zOffset * up.yOffset; - int west_y = forward.zOffset * up.xOffset - forward.xOffset * up.zOffset; - int west_z = forward.xOffset * up.yOffset - forward.yOffset * up.xOffset; + final int west_x = forward.yOffset * up.zOffset - forward.zOffset * up.yOffset; + final int west_y = forward.zOffset * up.xOffset - forward.xOffset * up.zOffset; + final int west_z = forward.xOffset * up.yOffset - forward.yOffset * up.xOffset; switch( west_x + west_y * 2 + west_z * 3 ) { @@ -240,11 +240,11 @@ public class Platform return AEPartLocation.INTERNAL; } - public static EnumFacing crossProduct( EnumFacing forward, EnumFacing up ) + public static EnumFacing crossProduct( final EnumFacing forward, final EnumFacing up ) { - int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY(); - int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ(); - int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX(); + final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY(); + final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ(); + final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX(); switch( west_x + west_y * 2 + west_z * 3 ) { @@ -268,7 +268,7 @@ public class Platform return EnumFacing.NORTH; } - public static T rotateEnum( T ce, boolean backwards, EnumSet validOptions ) + public static T rotateEnum( T ce, final boolean backwards, final EnumSet validOptions ) { do { @@ -289,9 +289,9 @@ public class Platform /* * Simple way to cycle an enum... */ - public static T prevEnum( T ce ) + public static T prevEnum( final T ce ) { - EnumSet valList = EnumSet.allOf( ce.getClass() ); + final EnumSet valList = EnumSet.allOf( ce.getClass() ); int pLoc = ce.ordinal() - 1; if( pLoc < 0 ) @@ -305,7 +305,7 @@ public class Platform } int pos = 0; - for( Object g : valList ) + for( final Object g : valList ) { if( pos == pLoc ) { @@ -320,9 +320,9 @@ public class Platform /* * Simple way to cycle an enum... */ - public static T nextEnum( T ce ) + public static T nextEnum( final T ce ) { - EnumSet valList = EnumSet.allOf( ce.getClass() ); + final EnumSet valList = EnumSet.allOf( ce.getClass() ); int pLoc = ce.ordinal() + 1; if( pLoc >= valList.size() ) @@ -336,7 +336,7 @@ public class Platform } int pos = 0; - for( Object g : valList ) + for( final Object g : valList ) { if( pos == pLoc ) { @@ -348,7 +348,7 @@ public class Platform return null; } - private static boolean isNotValidSetting( Enum e ) + private static boolean isNotValidSetting( final Enum e ) { if( e == SortOrder.INVTWEAKS && !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.InvTweaks ) ) { @@ -368,7 +368,7 @@ public class Platform return false; } - public static void openGUI( @Nonnull EntityPlayer p, @Nullable TileEntity tile, @Nullable AEPartLocation side, @Nonnull GuiBridge type ) + public static void openGUI( @Nonnull final EntityPlayer p, @Nullable final TileEntity tile, @Nullable final AEPartLocation side, @Nonnull final GuiBridge type ) { if( isClient() ) { @@ -410,7 +410,7 @@ public class Platform return FMLCommonHandler.instance().getEffectiveSide().isClient(); } - public static boolean hasPermissions( DimensionalCoord dc, EntityPlayer player ) + public static boolean hasPermissions( final DimensionalCoord dc, final EntityPlayer player ) { return dc.getWorld().canMineBlockBody( player, dc.getPos() ); } @@ -418,13 +418,13 @@ public class Platform /* * Checks to see if a block is air? */ - public static boolean isBlockAir( World w, BlockPos pos ) + public static boolean isBlockAir( final World w, final BlockPos pos ) { try { return w.getBlockState( pos ).getBlock().isAir( w, pos ); } - catch( Throwable e ) + catch( final Throwable e ) { return false; } @@ -434,7 +434,7 @@ public class Platform * Lots of silliness to try and account for weird tag related junk, basically requires that two tags have at least * something in their tags before it wasts its time comparing them. */ - public static boolean sameStackStags( ItemStack a, ItemStack b ) + public static boolean sameStackStags( final ItemStack a, final ItemStack b ) { if( a == null && b == null ) { @@ -449,8 +449,8 @@ public class Platform return true; } - NBTTagCompound ta = a.getTagCompound(); - NBTTagCompound tb = b.getTagCompound(); + final NBTTagCompound ta = a.getTagCompound(); + final NBTTagCompound tb = b.getTagCompound(); if( ta == tb ) { return true; @@ -480,31 +480,31 @@ public class Platform * then the vanilla version which likes to fail when NBT Compound data changes order, it is pretty expensive * performance wise, so try an use shared tag compounds as long as the system remains in AE. */ - public static boolean NBTEqualityTest( NBTBase left, NBTBase right ) + public static boolean NBTEqualityTest( final NBTBase left, final NBTBase right ) { // same type? - byte id = left.getId(); + final byte id = left.getId(); if( id == right.getId() ) { switch( id ) { case 10: { - NBTTagCompound ctA = (NBTTagCompound) left; - NBTTagCompound ctB = (NBTTagCompound) right; + final NBTTagCompound ctA = (NBTTagCompound) left; + final NBTTagCompound ctB = (NBTTagCompound) right; - Set cA = ctA.getKeySet(); - Set cB = ctB.getKeySet(); + final Set cA = ctA.getKeySet(); + final Set cB = ctB.getKeySet(); if( cA.size() != cB.size() ) { return false; } - for( String name : cA ) + for( final String name : cA ) { - NBTBase tag = ctA.getTag( name ); - NBTBase aTag = ctB.getTag( name ); + final NBTBase tag = ctA.getTag( name ); + final NBTBase aTag = ctB.getTag( name ); if( aTag == null ) { return false; @@ -521,15 +521,15 @@ public class Platform case 9: // ) // A instanceof NBTTagList ) { - NBTTagList lA = (NBTTagList) left; - NBTTagList lB = (NBTTagList) right; + final NBTTagList lA = (NBTTagList) left; + final NBTTagList lB = (NBTTagList) right; if( lA.tagCount() != lB.tagCount() ) { return false; } - List tag = tagList( lA ); - List aTag = tagList( lB ); + final List tag = tagList( lA ); + final List aTag = tagList( lB ); if( tag.size() != aTag.size() ) { return false; @@ -577,7 +577,7 @@ public class Platform return false; } - private static List tagList( NBTTagList lB ) + private static List tagList( final NBTTagList lB ) { if( tagList == null ) { @@ -585,13 +585,13 @@ public class Platform { tagList = lB.getClass().getDeclaredField( "tagList" ); } - catch( Throwable t ) + catch( final Throwable t ) { try { tagList = lB.getClass().getDeclaredField( "field_74747_a" ); } - catch( Throwable z ) + catch( final Throwable z ) { AELog.error( t ); AELog.error( z ); @@ -604,7 +604,7 @@ public class Platform tagList.setAccessible( true ); return (List) tagList.get( lB ); } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } @@ -616,21 +616,21 @@ public class Platform * Orderless hash on NBT Data, used to work thought huge piles fast, but ignores the order just in case MC decided * to change it... WHICH IS BAD... */ - public static int NBTOrderlessHash( NBTBase nbt ) + public static int NBTOrderlessHash( final NBTBase nbt ) { // same type? int hash = 0; - byte id = nbt.getId(); + final byte id = nbt.getId(); hash += id; switch( id ) { case 10: { - NBTTagCompound ctA = (NBTTagCompound) nbt; + final NBTTagCompound ctA = (NBTTagCompound) nbt; - Set cA = ctA.getKeySet(); + final Set cA = ctA.getKeySet(); - for( String name : cA ) + for( final String name : cA ) { hash += name.hashCode() ^ NBTOrderlessHash( ctA.getTag( name ) ); } @@ -640,10 +640,10 @@ public class Platform case 9: // ) // A instanceof NBTTagList ) { - NBTTagList lA = (NBTTagList) nbt; + final NBTTagList lA = (NBTTagList) nbt; hash += 9 * lA.tagCount(); - List l = tagList( lA ); + final List l = tagList( lA ); for( int x = 0; x < l.size(); x++ ) { hash += ( (Integer) x ).hashCode() ^ NBTOrderlessHash( l.get( x ) ); @@ -678,12 +678,12 @@ public class Platform /* * The usual version of this returns an ItemStack, this version returns the recipe. */ - public static IRecipe findMatchingRecipe( InventoryCrafting inventoryCrafting, World par2World ) + public static IRecipe findMatchingRecipe( final InventoryCrafting inventoryCrafting, final World par2World ) { - CraftingManager cm = CraftingManager.getInstance(); - List rl = cm.getRecipeList(); + final CraftingManager cm = CraftingManager.getInstance(); + final List rl = cm.getRecipeList(); - for( IRecipe r : rl ) + for( final IRecipe r : rl ) { if( r.matches( inventoryCrafting, par2World ) ) { @@ -694,10 +694,10 @@ public class Platform return null; } - public static ItemStack[] getBlockDrops( World w, BlockPos pos ) + public static ItemStack[] getBlockDrops( final World w, final BlockPos pos ) { List out = new ArrayList(); - IBlockState state = w.getBlockState( pos ); + final IBlockState state = w.getBlockState( pos ); if( state != null ) { @@ -711,7 +711,7 @@ public class Platform return out.toArray( new ItemStack[out.size()] ); } - public static AEPartLocation cycleOrientations( AEPartLocation dir, boolean upAndDown ) + public static AEPartLocation cycleOrientations( final AEPartLocation dir, final boolean upAndDown ) { if( upAndDown ) { @@ -760,7 +760,7 @@ public class Platform /* * Creates / or loads previous NBT Data on items, used for editing items owned by AE. */ - public static NBTTagCompound openNbtData( ItemStack i ) + public static NBTTagCompound openNbtData( final ItemStack i ) { NBTTagCompound compound = i.getTagCompound(); @@ -775,20 +775,20 @@ public class Platform /* * Generates Item entities in the world similar to how items are generally dropped. */ - public static void spawnDrops( World w, BlockPos pos, List drops ) + public static void spawnDrops( final World w, final BlockPos pos, final List drops ) { if( isServer() ) { - for( ItemStack i : drops ) + for( final ItemStack i : drops ) { if( i != null ) { if( i.stackSize > 0 ) { - double offset_x = ( getRandomInt() % 32 - 16 ) / 82; - double offset_y = ( getRandomInt() % 32 - 16 ) / 82; - double offset_z = ( getRandomInt() % 32 - 16 ) / 82; - EntityItem ei = new EntityItem( w, 0.5 + offset_x + pos.getX(), 0.5 + offset_y + pos.getY(), 0.2 + offset_z + pos.getZ(), i.copy() ); + final double offset_x = ( getRandomInt() % 32 - 16 ) / 82; + final double offset_y = ( getRandomInt() % 32 - 16 ) / 82; + final double offset_z = ( getRandomInt() % 32 - 16 ) / 82; + final EntityItem ei = new EntityItem( w, 0.5 + offset_x + pos.getX(), 0.5 + offset_y + pos.getY(), 0.2 + offset_z + pos.getZ(), i.copy() ); w.spawnEntityInWorld( ei ); } } @@ -812,14 +812,14 @@ public class Platform /* * Utility function to get the full inventory for a Double Chest in the World. */ - public static IInventory GetChestInv( Object te ) + public static IInventory GetChestInv( final Object te ) { TileEntityChest teA = (TileEntityChest) te; TileEntity teB = null; - IBlockState myBlockID = teA.getWorld().getBlockState( teA.getPos() ); + final IBlockState myBlockID = teA.getWorld().getBlockState( teA.getPos() ); - BlockPos posX = teA.getPos().offset( EnumFacing.EAST ); - BlockPos negX = teA.getPos().offset( EnumFacing.WEST ); + final BlockPos posX = teA.getPos().offset( EnumFacing.EAST ); + final BlockPos negX = teA.getPos().offset( EnumFacing.WEST ); if( teA.getWorld().getBlockState( posX ) == myBlockID ) { @@ -841,15 +841,15 @@ public class Platform } else { - TileEntityChest x = teA; + final TileEntityChest x = teA; teA = (TileEntityChest) teB; teB = x; } } } - BlockPos posY = teA.getPos().offset( EnumFacing.SOUTH ); - BlockPos negY = teA.getPos().offset( EnumFacing.NORTH ); + final BlockPos posY = teA.getPos().offset( EnumFacing.SOUTH ); + final BlockPos negY = teA.getPos().offset( EnumFacing.NORTH ); if( teB == null ) { @@ -874,7 +874,7 @@ public class Platform } else { - TileEntityChest x = teA; + final TileEntityChest x = teA; teA = (TileEntityChest) teB; teB = x; } @@ -889,18 +889,18 @@ public class Platform return new InventoryLargeChest( "", teA, (ILockableContainer) teB ); } - public static boolean isModLoaded( String modid ) + public static boolean isModLoaded( final String modid ) { try { // if this fails for some reason, try the other method. return Loader.isModLoaded( modid ); } - catch( Throwable ignored ) + catch( final Throwable ignored ) { } - for( ModContainer f : Loader.instance().getActiveModList() ) + for( final ModContainer f : Loader.instance().getActiveModList() ) { if( f.getModId().equals( modid ) ) { @@ -910,13 +910,13 @@ public class Platform return false; } - public static ItemStack findMatchingRecipeOutput( InventoryCrafting ic, World worldObj ) + public static ItemStack findMatchingRecipeOutput( final InventoryCrafting ic, final World worldObj ) { return CraftingManager.getInstance().findMatchingRecipe( ic, worldObj ); } @SideOnly( Side.CLIENT ) - public static List getTooltip( Object o ) + public static List getTooltip( final Object o ) { if( o == null ) { @@ -926,7 +926,7 @@ public class Platform ItemStack itemStack = null; if( o instanceof AEItemStack ) { - AEItemStack ais = (AEItemStack) o; + final AEItemStack ais = (AEItemStack) o; return ais.getToolTip(); } else if( o instanceof ItemStack ) @@ -942,24 +942,24 @@ public class Platform { return itemStack.getTooltip( Minecraft.getMinecraft().thePlayer, false ); } - catch( Exception errB ) + catch( final Exception errB ) { return new ArrayList(); } } - public static String getModId( IAEItemStack is ) + public static String getModId( final IAEItemStack is ) { if( is == null ) { return "** Null"; } - String n = ( (AEItemStack) is ).getModID(); + final String n = ( (AEItemStack) is ).getModID(); return n == null ? "** Null" : n; } - public static String getItemDisplayName( Object o ) + public static String getItemDisplayName( final Object o ) { if( o == null ) { @@ -969,7 +969,7 @@ public class Platform ItemStack itemStack = null; if( o instanceof AEItemStack ) { - String n = ( (AEItemStack) o ).getDisplayName(); + final String n = ( (AEItemStack) o ).getDisplayName(); return n == null ? "** Null" : n; } else if( o instanceof ItemStack ) @@ -990,27 +990,27 @@ public class Platform } return name == null ? "** Null" : name; } - catch( Exception errA ) + catch( final Exception errA ) { try { - String n = itemStack.getUnlocalizedName(); + final String n = itemStack.getUnlocalizedName(); return n == null ? "** Null" : n; } - catch( Exception errB ) + catch( final Exception errB ) { return "** Exception"; } } } - public static boolean hasSpecialComparison( IAEItemStack willAdd ) + public static boolean hasSpecialComparison( final IAEItemStack willAdd ) { if( willAdd == null ) { return false; } - IAETagCompound tag = willAdd.getTagCompound(); + final IAETagCompound tag = willAdd.getTagCompound(); if( tag != null && tag.getSpecialComparison() != null ) { return true; @@ -1018,7 +1018,7 @@ public class Platform return false; } - public static boolean hasSpecialComparison( ItemStack willAdd ) + public static boolean hasSpecialComparison( final ItemStack willAdd ) { if( AESharedNBT.isShared( willAdd.getTagCompound() ) ) { @@ -1030,7 +1030,7 @@ public class Platform return false; } - public static boolean isWrench( EntityPlayer player, ItemStack eq, BlockPos pos ) + public static boolean isWrench( final EntityPlayer player, final ItemStack eq, final BlockPos pos ) { if( eq != null ) { @@ -1045,27 +1045,27 @@ public class Platform } */ } - catch( Throwable ignore ) + catch( final Throwable ignore ) { // explodes without BC } if( eq.getItem() instanceof IAEWrench ) { - IAEWrench wrench = (IAEWrench) eq.getItem(); + final IAEWrench wrench = (IAEWrench) eq.getItem(); return wrench.canWrench( eq, player, pos ); } } return false; } - public static boolean isChargeable( ItemStack i ) + public static boolean isChargeable( final ItemStack i ) { if( i == null ) { return false; } - Item it = i.getItem(); + final Item it = i.getItem(); if( it instanceof IAEItemPowerStorage ) { return ( (IAEItemPowerStorage) it ).getPowerFlow( i ) != AccessRestriction.READ; @@ -1073,25 +1073,25 @@ public class Platform return false; } - public static EntityPlayer getPlayer( WorldServer w ) + public static EntityPlayer getPlayer( final WorldServer w ) { if( w == null ) { throw new InvalidParameterException( "World is null." ); } - EntityPlayer wrp = FAKE_PLAYERS.get( w ); + final EntityPlayer wrp = FAKE_PLAYERS.get( w ); if( wrp != null ) { return wrp; } - EntityPlayer p = FakePlayerFactory.getMinecraft( w ); + final EntityPlayer p = FakePlayerFactory.getMinecraft( w ); FAKE_PLAYERS.put( w, p ); return p; } - public static int MC2MEColor( int color ) + public static int MC2MEColor( final int color ) { switch( color ) { @@ -1123,7 +1123,7 @@ public class Platform return -1; } - public static int findEmpty( Object[] l ) + public static int findEmpty( final Object[] l ) { for( int x = 0; x < l.length; x++ ) { @@ -1135,10 +1135,10 @@ public class Platform return -1; } - public static T pickRandom( Collection outs ) + public static T pickRandom( final Collection outs ) { int index = RANDOM_GENERATOR.nextInt( outs.size() ); - Iterator i = outs.iterator(); + final Iterator i = outs.iterator(); while( i.hasNext() && index > 0 ) { index--; @@ -1152,7 +1152,7 @@ public class Platform return null; // wtf? } - public static AEPartLocation rotateAround( AEPartLocation forward, AEPartLocation axis ) + public static AEPartLocation rotateAround( final AEPartLocation forward, final AEPartLocation axis ) { if( axis == AEPartLocation.INTERNAL || forward == AEPartLocation.INTERNAL ) { @@ -1259,7 +1259,7 @@ public class Platform return forward; } - public static EnumFacing rotateAround( EnumFacing forward, EnumFacing axis ) + public static EnumFacing rotateAround( final EnumFacing forward, final EnumFacing axis ) { switch( forward ) { @@ -1362,17 +1362,17 @@ public class Platform } @SideOnly( Side.CLIENT ) - public static String gui_localize( String string ) + public static String gui_localize( final String string ) { return StatCollector.translateToLocal( string ); } - public static boolean isSameItemPrecise( @Nullable ItemStack is, @Nullable ItemStack filter ) + public static boolean isSameItemPrecise( @Nullable final ItemStack is, @Nullable final ItemStack filter ) { return isSameItem( is, filter ) && sameStackStags( is, filter ); } - public static boolean isSameItemFuzzy( ItemStack a, ItemStack b, FuzzyMode mode ) + public static boolean isSameItemFuzzy( final ItemStack a, final ItemStack b, final FuzzyMode mode ) { if( a == null && b == null ) { @@ -1405,23 +1405,23 @@ public class Platform } else if( mode == FuzzyMode.PERCENT_99 ) { - Item ai = a.getItem(); - Item bi = b.getItem(); + final Item ai = a.getItem(); + final Item bi = b.getItem(); return ( ai.getDurabilityForDisplay(a) > 1 ) == ( bi.getDurabilityForDisplay(b) > 1 ); } else { - Item ai = a.getItem(); - Item bi = b.getItem(); + final Item ai = a.getItem(); + final Item bi = b.getItem(); - float percentDamagedOfA = 1.0f - (float) ai.getDurabilityForDisplay(a); - float percentDamagedOfB = 1.0f - (float) bi.getDurabilityForDisplay(b); + final float percentDamagedOfA = 1.0f - (float) ai.getDurabilityForDisplay(a); + final float percentDamagedOfB = 1.0f - (float) bi.getDurabilityForDisplay(b); return ( percentDamagedOfA > mode.breakPoint ) == ( percentDamagedOfB > mode.breakPoint ); } } - catch( Throwable e ) + catch( final Throwable e ) { if( mode == FuzzyMode.IGNORE_ALL ) { @@ -1433,16 +1433,16 @@ public class Platform } else { - float percentDamagedOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); - float percentDamagedOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); + final float percentDamagedOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); + final float percentDamagedOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); return ( percentDamagedOfA > mode.breakPoint ) == ( percentDamagedOfB > mode.breakPoint ); } } } - OreReference aOR = OreHelper.INSTANCE.isOre( a ); - OreReference bOR = OreHelper.INSTANCE.isOre( b ); + final OreReference aOR = OreHelper.INSTANCE.isOre( a ); + final OreReference bOR = OreHelper.INSTANCE.isOre( b ); if( OreHelper.INSTANCE.sameOre( aOR, bOR ) ) { @@ -1466,7 +1466,7 @@ public class Platform return a.isItemEqual( b ); } - public static LookDirection getPlayerRay( EntityPlayer playerIn, float eyeOffset ) + public static LookDirection getPlayerRay( final EntityPlayer playerIn, final float eyeOffset ) { double reachDistance = 5.0d; @@ -1496,38 +1496,38 @@ public class Platform return new LookDirection( from, to ); } - public static MovingObjectPosition rayTrace( EntityPlayer p, boolean hitBlocks, boolean hitEntities ) + public static MovingObjectPosition rayTrace( final EntityPlayer p, final boolean hitBlocks, final boolean hitEntities ) { - World w = p.getEntityWorld(); + final World w = p.getEntityWorld(); - float f = 1.0F; + final float f = 1.0F; float f1 = p.prevRotationPitch + ( p.rotationPitch - p.prevRotationPitch ) * f; - float f2 = p.prevRotationYaw + ( p.rotationYaw - p.prevRotationYaw ) * f; - double d0 = p.prevPosX + ( p.posX - p.prevPosX ) * f; - double d1 = p.prevPosY + ( p.posY - p.prevPosY ) * f + 1.62D - p.getYOffset(); - double d2 = p.prevPosZ + ( p.posZ - p.prevPosZ ) * f; - Vec3 vec3 = new Vec3( d0, d1, d2 ); - float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); - float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); - float f5 = -MathHelper.cos( -f1 * 0.017453292F ); - float f6 = MathHelper.sin( -f1 * 0.017453292F ); - float f7 = f4 * f5; - float f8 = f3 * f5; - double d3 = 32.0D; + final float f2 = p.prevRotationYaw + ( p.rotationYaw - p.prevRotationYaw ) * f; + final double d0 = p.prevPosX + ( p.posX - p.prevPosX ) * f; + final double d1 = p.prevPosY + ( p.posY - p.prevPosY ) * f + 1.62D - p.getYOffset(); + final double d2 = p.prevPosZ + ( p.posZ - p.prevPosZ ) * f; + final Vec3 vec3 = new Vec3( d0, d1, d2 ); + final float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); + final float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); + final float f5 = -MathHelper.cos( -f1 * 0.017453292F ); + final float f6 = MathHelper.sin( -f1 * 0.017453292F ); + final float f7 = f4 * f5; + final float f8 = f3 * f5; + final double d3 = 32.0D; - Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); + final Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 ); - AxisAlignedBB bb = AxisAlignedBB.fromBounds( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); + final AxisAlignedBB bb = AxisAlignedBB.fromBounds( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 ); Entity entity = null; double closest = 9999999.0D; if( hitEntities ) { - List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); + final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb ); for( int l = 0; l < list.size(); ++l ) { - Entity entity1 = (Entity) list.get( l ); + final Entity entity1 = (Entity) list.get( l ); if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) ) { @@ -1540,12 +1540,12 @@ public class Platform } f1 = 0.3F; - AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 ); - MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); + final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 ); + final MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 ); if( movingObjectPosition != null ) { - double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); + final double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec ); if( nd < closest ) { @@ -1586,9 +1586,9 @@ public class Platform return 0; } - public static StackType poweredExtraction( IEnergySource energy, IMEInventory cell, StackType request, BaseActionSource src ) + public static StackType poweredExtraction( final IEnergySource energy, final IMEInventory cell, final StackType request, final BaseActionSource src ) { - StackType possible = cell.extractItems( (StackType) request.copy(), Actionable.SIMULATE, src ); + final StackType possible = cell.extractItems( (StackType) request.copy(), Actionable.SIMULATE, src ); long retrieved = 0; if( possible != null ) @@ -1596,16 +1596,16 @@ public class Platform retrieved = possible.getStackSize(); } - double availablePower = energy.extractAEPower( retrieved, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + final double availablePower = energy.extractAEPower( retrieved, Actionable.SIMULATE, PowerMultiplier.CONFIG ); - long itemToExtract = Math.min( (long) ( availablePower + 0.9 ), retrieved ); + final long itemToExtract = Math.min( (long) ( availablePower + 0.9 ), retrieved ); if( itemToExtract > 0 ) { energy.extractAEPower( retrieved, Actionable.MODULATE, PowerMultiplier.CONFIG ); possible.setStackSize( itemToExtract ); - StackType ret = cell.extractItems( possible, Actionable.MODULATE, src ); + final StackType ret = cell.extractItems( possible, Actionable.MODULATE, src ); if( ret != null && src.isPlayer() ) { @@ -1618,9 +1618,9 @@ public class Platform return null; } - public static StackType poweredInsert( IEnergySource energy, IMEInventory cell, StackType input, BaseActionSource src ) + public static StackType poweredInsert( final IEnergySource energy, final IMEInventory cell, final StackType input, final BaseActionSource src ) { - StackType possible = cell.injectItems( (StackType) input.copy(), Actionable.SIMULATE, src ); + final StackType possible = cell.injectItems( (StackType) input.copy(), Actionable.SIMULATE, src ); long stored = input.getStackSize(); if( possible != null ) @@ -1628,9 +1628,9 @@ public class Platform stored -= possible.getStackSize(); } - double availablePower = energy.extractAEPower( stored, Actionable.SIMULATE, PowerMultiplier.CONFIG ); + final double availablePower = energy.extractAEPower( stored, Actionable.SIMULATE, PowerMultiplier.CONFIG ); - long itemToAdd = Math.min( (long) ( availablePower + 0.9 ), stored ); + final long itemToAdd = Math.min( (long) ( availablePower + 0.9 ), stored ); if( itemToAdd > 0 ) { @@ -1638,26 +1638,26 @@ public class Platform if( itemToAdd < input.getStackSize() ) { - long original = input.getStackSize(); - StackType split = (StackType) input.copy(); + final long original = input.getStackSize(); + final StackType split = (StackType) input.copy(); split.decStackSize( itemToAdd ); input.setStackSize( itemToAdd ); split.add( cell.injectItems( input, Actionable.MODULATE, src ) ); if( src.isPlayer() ) { - long diff = original - split.getStackSize(); + final long diff = original - split.getStackSize(); Stats.ItemsInserted.addToPlayer( ( (PlayerSource) src ).player, (int) diff ); } return split; } - StackType ret = cell.injectItems( input, Actionable.MODULATE, src ); + final StackType ret = cell.injectItems( input, Actionable.MODULATE, src ); if( src.isPlayer() ) { - long diff = ret == null ? input.getStackSize() : input.getStackSize() - ret.getStackSize(); + final long diff = ret == null ? input.getStackSize() : input.getStackSize() - ret.getStackSize(); Stats.ItemsInserted.addToPlayer( ( (PlayerSource) src ).player, (int) diff ); } @@ -1667,28 +1667,28 @@ public class Platform return input; } - public static void postChanges( IStorageGrid gs, ItemStack removed, ItemStack added, BaseActionSource src ) + public static void postChanges( final IStorageGrid gs, final ItemStack removed, final ItemStack added, final BaseActionSource src ) { - IItemList itemChanges = AEApi.instance().storage().createItemList(); - IItemList fluidChanges = AEApi.instance().storage().createFluidList(); + final IItemList itemChanges = AEApi.instance().storage().createItemList(); + final IItemList fluidChanges = AEApi.instance().storage().createFluidList(); if( removed != null ) { - IMEInventory myItems = AEApi.instance().registries().cell().getCellInventory( removed, null, StorageChannel.ITEMS ); + final IMEInventory myItems = AEApi.instance().registries().cell().getCellInventory( removed, null, StorageChannel.ITEMS ); if( myItems != null ) { - for( IAEItemStack is : myItems.getAvailableItems( itemChanges ) ) + for( final IAEItemStack is : myItems.getAvailableItems( itemChanges ) ) { is.setStackSize( -is.getStackSize() ); } } - IMEInventory myFluids = AEApi.instance().registries().cell().getCellInventory( removed, null, StorageChannel.FLUIDS ); + final IMEInventory myFluids = AEApi.instance().registries().cell().getCellInventory( removed, null, StorageChannel.FLUIDS ); if( myFluids != null ) { - for( IAEFluidStack is : myFluids.getAvailableItems( fluidChanges ) ) + for( final IAEFluidStack is : myFluids.getAvailableItems( fluidChanges ) ) { is.setStackSize( -is.getStackSize() ); } @@ -1697,14 +1697,14 @@ public class Platform if( added != null ) { - IMEInventory myItems = AEApi.instance().registries().cell().getCellInventory( added, null, StorageChannel.ITEMS ); + final IMEInventory myItems = AEApi.instance().registries().cell().getCellInventory( added, null, StorageChannel.ITEMS ); if( myItems != null ) { myItems.getAvailableItems( itemChanges ); } - IMEInventory myFluids = AEApi.instance().registries().cell().getCellInventory( added, null, StorageChannel.FLUIDS ); + final IMEInventory myFluids = AEApi.instance().registries().cell().getCellInventory( added, null, StorageChannel.FLUIDS ); if( myFluids != null ) { @@ -1715,21 +1715,21 @@ public class Platform gs.postAlterationOfStoredItems( StorageChannel.ITEMS, itemChanges, src ); } - public static > void postListChanges( IItemList before, IItemList after, IMEMonitorHandlerReceiver meMonitorPassthrough, BaseActionSource source ) + public static > void postListChanges( final IItemList before, final IItemList after, final IMEMonitorHandlerReceiver meMonitorPassthrough, final BaseActionSource source ) { - LinkedList changes = new LinkedList(); + final LinkedList changes = new LinkedList(); - for( T is : before ) + for( final T is : before ) { is.setStackSize( -is.getStackSize() ); } - for( T is : after ) + for( final T is : after ) { before.add( is ); } - for( T is : before ) + for( final T is : before ) { if( is.getStackSize() != 0 ) { @@ -1743,7 +1743,7 @@ public class Platform } } - public static int generateTileHash( TileEntity target ) + public static int generateTileHash( final TileEntity target ) { if( target == null ) { @@ -1758,7 +1758,7 @@ public class Platform } else if( target instanceof TileEntityChest ) { - TileEntityChest chest = (TileEntityChest) target; + final TileEntityChest chest = (TileEntityChest) target; chest.checkForAdjacentChests(); if( chest.adjacentChestZNeg != null ) { @@ -1783,10 +1783,10 @@ public class Platform if( target instanceof ISidedInventory ) { - for( EnumFacing dir : EnumFacing.VALUES ) + for( final EnumFacing dir : EnumFacing.VALUES ) { - int[] sides = ( (ISidedInventory) target ).getSlotsForFace( dir ); + final int[] sides = ( (ISidedInventory) target ).getSlotsForFace( dir ); if( sides == null ) { @@ -1794,9 +1794,9 @@ public class Platform } int offset = 0; - for( int side : sides ) + for( final int side : sides ) { - int c = ( side << ( offset % 8 ) ) ^ ( 1 << dir.ordinal() ); + final int c = ( side << ( offset % 8 ) ) ^ ( 1 << dir.ordinal() ); offset++; hash = c + ( hash << 6 ) + ( hash << 16 ) - hash; } @@ -1807,7 +1807,7 @@ public class Platform return hash; } - public static boolean securityCheck( GridNode a, GridNode b ) + public static boolean securityCheck( final GridNode a, final GridNode b ) { if( a.lastSecurityKey == -1 && b.lastSecurityKey == -1 ) { @@ -1818,8 +1818,8 @@ public class Platform return false; } - boolean a_isSecure = isPowered( a.getGrid() ) && a.lastSecurityKey != -1; - boolean b_isSecure = isPowered( b.getGrid() ) && b.lastSecurityKey != -1; + final boolean a_isSecure = isPowered( a.getGrid() ) && a.lastSecurityKey != -1; + final boolean b_isSecure = isPowered( b.getGrid() ) && b.lastSecurityKey != -1; if( AEConfig.instance.isFeatureEnabled( AEFeature.LogSecurityAudits ) ) { @@ -1845,25 +1845,25 @@ public class Platform return false; } - private static boolean isPowered( IGrid grid ) + private static boolean isPowered( final IGrid grid ) { if( grid == null ) { return false; } - IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); + final IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); return eg.isNetworkPowered(); } - private static boolean checkPlayerPermissions( IGrid grid, int playerID ) + private static boolean checkPlayerPermissions( final IGrid grid, final int playerID ) { if( grid == null ) { return false; } - ISecurityGrid gs = grid.getCache( ISecurityGrid.class ); + final ISecurityGrid gs = grid.getCache( ISecurityGrid.class ); if( gs == null ) { @@ -1878,7 +1878,7 @@ public class Platform return !gs.hasPermission( playerID, SecurityPermissions.BUILD ); } - public static void configurePlayer( EntityPlayer player, AEPartLocation side, TileEntity tile ) + public static void configurePlayer( final EntityPlayer player, final AEPartLocation side, final TileEntity tile ) { float pitch = 0.0f; float yaw = 0.0f; @@ -1917,7 +1917,7 @@ public class Platform player.rotationYaw = player.prevCameraYaw = player.cameraYaw = yaw; } - public static boolean canAccess( AENetworkProxy gridProxy, BaseActionSource src ) + public static boolean canAccess( final AENetworkProxy gridProxy, final BaseActionSource src ) { try { @@ -1927,14 +1927,14 @@ public class Platform } else if( src.isMachine() ) { - IActionHost te = ( (MachineSource) src ).via; - IGridNode n = te.getActionableNode(); + final IActionHost te = ( (MachineSource) src ).via; + final IGridNode n = te.getActionableNode(); if( n == null ) { return false; } - int playerID = n.getPlayerID(); + final int playerID = n.getPlayerID(); return gridProxy.getSecurity().hasPermission( playerID, SecurityPermissions.BUILD ); } else @@ -1942,13 +1942,13 @@ public class Platform return false; } } - catch( GridAccessException gae ) + catch( final GridAccessException gae ) { return false; } } - public static ItemStack extractItemsByRecipe( IEnergySource energySrc, BaseActionSource mySrc, IMEMonitor src, World w, IRecipe r, ItemStack output, InventoryCrafting ci, ItemStack providedTemplate, int slot, IItemList items, Actionable realForFake, IPartitionList filter ) + public static ItemStack extractItemsByRecipe( final IEnergySource energySrc, final BaseActionSource mySrc, final IMEMonitor src, final World w, final IRecipe r, final ItemStack output, final InventoryCrafting ci, final ItemStack providedTemplate, final int slot, final IItemList items, final Actionable realForFake, final IPartitionList filter ) { if( energySrc.extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.9 ) { @@ -1957,15 +1957,15 @@ public class Platform return null; } - AEItemStack ae_req = AEItemStack.create( providedTemplate ); + final AEItemStack ae_req = AEItemStack.create( providedTemplate ); ae_req.setStackSize( 1 ); if( filter == null || filter.isListed( ae_req ) ) { - IAEItemStack ae_ext = src.extractItems( ae_req, realForFake, mySrc ); + final IAEItemStack ae_ext = src.extractItems( ae_req, realForFake, mySrc ); if( ae_ext != null ) { - ItemStack extracted = ae_ext.getItemStack(); + final ItemStack extracted = ae_ext.getItemStack(); if( extracted != null ) { energySrc.extractAEPower( 1, realForFake, PowerMultiplier.CONFIG ); @@ -1974,25 +1974,25 @@ public class Platform } } - boolean checkFuzzy = ae_req.isOre() || providedTemplate.getItemDamage() == OreDictionary.WILDCARD_VALUE || providedTemplate.hasTagCompound() || providedTemplate.isItemStackDamageable(); + final boolean checkFuzzy = ae_req.isOre() || providedTemplate.getItemDamage() == OreDictionary.WILDCARD_VALUE || providedTemplate.hasTagCompound() || providedTemplate.isItemStackDamageable(); if( items != null && checkFuzzy ) { - for( IAEItemStack x : items ) + for( final IAEItemStack x : items ) { - ItemStack sh = x.getItemStack(); + final ItemStack sh = x.getItemStack(); if( ( Platform.isSameItemType( providedTemplate, sh ) || ae_req.sameOre( x ) ) && !Platform.isSameItem( sh, output ) ) { // Platform.isSameItemType( sh, providedTemplate ) - ItemStack cp = Platform.cloneItemStack( sh ); + final ItemStack cp = Platform.cloneItemStack( sh ); cp.stackSize = 1; ci.setInventorySlotContents( slot, cp ); if( r.matches( ci, w ) && Platform.isSameItem( r.getCraftingResult( ci ), output ) ) { - IAEItemStack ax = x.copy(); + final IAEItemStack ax = x.copy(); ax.setStackSize( 1 ); if( filter == null || filter.isListed( ax ) ) { - IAEItemStack ex = src.extractItems( ax, realForFake, mySrc ); + final IAEItemStack ex = src.extractItems( ax, realForFake, mySrc ); if( ex != null ) { energySrc.extractAEPower( 1, realForFake, PowerMultiplier.CONFIG ); @@ -2008,7 +2008,7 @@ public class Platform return null; } - public static boolean isSameItemType( ItemStack that, ItemStack other ) + public static boolean isSameItemType( final ItemStack that, final ItemStack other ) { if( that != null && other != null && that.getItem() == other.getItem() ) { @@ -2021,24 +2021,24 @@ public class Platform return false; } - public static boolean isSameItem( @Nullable ItemStack left, @Nullable ItemStack right ) + public static boolean isSameItem( @Nullable final ItemStack left, @Nullable final ItemStack right ) { return left != null && right != null && left.isItemEqual( right ); } - public static ItemStack cloneItemStack( ItemStack a ) + public static ItemStack cloneItemStack( final ItemStack a ) { return a.copy(); } - public static ItemStack getContainerItem( ItemStack stackInSlot ) + public static ItemStack getContainerItem( final ItemStack stackInSlot ) { if( stackInSlot == null ) { return null; } - Item i = stackInSlot.getItem(); + final Item i = stackInSlot.getItem(); if( i == null || !i.hasContainerItem( stackInSlot ) ) { if( stackInSlot.stackSize > 1 ) @@ -2058,7 +2058,7 @@ public class Platform return ci; } - public static void notifyBlocksOfNeighbors( World worldObj, BlockPos pos ) + public static void notifyBlocksOfNeighbors( final World worldObj, final BlockPos pos ) { if( !worldObj.isRemote ) { @@ -2066,7 +2066,7 @@ public class Platform } } - public static boolean canRepair( AEFeature type, ItemStack a, ItemStack b ) + public static boolean canRepair( final AEFeature type, final ItemStack a, final ItemStack b ) { if( b == null || a == null ) { @@ -2088,11 +2088,11 @@ public class Platform return false; } - public static Object findPreferred( ItemStack[] is ) + public static Object findPreferred( final ItemStack[] is ) { final IParts parts = AEApi.instance().definitions().parts(); - for( ItemStack stack : is ) + for( final ItemStack stack : is ) { if( parts.cableGlass().sameAs( AEColor.Transparent, stack ) ) { @@ -2118,12 +2118,12 @@ public class Platform return is; } - public static void sendChunk( Chunk c, int verticalBits ) + public static void sendChunk( final Chunk c, final int verticalBits ) { try { - WorldServer ws = (WorldServer) c.getWorld(); - PlayerManager pm = ws.getPlayerManager(); + final WorldServer ws = (WorldServer) c.getWorld(); + final PlayerManager pm = ws.getPlayerManager(); if( getOrCreateChunkWatcher == null ) { @@ -2132,7 +2132,7 @@ public class Platform if( getOrCreateChunkWatcher != null ) { - Object playerInstance = getOrCreateChunkWatcher.invoke( pm, c.xPosition, c.zPosition, false ); + final Object playerInstance = getOrCreateChunkWatcher.invoke( pm, c.xPosition, c.zPosition, false ); if( playerInstance != null ) { Platform.playerInstance = playerInstance.getClass(); @@ -2149,13 +2149,13 @@ public class Platform } } } - catch( Throwable t ) + catch( final Throwable t ) { AELog.error( t ); } } - public static AxisAlignedBB getPrimaryBox( AEPartLocation side, int facadeThickness ) + public static AxisAlignedBB getPrimaryBox( final AEPartLocation side, final int facadeThickness ) { switch( side ) { @@ -2177,22 +2177,22 @@ public class Platform return AxisAlignedBB.fromBounds( 0, 0, 0, 1, 1, 1 ); } - public static float getEyeOffset( EntityPlayer player ) + public static float getEyeOffset( final EntityPlayer player ) { assert player.worldObj.isRemote : "Valid only on client"; return (float) ( player.posY + player.getEyeHeight() - player.getDefaultEyeHeight() ); } - public static void addStat( int playerID, Achievement achievement ) + public static void addStat( final int playerID, final Achievement achievement ) { - EntityPlayer p = AEApi.instance().registries().players().findPlayer( playerID ); + final EntityPlayer p = AEApi.instance().registries().players().findPlayer( playerID ); if( p != null ) { p.addStat( achievement, 1 ); } } - public static boolean isRecipePrioritized( ItemStack what ) + public static boolean isRecipePrioritized( final ItemStack what ) { final IMaterials materials = AEApi.instance().definitions().materials(); diff --git a/src/main/java/appeng/util/ReadOnlyCollection.java b/src/main/java/appeng/util/ReadOnlyCollection.java index 8cdaa062..9692e889 100644 --- a/src/main/java/appeng/util/ReadOnlyCollection.java +++ b/src/main/java/appeng/util/ReadOnlyCollection.java @@ -30,7 +30,7 @@ public class ReadOnlyCollection implements IReadOnlyCollection private final Collection c; - public ReadOnlyCollection( Collection in ) + public ReadOnlyCollection( final Collection in ) { this.c = in; } @@ -54,7 +54,7 @@ public class ReadOnlyCollection implements IReadOnlyCollection } @Override - public boolean contains( Object node ) + public boolean contains( final Object node ) { return this.c.contains( node ); } diff --git a/src/main/java/appeng/util/ReadableNumberConverter.java b/src/main/java/appeng/util/ReadableNumberConverter.java index 91ae1e19..be239165 100644 --- a/src/main/java/appeng/util/ReadableNumberConverter.java +++ b/src/main/java/appeng/util/ReadableNumberConverter.java @@ -45,7 +45,7 @@ public enum ReadableNumberConverter implements ISlimReadableNumberConverter, IWi } @Override - public String toSlimReadableForm( long number ) + public String toSlimReadableForm( final long number ) { return this.toReadableFormRestrictedByWidth( number, 3 ); } @@ -58,7 +58,7 @@ public enum ReadableNumberConverter implements ISlimReadableNumberConverter, IWi * * @return formatted number restricted by the width limitation */ - private String toReadableFormRestrictedByWidth( long number, int width ) + private String toReadableFormRestrictedByWidth( final long number, final int width ) { assert number >= 0; diff --git a/src/main/java/appeng/util/UUIDMatcher.java b/src/main/java/appeng/util/UUIDMatcher.java index 73293af6..2a6c9235 100644 --- a/src/main/java/appeng/util/UUIDMatcher.java +++ b/src/main/java/appeng/util/UUIDMatcher.java @@ -44,7 +44,7 @@ public final class UUIDMatcher * * @return true, if the potential {@link java.util.UUID} is indeed an {@link java.util.UUID} */ - public boolean isUUID( CharSequence potential ) + public boolean isUUID( final CharSequence potential ) { return PATTERN.matcher( potential ).matches(); } diff --git a/src/main/java/appeng/util/inv/AdaptorIInventory.java b/src/main/java/appeng/util/inv/AdaptorIInventory.java index 0a89a240..731a00ab 100644 --- a/src/main/java/appeng/util/inv/AdaptorIInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorIInventory.java @@ -34,21 +34,21 @@ public class AdaptorIInventory extends InventoryAdaptor private final IInventory i; private final boolean wrapperEnabled; - public AdaptorIInventory( IInventory s ) + public AdaptorIInventory( final IInventory s ) { this.i = s; this.wrapperEnabled = s instanceof IInventoryWrapper; } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( int amount, ItemStack filter, final IInventoryDestination destination ) { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); ItemStack rv = null; for( int x = 0; x < s && amount > 0; x++ ) { - ItemStack is = this.i.getStackInSlot( x ); + final ItemStack is = this.i.getStackInSlot( x ); if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { int boundAmounts = amount; @@ -83,7 +83,7 @@ public class AdaptorIInventory extends InventoryAdaptor } else { - ItemStack po = is.copy(); + final ItemStack po = is.copy(); po.stackSize -= boundAmounts; this.i.setInventorySlotContents( x, po ); this.i.markDirty(); @@ -99,14 +99,14 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( int amount, final ItemStack filter, final IInventoryDestination destination ) { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); ItemStack rv = null; for( int x = 0; x < s && amount > 0; x++ ) { - ItemStack is = this.i.getStackInSlot( x ); + final ItemStack is = this.i.getStackInSlot( x ); if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { int boundAmount = amount; @@ -140,12 +140,12 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); for( int x = 0; x < s; x++ ) { - ItemStack is = this.i.getStackInSlot( x ); + final ItemStack is = this.i.getStackInSlot( x ); if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { int newAmount = amount; @@ -171,7 +171,7 @@ public class AdaptorIInventory extends InventoryAdaptor } else { - ItemStack po = is.copy(); + final ItemStack po = is.copy(); po.stackSize -= rv.stackSize; this.i.setInventorySlotContents( x, po ); this.i.markDirty(); @@ -189,12 +189,12 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); for( int x = 0; x < s; x++ ) { - ItemStack is = this.i.getStackInSlot( x ); + final ItemStack is = this.i.getStackInSlot( x ); if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { @@ -210,7 +210,7 @@ public class AdaptorIInventory extends InventoryAdaptor if( boundAmount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = boundAmount; return rv; } @@ -220,13 +220,13 @@ public class AdaptorIInventory extends InventoryAdaptor } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { return this.addItems( toBeAdded, true ); } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { return this.addItems( toBeSimulated, false ); } @@ -234,7 +234,7 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public boolean containsItems() { - int s = this.i.getSizeInventory(); + final int s = this.i.getSizeInventory(); for( int x = 0; x < s; x++ ) { if( this.i.getStackInSlot( x ) != null ) @@ -257,26 +257,26 @@ public class AdaptorIInventory extends InventoryAdaptor * * @return the left itemstack, which could not be added */ - private ItemStack addItems( ItemStack itemsToAdd, boolean modulate ) + private ItemStack addItems( final ItemStack itemsToAdd, final boolean modulate ) { if( itemsToAdd == null || itemsToAdd.stackSize == 0 ) { return null; } - ItemStack left = itemsToAdd.copy(); - int stackLimit = itemsToAdd.getMaxStackSize(); - int perOperationLimit = Math.min( this.i.getInventoryStackLimit(), stackLimit ); - int inventorySize = this.i.getSizeInventory(); + final ItemStack left = itemsToAdd.copy(); + final int stackLimit = itemsToAdd.getMaxStackSize(); + final int perOperationLimit = Math.min( this.i.getInventoryStackLimit(), stackLimit ); + final int inventorySize = this.i.getSizeInventory(); for( int slot = 0; slot < inventorySize; slot++ ) { - ItemStack next = left.copy(); + final ItemStack next = left.copy(); next.stackSize = Math.min( perOperationLimit, next.stackSize ); if( this.i.isItemValidForSlot( slot, next ) ) { - ItemStack is = this.i.getStackInSlot( slot ); + final ItemStack is = this.i.getStackInSlot( slot ); if( is == null ) { left.stackSize -= next.stackSize; @@ -294,8 +294,8 @@ public class AdaptorIInventory extends InventoryAdaptor } else if( Platform.isSameItemPrecise( is, left ) && is.stackSize < perOperationLimit ) { - int room = perOperationLimit - is.stackSize; - int used = Math.min( left.stackSize, room ); + final int room = perOperationLimit - is.stackSize; + final int used = Math.min( left.stackSize, room ); if( modulate ) { @@ -316,7 +316,7 @@ public class AdaptorIInventory extends InventoryAdaptor return left; } - boolean canRemoveStackFromSlot( int x, ItemStack is ) + boolean canRemoveStackFromSlot( final int x, final ItemStack is ) { if( this.wrapperEnabled ) { @@ -346,7 +346,7 @@ public class AdaptorIInventory extends InventoryAdaptor @Override public ItemSlot next() { - ItemStack iss = AdaptorIInventory.this.i.getStackInSlot( this.x ); + final ItemStack iss = AdaptorIInventory.this.i.getStackInSlot( this.x ); this.is.isExtractable = AdaptorIInventory.this.canRemoveStackFromSlot( this.x, iss ); this.is.setItemStack( iss ); diff --git a/src/main/java/appeng/util/inv/AdaptorList.java b/src/main/java/appeng/util/inv/AdaptorList.java index 8a7937d7..8579933d 100644 --- a/src/main/java/appeng/util/inv/AdaptorList.java +++ b/src/main/java/appeng/util/inv/AdaptorList.java @@ -34,18 +34,18 @@ public class AdaptorList extends InventoryAdaptor private final List i; - public AdaptorList( List s ) + public AdaptorList( final List s ) { this.i = s; } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( int amount, final ItemStack filter, final IInventoryDestination destination ) { - int s = this.i.size(); + final int s = this.i.size(); for( int x = 0; x < s; x++ ) { - ItemStack is = this.i.get( x ); + final ItemStack is = this.i.get( x ); if( is != null && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { if( amount > is.stackSize ) @@ -59,7 +59,7 @@ public class AdaptorList extends InventoryAdaptor if( amount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = amount; is.stackSize -= amount; @@ -77,9 +77,9 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( int amount, final ItemStack filter, final IInventoryDestination destination ) { - for( ItemStack is : this.i ) + for( final ItemStack is : this.i ) { if( is != null && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) ) { @@ -94,7 +94,7 @@ public class AdaptorList extends InventoryAdaptor if( amount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = amount; return rv; } @@ -104,12 +104,12 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - int s = this.i.size(); + final int s = this.i.size(); for( int x = 0; x < s; x++ ) { - ItemStack is = this.i.get( x ); + final ItemStack is = this.i.get( x ); if( is != null && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { if( amount > is.stackSize ) @@ -123,7 +123,7 @@ public class AdaptorList extends InventoryAdaptor if( amount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = amount; is.stackSize -= amount; @@ -141,9 +141,9 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - for( ItemStack is : this.i ) + for( final ItemStack is : this.i ) { if( is != null && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) ) { @@ -158,7 +158,7 @@ public class AdaptorList extends InventoryAdaptor if( amount > 0 ) { - ItemStack rv = is.copy(); + final ItemStack rv = is.copy(); rv.stackSize = amount; return rv; } @@ -168,7 +168,7 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { if( toBeAdded == null ) { @@ -179,9 +179,9 @@ public class AdaptorList extends InventoryAdaptor return null; } - ItemStack left = toBeAdded.copy(); + final ItemStack left = toBeAdded.copy(); - for( ItemStack is : this.i ) + for( final ItemStack is : this.i ) { if( Platform.isSameItem( is, left ) ) { @@ -195,7 +195,7 @@ public class AdaptorList extends InventoryAdaptor } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { return null; } @@ -203,7 +203,7 @@ public class AdaptorList extends InventoryAdaptor @Override public boolean containsItems() { - for( ItemStack is : this.i ) + for( final ItemStack is : this.i ) { if( is != null ) { diff --git a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java index bd7f1e01..4bbc87b3 100644 --- a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java +++ b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java @@ -37,15 +37,15 @@ public class AdaptorPlayerHand extends InventoryAdaptor private final EntityPlayer player; - public AdaptorPlayerHand( EntityPlayer player ) + public AdaptorPlayerHand( final EntityPlayer player ) { this.player = player; } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( final int amount, final ItemStack filter, final IInventoryDestination destination ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand == null ) { return null; @@ -53,7 +53,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( filter == null || Platform.isSameItemPrecise( filter, hand ) ) { - ItemStack result = hand.copy(); + final ItemStack result = hand.copy(); result.stackSize = hand.stackSize > amount ? amount : hand.stackSize; hand.stackSize -= amount; if( hand.stackSize <= 0 ) @@ -67,10 +67,10 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( final int amount, final ItemStack filter, final IInventoryDestination destination ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand == null ) { return null; @@ -78,7 +78,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( filter == null || Platform.isSameItemPrecise( filter, hand ) ) { - ItemStack result = hand.copy(); + final ItemStack result = hand.copy(); result.stackSize = hand.stackSize > amount ? amount : hand.stackSize; return result; } @@ -87,9 +87,9 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand == null ) { return null; @@ -97,7 +97,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( filter == null || Platform.isSameItemFuzzy( filter, hand, fuzzyMode ) ) { - ItemStack result = hand.copy(); + final ItemStack result = hand.copy(); result.stackSize = hand.stackSize > amount ? amount : hand.stackSize; hand.stackSize -= amount; if( hand.stackSize <= 0 ) @@ -111,10 +111,10 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand == null ) { return null; @@ -122,7 +122,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( filter == null || Platform.isSameItemFuzzy( filter, hand, fuzzyMode ) ) { - ItemStack result = hand.copy(); + final ItemStack result = hand.copy(); result.stackSize = hand.stackSize > amount ? amount : hand.stackSize; return result; } @@ -131,7 +131,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { if( toBeAdded == null ) @@ -151,7 +151,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor return toBeAdded; } - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( hand != null && !Platform.isSameItemPrecise( toBeAdded, hand ) ) { @@ -174,7 +174,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( newHand.stackSize > newHand.getMaxStackSize() ) { newHand.stackSize = newHand.getMaxStackSize(); - ItemStack B = toBeAdded.copy(); + final ItemStack B = toBeAdded.copy(); B.stackSize -= newHand.stackSize - original; this.player.inventory.setItemStack( newHand ); return B; @@ -185,9 +185,9 @@ public class AdaptorPlayerHand extends InventoryAdaptor } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { - ItemStack hand = this.player.inventory.getItemStack(); + final ItemStack hand = this.player.inventory.getItemStack(); if( toBeSimulated == null ) { return null; @@ -214,7 +214,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor if( newHand.stackSize > newHand.getMaxStackSize() ) { newHand.stackSize = newHand.getMaxStackSize(); - ItemStack B = toBeSimulated.copy(); + final ItemStack B = toBeSimulated.copy(); B.stackSize -= newHand.stackSize - original; return B; } diff --git a/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java b/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java index c491620d..fd410e22 100644 --- a/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java @@ -32,7 +32,7 @@ public class AdaptorPlayerInventory implements IInventory private final int min = 0; private final int size = 36; - public AdaptorPlayerInventory( IInventory playerInv, boolean swap ) + public AdaptorPlayerInventory( final IInventory playerInv, final boolean swap ) { if( swap ) @@ -52,25 +52,25 @@ public class AdaptorPlayerInventory implements IInventory } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { return this.src.getStackInSlot( var1 + this.min ); } @Override - public ItemStack decrStackSize( int var1, int var2 ) + public ItemStack decrStackSize( final int var1, final int var2 ) { return this.src.decrStackSize( this.min + var1, var2 ); } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return this.src.getStackInSlotOnClosing( this.min + var1 ); } @Override - public void setInventorySlotContents( int var1, ItemStack var2 ) + public void setInventorySlotContents( final int var1, final ItemStack var2 ) { this.src.setInventorySlotContents( var1 + this.min, var2 ); } @@ -100,27 +100,27 @@ public class AdaptorPlayerInventory implements IInventory } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return this.src.isUseableByPlayer( var1 ); } @Override public void openInventory( - EntityPlayer player ) + final EntityPlayer player ) { this.src.openInventory(player); } @Override public void closeInventory( - EntityPlayer player ) + final EntityPlayer player ) { this.src.closeInventory(player); } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return this.src.isItemValidForSlot( i, itemstack ); } @@ -133,15 +133,15 @@ public class AdaptorPlayerInventory implements IInventory @Override public int getField( - int id ) + final int id ) { return src.getField( id ); } @Override public void setField( - int id, - int value ) + final int id, + final int value ) { src.setField( id, value ); } diff --git a/src/main/java/appeng/util/inv/IMEAdaptor.java b/src/main/java/appeng/util/inv/IMEAdaptor.java index 7e652615..94656cd3 100644 --- a/src/main/java/appeng/util/inv/IMEAdaptor.java +++ b/src/main/java/appeng/util/inv/IMEAdaptor.java @@ -42,7 +42,7 @@ public class IMEAdaptor extends InventoryAdaptor final BaseActionSource src; int maxSlots = 0; - public IMEAdaptor( IMEInventory input, BaseActionSource src ) + public IMEAdaptor( final IMEInventory input, final BaseActionSource src ) { this.target = input; this.src = src; @@ -60,18 +60,18 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack removeItems( final int amount, final ItemStack filter, final IInventoryDestination destination ) { return this.doRemoveItems( amount, filter, destination, Actionable.MODULATE ); } - public ItemStack doRemoveItems( int amount, ItemStack filter, IInventoryDestination destination, Actionable type ) + public ItemStack doRemoveItems( final int amount, final ItemStack filter, final IInventoryDestination destination, final Actionable type ) { IAEItemStack req = null; if( filter == null ) { - IItemList list = this.getList(); + final IItemList list = this.getList(); if( !list.isEmpty() ) { req = list.getFirstItem(); @@ -99,13 +99,13 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination ) + public ItemStack simulateRemove( final int amount, final ItemStack filter, final IInventoryDestination destination ) { return this.doRemoveItems( amount, filter, destination, Actionable.SIMULATE ); } @Override - public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { if( filter == null ) { @@ -114,9 +114,9 @@ public class IMEAdaptor extends InventoryAdaptor return this.doRemoveItemsFuzzy( amount, filter, destination, Actionable.MODULATE, fuzzyMode ); } - public ItemStack doRemoveItemsFuzzy( int amount, ItemStack filter, IInventoryDestination destination, Actionable type, FuzzyMode fuzzyMode ) + public ItemStack doRemoveItemsFuzzy( final int amount, final ItemStack filter, final IInventoryDestination destination, final Actionable type, final FuzzyMode fuzzyMode ) { - IAEItemStack reqFilter = AEItemStack.create( filter ); + final IAEItemStack reqFilter = AEItemStack.create( filter ); if( reqFilter == null ) { return null; @@ -124,7 +124,7 @@ public class IMEAdaptor extends InventoryAdaptor IAEItemStack out = null; - for( IAEItemStack req : ImmutableList.copyOf( this.getList().findFuzzy( reqFilter, fuzzyMode ) ) ) + for( final IAEItemStack req : ImmutableList.copyOf( this.getList().findFuzzy( reqFilter, fuzzyMode ) ) ) { if( req != null ) { @@ -141,7 +141,7 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination ) + public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination ) { if( filter == null ) { @@ -151,12 +151,12 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack addItems( ItemStack toBeAdded ) + public ItemStack addItems( final ItemStack toBeAdded ) { - IAEItemStack in = AEItemStack.create( toBeAdded ); + final IAEItemStack in = AEItemStack.create( toBeAdded ); if( in != null ) { - IAEItemStack out = this.target.injectItems( in, Actionable.MODULATE, this.src ); + final IAEItemStack out = this.target.injectItems( in, Actionable.MODULATE, this.src ); if( out != null ) { return out.getItemStack(); @@ -166,12 +166,12 @@ public class IMEAdaptor extends InventoryAdaptor } @Override - public ItemStack simulateAdd( ItemStack toBeSimulated ) + public ItemStack simulateAdd( final ItemStack toBeSimulated ) { - IAEItemStack in = AEItemStack.create( toBeSimulated ); + final IAEItemStack in = AEItemStack.create( toBeSimulated ); if( in != null ) { - IAEItemStack out = this.target.injectItems( in, Actionable.SIMULATE, this.src ); + final IAEItemStack out = this.target.injectItems( in, Actionable.SIMULATE, this.src ); if( out != null ) { return out.getItemStack(); diff --git a/src/main/java/appeng/util/inv/IMEAdaptorIterator.java b/src/main/java/appeng/util/inv/IMEAdaptorIterator.java index ff06f7d6..abff1337 100644 --- a/src/main/java/appeng/util/inv/IMEAdaptorIterator.java +++ b/src/main/java/appeng/util/inv/IMEAdaptorIterator.java @@ -35,7 +35,7 @@ public final class IMEAdaptorIterator implements Iterator private int offset = 0; private boolean hasNext; - public IMEAdaptorIterator( IMEAdaptor parent, IItemList availableItems ) + public IMEAdaptorIterator( final IMEAdaptor parent, final IItemList availableItems ) { this.stack = availableItems.iterator(); this.containerSize = parent.maxSlots; @@ -63,7 +63,7 @@ public final class IMEAdaptorIterator implements Iterator if( this.hasNext ) { - IAEItemStack item = this.stack.next(); + final IAEItemStack item = this.stack.next(); this.slot.setAEItemStack( item ); return this.slot; } diff --git a/src/main/java/appeng/util/inv/IMEInventoryDestination.java b/src/main/java/appeng/util/inv/IMEInventoryDestination.java index dd53bc22..5d8e1b5c 100644 --- a/src/main/java/appeng/util/inv/IMEInventoryDestination.java +++ b/src/main/java/appeng/util/inv/IMEInventoryDestination.java @@ -31,13 +31,13 @@ public class IMEInventoryDestination implements IInventoryDestination final IMEInventory me; - public IMEInventoryDestination( IMEInventory o ) + public IMEInventoryDestination( final IMEInventory o ) { this.me = o; } @Override - public boolean canInsert( ItemStack stack ) + public boolean canInsert( final ItemStack stack ) { if( stack == null ) @@ -45,7 +45,7 @@ public class IMEInventoryDestination implements IInventoryDestination return false; } - IAEItemStack failed = this.me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null ); + final IAEItemStack failed = this.me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null ); if( failed == null ) { diff --git a/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java b/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java index c17841fb..d361da08 100644 --- a/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java +++ b/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java @@ -32,7 +32,7 @@ public class ItemListIgnoreCrafting implements IItemList final IItemList target; - public ItemListIgnoreCrafting( IItemList cla ) + public ItemListIgnoreCrafting( final IItemList cla ) { this.target = cla; } @@ -50,13 +50,13 @@ public class ItemListIgnoreCrafting implements IItemList } @Override - public T findPrecise( T i ) + public T findPrecise( final T i ) { return this.target.findPrecise( i ); } @Override - public Collection findFuzzy( T input, FuzzyMode fuzzy ) + public Collection findFuzzy( final T input, final FuzzyMode fuzzy ) { return this.target.findFuzzy( input, fuzzy ); } @@ -68,19 +68,19 @@ public class ItemListIgnoreCrafting implements IItemList } @Override - public void addStorage( T option ) + public void addStorage( final T option ) { this.target.addStorage( option ); } @Override - public void addCrafting( T option ) + public void addCrafting( final T option ) { // nothing. } @Override - public void addRequestable( T option ) + public void addRequestable( final T option ) { this.target.addRequestable( option ); } diff --git a/src/main/java/appeng/util/inv/ItemSlot.java b/src/main/java/appeng/util/inv/ItemSlot.java index 83534822..bfc8fad1 100644 --- a/src/main/java/appeng/util/inv/ItemSlot.java +++ b/src/main/java/appeng/util/inv/ItemSlot.java @@ -38,7 +38,7 @@ public class ItemSlot return this.itemStack == null ? ( this.aeItemStack == null ? null : ( this.itemStack = this.aeItemStack.getItemStack() ) ) : this.itemStack; } - public void setItemStack( ItemStack is ) + public void setItemStack( final ItemStack is ) { this.aeItemStack = null; this.itemStack = is; @@ -49,7 +49,7 @@ public class ItemSlot return this.aeItemStack == null ? ( this.itemStack == null ? null : ( this.aeItemStack = AEItemStack.create( this.itemStack ) ) ) : this.aeItemStack; } - public void setAEItemStack( IAEItemStack is ) + public void setAEItemStack( final IAEItemStack is ) { this.aeItemStack = is; this.itemStack = null; diff --git a/src/main/java/appeng/util/inv/WrapperBCPipe.java b/src/main/java/appeng/util/inv/WrapperBCPipe.java index 33d9fc0b..237f676a 100644 --- a/src/main/java/appeng/util/inv/WrapperBCPipe.java +++ b/src/main/java/appeng/util/inv/WrapperBCPipe.java @@ -37,7 +37,7 @@ public class WrapperBCPipe implements IInventory private final TileEntity ad; private final EnumFacing dir; - public WrapperBCPipe( TileEntity te, EnumFacing d ) + public WrapperBCPipe( final TileEntity te, final EnumFacing d ) { this.bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport ); this.ad = te; @@ -51,25 +51,25 @@ public class WrapperBCPipe implements IInventory } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return null; } @Override - public ItemStack decrStackSize( int i, int j ) + public ItemStack decrStackSize( final int i, final int j ) { return null; } @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 ) { if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) ) { @@ -90,37 +90,37 @@ public class WrapperBCPipe implements IInventory } @Override - public void openInventory( EntityPlayer player ) + public void openInventory( final EntityPlayer player ) { } @Override - public void closeInventory( EntityPlayer player ) + public void closeInventory( final EntityPlayer player ) { } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return false; } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return this.bc.canAddItemsToPipe( this.ad, itemstack, this.dir ); } @Override - public int getField( int id ) + public int getField( final int id ) { return 0; } @Override - public void setField( int id, int value ) + public void setField( final int id, final int value ) { } diff --git a/src/main/java/appeng/util/inv/WrapperChainedInventory.java b/src/main/java/appeng/util/inv/WrapperChainedInventory.java index f0ddcd01..77449238 100644 --- a/src/main/java/appeng/util/inv/WrapperChainedInventory.java +++ b/src/main/java/appeng/util/inv/WrapperChainedInventory.java @@ -39,12 +39,12 @@ public class WrapperChainedInventory implements IInventory private List l; private Map offsets; - public WrapperChainedInventory( IInventory... inventories ) + public WrapperChainedInventory( final IInventory... inventories ) { this.setInventory( inventories ); } - public void setInventory( IInventory... a ) + public void setInventory( final IInventory... a ) { this.l = ImmutableList.copyOf( a ); this.calculateSizes(); @@ -55,9 +55,9 @@ public class WrapperChainedInventory implements IInventory this.offsets = new HashMap(); int offset = 0; - for( IInventory in : this.l ) + for( final IInventory in : this.l ) { - InvOffset io = new InvOffset(); + final InvOffset io = new InvOffset(); io.offset = offset; io.size = in.getSizeInventory(); io.i = in; @@ -73,12 +73,12 @@ public class WrapperChainedInventory implements IInventory this.fullSize = offset; } - public WrapperChainedInventory( List inventories ) + public WrapperChainedInventory( final List inventories ) { this.setInventory( inventories ); } - public void setInventory( List a ) + public void setInventory( final List a ) { this.l = a; this.calculateSizes(); @@ -88,7 +88,7 @@ public class WrapperChainedInventory implements IInventory { if( this.l.size() > 1 ) { - List newOrder = new ArrayList( this.l.size() ); + final List newOrder = new ArrayList( this.l.size() ); newOrder.add( this.l.get( this.l.size() - 1 ) ); for( int x = 0; x < this.l.size() - 1; x++ ) { @@ -98,9 +98,9 @@ public class WrapperChainedInventory implements IInventory } } - public IInventory getInv( int idx ) + public IInventory getInv( final int idx ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i; @@ -108,9 +108,9 @@ public class WrapperChainedInventory implements IInventory return null; } - public int getInvSlot( int idx ) + public int getInvSlot( final int idx ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return idx - io.offset; @@ -125,9 +125,9 @@ public class WrapperChainedInventory implements IInventory } @Override - public ItemStack getStackInSlot( int idx ) + public ItemStack getStackInSlot( final int idx ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i.getStackInSlot( idx - io.offset ); @@ -136,9 +136,9 @@ public class WrapperChainedInventory implements IInventory } @Override - public ItemStack decrStackSize( int idx, int var2 ) + public ItemStack decrStackSize( final int idx, final int var2 ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i.decrStackSize( idx - io.offset, var2 ); @@ -147,9 +147,9 @@ public class WrapperChainedInventory implements IInventory } @Override - public ItemStack getStackInSlotOnClosing( int idx ) + public ItemStack getStackInSlotOnClosing( final int idx ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i.getStackInSlotOnClosing( idx - io.offset ); @@ -158,9 +158,9 @@ public class WrapperChainedInventory implements IInventory } @Override - public void setInventorySlotContents( int idx, ItemStack var2 ) + public void setInventorySlotContents( final int idx, final ItemStack var2 ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { io.i.setInventorySlotContents( idx - io.offset, var2 ); @@ -184,7 +184,7 @@ public class WrapperChainedInventory implements IInventory { int smallest = 64; - for( IInventory i : this.l ) + for( final IInventory i : this.l ) { smallest = Math.min( smallest, i.getInventoryStackLimit() ); } @@ -195,34 +195,34 @@ public class WrapperChainedInventory implements IInventory @Override public void markDirty() { - for( IInventory i : this.l ) + for( final IInventory i : this.l ) { i.markDirty(); } } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { 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 idx, ItemStack itemstack ) + public boolean isItemValidForSlot( final int idx, final ItemStack itemstack ) { - InvOffset io = this.offsets.get( idx ); + final InvOffset io = this.offsets.get( idx ); if( io != null ) { return io.i.isItemValidForSlot( idx - io.offset, itemstack ); @@ -246,15 +246,15 @@ public class WrapperChainedInventory 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 ) { } diff --git a/src/main/java/appeng/util/inv/WrapperInvSlot.java b/src/main/java/appeng/util/inv/WrapperInvSlot.java index 10bc322c..80ab02dd 100644 --- a/src/main/java/appeng/util/inv/WrapperInvSlot.java +++ b/src/main/java/appeng/util/inv/WrapperInvSlot.java @@ -30,17 +30,17 @@ public class WrapperInvSlot private final IInventory inv; - public WrapperInvSlot( IInventory inv ) + public WrapperInvSlot( final IInventory inv ) { this.inv = inv; } - public IInventory getWrapper( int slot ) + public IInventory getWrapper( final int slot ) { return new InternalInterfaceWrapper( this.inv, slot ); } - protected boolean isItemValid( ItemStack itemstack ) + protected boolean isItemValid( final ItemStack itemstack ) { return true; } @@ -51,7 +51,7 @@ public class WrapperInvSlot private final IInventory inv; private final int slot; - public InternalInterfaceWrapper( IInventory target, int slot ) + public InternalInterfaceWrapper( final IInventory target, final int slot ) { this.inv = target; this.slot = slot; @@ -64,25 +64,25 @@ public class WrapperInvSlot } @Override - public ItemStack getStackInSlot( int i ) + public ItemStack getStackInSlot( final int i ) { return this.inv.getStackInSlot( this.slot ); } @Override - public ItemStack decrStackSize( int i, int num ) + public ItemStack decrStackSize( final int i, final int num ) { return this.inv.decrStackSize( this.slot, num ); } @Override - public ItemStack getStackInSlotOnClosing( int i ) + public ItemStack getStackInSlotOnClosing( final int i ) { return this.inv.getStackInSlotOnClosing( this.slot ); } @Override - public void setInventorySlotContents( int i, ItemStack itemstack ) + public void setInventorySlotContents( final int i, final ItemStack itemstack ) { this.inv.setInventorySlotContents( this.slot, itemstack ); } @@ -100,7 +100,7 @@ public class WrapperInvSlot } @Override - public boolean isUseableByPlayer( EntityPlayer entityplayer ) + public boolean isUseableByPlayer( final EntityPlayer entityplayer ) { return this.inv.isUseableByPlayer( entityplayer ); } @@ -119,14 +119,14 @@ public class WrapperInvSlot @Override public void openInventory( - EntityPlayer player ) + final EntityPlayer player ) { this.inv.openInventory(player); } @Override public void closeInventory( - EntityPlayer player ) + final EntityPlayer player ) { this.inv.closeInventory(player); } @@ -139,7 +139,7 @@ public class WrapperInvSlot @Override public int getField( - int id ) + final int id ) { return inv.getField( id ); } @@ -151,7 +151,7 @@ public class WrapperInvSlot } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { return WrapperInvSlot.this.isItemValid( itemstack ) && this.inv.isItemValidForSlot( this.slot, itemstack ); } @@ -164,8 +164,8 @@ public class WrapperInvSlot @Override public void setField( - int id, - int value ) + final int id, + final int value ) { inv.setField( id, value ); } diff --git a/src/main/java/appeng/util/inv/WrapperInventoryRange.java b/src/main/java/appeng/util/inv/WrapperInventoryRange.java index 51e865b1..d359af37 100644 --- a/src/main/java/appeng/util/inv/WrapperInventoryRange.java +++ b/src/main/java/appeng/util/inv/WrapperInventoryRange.java @@ -32,7 +32,7 @@ public class WrapperInventoryRange implements IInventory protected boolean ignoreValidItems = false; int[] slots; - public WrapperInventoryRange( IInventory a, int[] s, boolean ignoreValid ) + public WrapperInventoryRange( final IInventory a, final int[] s, final boolean ignoreValid ) { this.src = a; this.slots = s; @@ -45,7 +45,7 @@ public class WrapperInventoryRange implements IInventory this.ignoreValidItems = ignoreValid; } - public WrapperInventoryRange( IInventory a, int min, int size, boolean ignoreValid ) + public WrapperInventoryRange( final IInventory a, final int min, final int size, final boolean ignoreValid ) { this.src = a; this.slots = new int[size]; @@ -56,12 +56,12 @@ public class WrapperInventoryRange implements IInventory this.ignoreValidItems = ignoreValid; } - public static String concatLines( int[] s, String separator ) + public static String concatLines( final int[] s, final String separator ) { if( s.length > 0 ) { - StringBuilder sb = new StringBuilder(); - for( int value : s ) + final StringBuilder sb = new StringBuilder(); + for( final int value : s ) { if( sb.length() > 0 ) { @@ -81,25 +81,25 @@ public class WrapperInventoryRange implements IInventory } @Override - public ItemStack getStackInSlot( int var1 ) + public ItemStack getStackInSlot( final int var1 ) { return this.src.getStackInSlot( this.slots[var1] ); } @Override - public ItemStack decrStackSize( int var1, int var2 ) + public ItemStack decrStackSize( final int var1, final int var2 ) { return this.src.decrStackSize( this.slots[var1], var2 ); } @Override - public ItemStack getStackInSlotOnClosing( int var1 ) + public ItemStack getStackInSlotOnClosing( final int var1 ) { return this.src.getStackInSlotOnClosing( this.slots[var1] ); } @Override - public void setInventorySlotContents( int var1, ItemStack var2 ) + public void setInventorySlotContents( final int var1, final ItemStack var2 ) { this.src.setInventorySlotContents( this.slots[var1], var2 ); } @@ -117,7 +117,7 @@ public class WrapperInventoryRange implements IInventory } @Override - public boolean isUseableByPlayer( EntityPlayer var1 ) + public boolean isUseableByPlayer( final EntityPlayer var1 ) { return this.src.isUseableByPlayer( var1 ); } @@ -136,14 +136,14 @@ public class WrapperInventoryRange implements IInventory @Override public void openInventory( - EntityPlayer player ) + final EntityPlayer player ) { this.src.openInventory(player); } @Override public void closeInventory( - EntityPlayer player ) + final EntityPlayer player ) { this.src.closeInventory(player); } @@ -156,7 +156,7 @@ public class WrapperInventoryRange implements IInventory @Override public int getField( - int id ) + final int id ) { return src.getField( id ); } @@ -175,13 +175,13 @@ public class WrapperInventoryRange implements IInventory @Override public void setField( - int id, - int value ) + final int id, + final int value ) { src.setField( id, value ); } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( this.ignoreValidItems ) { diff --git a/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java b/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java index 038ac56c..2093f134 100644 --- a/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java +++ b/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java @@ -30,7 +30,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I final ISidedInventory side; private final EnumFacing dir; - public WrapperMCISidedInventory( ISidedInventory a, EnumFacing d ) + public WrapperMCISidedInventory( final ISidedInventory a, final EnumFacing d ) { super( a, a.getSlotsForFace( d ), false ); this.side = a; @@ -38,7 +38,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I } @Override - public ItemStack decrStackSize( int var1, int var2 ) + public ItemStack decrStackSize( final int var1, final int var2 ) { if( this.canRemoveItemFromSlot( var1, this.getStackInSlot( var1 ) ) ) { @@ -48,7 +48,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I } @Override - public boolean isItemValidForSlot( int i, ItemStack itemstack ) + public boolean isItemValidForSlot( final int i, final ItemStack itemstack ) { if( this.ignoreValidItems ) @@ -65,7 +65,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I } @Override - public boolean canRemoveItemFromSlot( int i, ItemStack is ) + public boolean canRemoveItemFromSlot( final int i, final ItemStack is ) { if( is == null ) { diff --git a/src/main/java/appeng/util/item/AEFluidStack.java b/src/main/java/appeng/util/item/AEFluidStack.java index b7c2eb8a..701e73fe 100644 --- a/src/main/java/appeng/util/item/AEFluidStack.java +++ b/src/main/java/appeng/util/item/AEFluidStack.java @@ -51,7 +51,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu Fluid fluid; private IAETagCompound tagCompound; - private AEFluidStack( AEFluidStack is ) + private AEFluidStack( final AEFluidStack is ) { this.fluid = is.fluid; @@ -64,7 +64,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu this.myHash = is.myHash; } - private AEFluidStack( @Nonnull FluidStack is ) + private AEFluidStack( @Nonnull final FluidStack is ) { this.fluid = is.getFluid(); @@ -80,14 +80,14 @@ public final class AEFluidStack extends AEStack implements IAEFlu this.myHash = this.fluid.hashCode() ^ ( this.tagCompound == null ? 0 : System.identityHashCode( this.tagCompound ) ); } - public static IAEFluidStack loadFluidStackFromNBT( NBTTagCompound i ) + public static IAEFluidStack loadFluidStackFromNBT( final NBTTagCompound i ) { - ItemStack itemstack = ItemStack.loadItemStackFromNBT( i ); + final ItemStack itemstack = ItemStack.loadItemStackFromNBT( i ); if( itemstack == null ) { return null; } - AEFluidStack fluid = AEFluidStack.create( itemstack ); + final AEFluidStack fluid = AEFluidStack.create( itemstack ); // fluid.priority = i.getInteger( "Priority" ); fluid.stackSize = i.getLong( "Cnt" ); fluid.setCountRequestable( i.getLong( "Req" ) ); @@ -95,7 +95,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu return fluid; } - public static AEFluidStack create( Object a ) + public static AEFluidStack create( final Object a ) { if( a == null ) { @@ -112,20 +112,20 @@ public final class AEFluidStack extends AEStack implements IAEFlu return null; } - public static IAEFluidStack loadFluidStackFromPacket( ByteBuf data ) throws IOException + public static IAEFluidStack loadFluidStackFromPacket( final ByteBuf data ) throws IOException { - byte mask = data.readByte(); + final byte mask = data.readByte(); // byte PriorityType = (byte) (mask & 0x03); - byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); - byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); - boolean isCraftable = ( mask & 0x40 ) > 0; - boolean hasTagCompound = ( mask & 0x80 ) > 0; + final byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); + final byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); + final boolean isCraftable = ( mask & 0x40 ) > 0; + final boolean hasTagCompound = ( mask & 0x80 ) > 0; // don't send this... - NBTTagCompound d = new NBTTagCompound(); + final NBTTagCompound d = new NBTTagCompound(); - byte len2 = data.readByte(); - byte[] name = new byte[len2]; + final byte len2 = data.readByte(); + final byte[] name = new byte[len2]; data.readBytes( name, 0, len2 ); d.setString( "FluidName", new String( name, "UTF-8" ) ); @@ -133,26 +133,26 @@ public final class AEFluidStack extends AEStack implements IAEFlu if( hasTagCompound ) { - int len = data.readInt(); + final int len = data.readInt(); - byte[] bd = new byte[len]; + final byte[] bd = new byte[len]; data.readBytes( bd ); - DataInputStream di = new DataInputStream( new ByteArrayInputStream( bd ) ); + final DataInputStream di = new DataInputStream( new ByteArrayInputStream( bd ) ); d.setTag( "tag", CompressedStreamTools.read( di ) ); } // long priority = getPacketValue( PriorityType, data ); - long stackSize = getPacketValue( stackType, data ); - long countRequestable = getPacketValue( countReqType, data ); + final long stackSize = getPacketValue( stackType, data ); + final long countRequestable = getPacketValue( countReqType, data ); - FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( d ); + final FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( d ); if( fluidStack == null ) { return null; } - AEFluidStack fluid = AEFluidStack.create( fluidStack ); + final AEFluidStack fluid = AEFluidStack.create( fluidStack ); // fluid.priority = (int) priority; fluid.stackSize = stackSize; fluid.setCountRequestable( countRequestable ); @@ -161,7 +161,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public void add( IAEFluidStack option ) + public void add( final IAEFluidStack option ) { if( option == null ) { @@ -177,7 +177,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public void writeToNBT( NBTTagCompound i ) + public void writeToNBT( final NBTTagCompound i ) { /* * Mojang Fucked this over ; GC Optimization - Ugly Yes, but it saves a lot in the memory department. @@ -226,7 +226,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public boolean fuzzyComparison( Object st, FuzzyMode mode ) + public boolean fuzzyComparison( final Object st, final FuzzyMode mode ) { if( st instanceof FluidStack ) { @@ -250,7 +250,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override public IAEFluidStack empty() { - IAEFluidStack dup = this.copy(); + final IAEFluidStack dup = this.copy(); dup.reset(); return dup; } @@ -280,9 +280,9 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public int compareTo( AEFluidStack b ) + public int compareTo( final AEFluidStack b ) { - int diff = this.hashCode() - b.hashCode(); + final int diff = this.hashCode() - b.hashCode(); return diff > 0 ? 1 : ( diff < 0 ? -1 : 0 ); } @@ -293,7 +293,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu } @Override - public boolean equals( Object ia ) + public boolean equals( final Object ia ) { if( ia instanceof AEFluidStack ) { @@ -301,12 +301,12 @@ public final class AEFluidStack extends AEStack implements IAEFlu } else if( ia instanceof FluidStack ) { - FluidStack is = (FluidStack) ia; + final FluidStack is = (FluidStack) ia; if( is.getFluidID() == this.fluid.getID() ) { - NBTTagCompound ta = (NBTTagCompound) this.tagCompound; - NBTTagCompound tb = is.tag; + final NBTTagCompound ta = (NBTTagCompound) this.tagCompound; + final NBTTagCompound tb = is.tag; if( ta == tb ) { return true; @@ -346,7 +346,7 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override public FluidStack getFluidStack() { - FluidStack is = new FluidStack( this.fluid, (int) Math.min( Integer.MAX_VALUE, this.stackSize ) ); + final FluidStack is = new FluidStack( this.fluid, (int) Math.min( Integer.MAX_VALUE, this.stackSize ) ); if( this.tagCompound != null ) { is.tag = this.tagCompound.getNBTTagCompoundCopy(); @@ -364,25 +364,25 @@ public final class AEFluidStack extends AEStack implements IAEFlu @Override - void writeIdentity( ByteBuf i ) throws IOException + void writeIdentity( final ByteBuf i ) throws IOException { - byte[] name = this.fluid.getName().getBytes( "UTF-8" ); + final byte[] name = this.fluid.getName().getBytes( "UTF-8" ); i.writeByte( (byte) name.length ); i.writeBytes( name ); } @Override - void readNBT( ByteBuf i ) throws IOException + void readNBT( final ByteBuf i ) throws IOException { if( this.hasTagCompound() ) { - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream( bytes ); + final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + final DataOutputStream data = new DataOutputStream( bytes ); CompressedStreamTools.write( (NBTTagCompound) this.tagCompound, data ); - byte[] tagBytes = bytes.toByteArray(); - int size = tagBytes.length; + final byte[] tagBytes = bytes.toByteArray(); + final int size = tagBytes.length; i.writeInt( size ); i.writeBytes( tagBytes ); diff --git a/src/main/java/appeng/util/item/AEItemDef.java b/src/main/java/appeng/util/item/AEItemDef.java index 02ee2fd6..0380be6a 100644 --- a/src/main/java/appeng/util/item/AEItemDef.java +++ b/src/main/java/appeng/util/item/AEItemDef.java @@ -51,7 +51,7 @@ public class AEItemDef public UniqueIdentifier uniqueID; public OreReference isOre; - public AEItemDef( Item it ) + public AEItemDef( final Item it ) { this.item = it; this.itemID = Item.getIdFromItem( it ); @@ -59,7 +59,7 @@ public class AEItemDef public AEItemDef copy() { - AEItemDef t = new AEItemDef( this.item ); + final AEItemDef t = new AEItemDef( this.item ); t.def = this.def; t.damageValue = this.damageValue; t.displayDamage = this.displayDamage; @@ -70,7 +70,7 @@ public class AEItemDef } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -80,14 +80,14 @@ public class AEItemDef { return false; } - AEItemDef other = (AEItemDef) obj; + final AEItemDef other = (AEItemDef) obj; return other.damageValue == this.damageValue && other.item == this.item && this.tagCompound == other.tagCompound; } - public boolean isItem( ItemStack otherStack ) + public boolean isItem( final ItemStack otherStack ) { // hackery! - int dmg = this.getDamageValueHack( otherStack ); + final int dmg = this.getDamageValueHack( otherStack ); if( this.item == otherStack.getItem() && dmg == this.damageValue ) { @@ -106,7 +106,7 @@ public class AEItemDef return false; } - public int getDamageValueHack( ItemStack is ) + public int getDamageValueHack( final ItemStack is ) { return Items.blaze_rod.getDamage( is ); } diff --git a/src/main/java/appeng/util/item/AEItemStack.java b/src/main/java/appeng/util/item/AEItemStack.java index 08561368..7363d5ff 100644 --- a/src/main/java/appeng/util/item/AEItemStack.java +++ b/src/main/java/appeng/util/item/AEItemStack.java @@ -51,7 +51,7 @@ public final class AEItemStack extends AEStack implements IAEItemS AEItemDef def; - private AEItemStack( AEItemStack is ) + private AEItemStack( final AEItemStack is ) { this.def = is.def; this.stackSize = is.stackSize; @@ -59,7 +59,7 @@ public final class AEItemStack extends AEStack implements IAEItemS this.setCountRequestable( is.getCountRequestable() ); } - private AEItemStack( ItemStack is ) + private AEItemStack( final ItemStack is ) { if( is == null ) { @@ -96,7 +96,7 @@ public final class AEItemStack extends AEStack implements IAEItemS this.def.displayDamage = ( int ) ( is.getItem().getDurabilityForDisplay( is ) * Integer.MAX_VALUE ); this.def.maxDamage = is.getMaxDamage(); - NBTTagCompound tagCompound = is.getTagCompound(); + final NBTTagCompound tagCompound = is.getTagCompound(); if( tagCompound != null ) { this.def.tagCompound = (AESharedNBT) AESharedNBT.getSharedTagCompound( tagCompound, is ); @@ -110,20 +110,20 @@ public final class AEItemStack extends AEStack implements IAEItemS this.def.isOre = OreHelper.INSTANCE.isOre( is ); } - public static IAEItemStack loadItemStackFromNBT( NBTTagCompound i ) + public static IAEItemStack loadItemStackFromNBT( final NBTTagCompound i ) { if( i == null ) { return null; } - ItemStack itemstack = ItemStack.loadItemStackFromNBT( i ); + final ItemStack itemstack = ItemStack.loadItemStackFromNBT( i ); if( itemstack == null ) { return null; } - AEItemStack item = AEItemStack.create( itemstack ); + final AEItemStack item = AEItemStack.create( itemstack ); // item.priority = i.getInteger( "Priority" ); item.stackSize = i.getLong( "Cnt" ); item.setCountRequestable( i.getLong( "Req" ) ); @@ -132,7 +132,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Nullable - public static AEItemStack create( ItemStack stack ) + public static AEItemStack create( final ItemStack stack ) { if( stack == null ) { @@ -142,17 +142,17 @@ public final class AEItemStack extends AEStack implements IAEItemS return new AEItemStack( stack ); } - public static IAEItemStack loadItemStackFromPacket( ByteBuf data ) throws IOException + public static IAEItemStack loadItemStackFromPacket( final ByteBuf data ) throws IOException { - byte mask = data.readByte(); + final byte mask = data.readByte(); // byte PriorityType = (byte) (mask & 0x03); - byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); - byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); - boolean isCraftable = ( mask & 0x40 ) > 0; - boolean hasTagCompound = ( mask & 0x80 ) > 0; + final byte stackType = (byte) ( ( mask & 0x0C ) >> 2 ); + final byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 ); + final boolean isCraftable = ( mask & 0x40 ) > 0; + final boolean hasTagCompound = ( mask & 0x80 ) > 0; // don't send this... - NBTTagCompound d = new NBTTagCompound(); + final NBTTagCompound d = new NBTTagCompound(); d.setShort( "id", data.readShort() ); d.setShort( "Damage", data.readShort() ); @@ -160,26 +160,26 @@ public final class AEItemStack extends AEStack implements IAEItemS if( hasTagCompound ) { - int len = data.readInt(); + final int len = data.readInt(); - byte[] bd = new byte[len]; + final byte[] bd = new byte[len]; data.readBytes( bd ); - ByteArrayInputStream di = new ByteArrayInputStream( bd ); + final ByteArrayInputStream di = new ByteArrayInputStream( bd ); d.setTag( "tag", CompressedStreamTools.read( new DataInputStream( di ) ) ); } // long priority = getPacketValue( PriorityType, data ); - long stackSize = getPacketValue( stackType, data ); - long countRequestable = getPacketValue( countReqType, data ); + final long stackSize = getPacketValue( stackType, data ); + final long countRequestable = getPacketValue( countReqType, data ); - ItemStack itemstack = ItemStack.loadItemStackFromNBT( d ); + final ItemStack itemstack = ItemStack.loadItemStackFromNBT( d ); if( itemstack == null ) { return null; } - AEItemStack item = AEItemStack.create( itemstack ); + final AEItemStack item = AEItemStack.create( itemstack ); // item.priority = (int) priority; item.stackSize = stackSize; item.setCountRequestable( countRequestable ); @@ -188,7 +188,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public void add( IAEItemStack option ) + public void add( final IAEItemStack option ) { if( option == null ) { @@ -204,7 +204,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public void writeToNBT( NBTTagCompound i ) + public void writeToNBT( final NBTTagCompound i ) { /* * Mojang Fucked this over ; GC Optimization - Ugly Yes, but it saves a lot in the memory department. @@ -258,11 +258,11 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public boolean fuzzyComparison( Object st, FuzzyMode mode ) + public boolean fuzzyComparison( final Object st, final FuzzyMode mode ) { if( st instanceof IAEItemStack ) { - IAEItemStack o = (IAEItemStack) st; + final IAEItemStack o = (IAEItemStack) st; if( this.sameOre( o ) ) { @@ -273,8 +273,8 @@ public final class AEItemStack extends AEStack implements IAEItemS { if( this.def.item.isDamageable() ) { - ItemStack a = this.getItemStack(); - ItemStack b = o.getItemStack(); + final ItemStack a = this.getItemStack(); + final ItemStack b = o.getItemStack(); try { @@ -284,23 +284,23 @@ public final class AEItemStack extends AEStack implements IAEItemS } else if( mode == FuzzyMode.PERCENT_99 ) { - Item ai = a.getItem(); - Item bi = b.getItem(); + final Item ai = a.getItem(); + final Item bi = b.getItem(); return ( ai.getDurabilityForDisplay( a ) < 0.001f ) == ( bi.getDurabilityForDisplay( b ) < 0.001f ); } else { - Item ai = a.getItem(); - Item bi = b.getItem(); + final Item ai = a.getItem(); + final Item bi = b.getItem(); - float percentDamageOfA = 1.0f - (float) ai.getDurabilityForDisplay(a); - float percentDamageOfB = 1.0f - (float) bi.getDurabilityForDisplay(b); + final float percentDamageOfA = 1.0f - (float) ai.getDurabilityForDisplay(a); + final float percentDamageOfB = 1.0f - (float) bi.getDurabilityForDisplay(b); return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } } - catch( Throwable e ) + catch( final Throwable e ) { if( mode == FuzzyMode.IGNORE_ALL ) { @@ -312,8 +312,8 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); - float percentDamageOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); + final float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); + final float percentDamageOfB = (float) b.getItemDamage() / (float) b.getMaxDamage(); return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } @@ -326,7 +326,7 @@ public final class AEItemStack extends AEStack implements IAEItemS if( st instanceof ItemStack ) { - ItemStack o = (ItemStack) st; + final ItemStack o = (ItemStack) st; OreHelper.INSTANCE.sameOre( this, o ); @@ -334,7 +334,7 @@ public final class AEItemStack extends AEStack implements IAEItemS { if( this.def.item.isDamageable() ) { - ItemStack a = this.getItemStack(); + final ItemStack a = this.getItemStack(); try { @@ -344,23 +344,23 @@ public final class AEItemStack extends AEStack implements IAEItemS } else if( mode == FuzzyMode.PERCENT_99 ) { - Item ai = a.getItem(); - Item bi = o.getItem(); + final Item ai = a.getItem(); + final Item bi = o.getItem(); return ( ai.getDurabilityForDisplay( a ) < 0.001f ) == ( bi.getDurabilityForDisplay( o ) < 0.001f ); } else { - Item ai = a.getItem(); - Item bi = o.getItem(); + final Item ai = a.getItem(); + final Item bi = o.getItem(); - float percentDamageOfA = 1.0f - (float) ai.getDurabilityForDisplay(a); - float percentDamageOfB = 1.0f - (float) bi.getDurabilityForDisplay(o); + final float percentDamageOfA = 1.0f - (float) ai.getDurabilityForDisplay(a); + final float percentDamageOfB = 1.0f - (float) bi.getDurabilityForDisplay(o); return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } } - catch( Throwable e ) + catch( final Throwable e ) { if( mode == FuzzyMode.IGNORE_ALL ) { @@ -372,8 +372,8 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); - float percentDamageOfB = (float) o.getItemDamage() / (float) o.getMaxDamage(); + final float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage(); + final float percentDamageOfB = (float) o.getItemDamage() / (float) o.getMaxDamage(); return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint ); } @@ -396,7 +396,7 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public IAEItemStack empty() { - IAEItemStack dup = this.copy(); + final IAEItemStack dup = this.copy(); dup.reset(); return dup; } @@ -428,7 +428,7 @@ public final class AEItemStack extends AEStack implements IAEItemS @Override public ItemStack getItemStack() { - ItemStack is = new ItemStack( this.def.item, (int) Math.min( Integer.MAX_VALUE, this.stackSize ), this.def.damageValue ); + final ItemStack is = new ItemStack( this.def.item, (int) Math.min( Integer.MAX_VALUE, this.stackSize ), this.def.damageValue ); if( this.def.tagCompound != null ) { is.setTagCompound( this.def.tagCompound.getNBTTagCompoundCopy() ); @@ -450,13 +450,13 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public boolean sameOre( IAEItemStack is ) + public boolean sameOre( final IAEItemStack is ) { return OreHelper.INSTANCE.sameOre( this, is ); } @Override - public boolean isSameType( IAEItemStack otherStack ) + public boolean isSameType( final IAEItemStack otherStack ) { if( otherStack == null ) { @@ -467,7 +467,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public boolean isSameType( ItemStack otherStack ) + public boolean isSameType( final ItemStack otherStack ) { if( otherStack == null ) { @@ -484,7 +484,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public boolean equals( Object ia ) + public boolean equals( final Object ia ) { if( ia instanceof AEItemStack ) { @@ -492,12 +492,12 @@ public final class AEItemStack extends AEStack implements IAEItemS } else if( ia instanceof ItemStack ) { - ItemStack is = (ItemStack) ia; + final ItemStack is = (ItemStack) ia; if( is.getItem() == this.def.item && is.getItemDamage() == this.def.damageValue ) { - NBTTagCompound ta = this.def.tagCompound; - NBTTagCompound tb = is.getTagCompound(); + final NBTTagCompound ta = this.def.tagCompound; + final NBTTagCompound tb = is.getTagCompound(); if( ta == tb ) { return true; @@ -531,21 +531,21 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - public int compareTo( AEItemStack b ) + public int compareTo( final AEItemStack b ) { - int id = this.def.itemID - b.def.itemID; + final int id = this.def.itemID - b.def.itemID; if( id != 0 ) { return id; } - int damageValue = this.def.damageValue - b.def.damageValue; + final int damageValue = this.def.damageValue - b.def.damageValue; if( damageValue != 0 ) { return damageValue; } - int displayDamage = this.def.displayDamage - b.def.displayDamage; + final int displayDamage = this.def.displayDamage - b.def.displayDamage; if( displayDamage != 0 ) { return displayDamage; @@ -554,9 +554,9 @@ public final class AEItemStack extends AEStack implements IAEItemS return ( this.def.tagCompound == b.def.tagCompound ) ? 0 : this.compareNBT( b.def ); } - private int compareNBT( AEItemDef b ) + private int compareNBT( final AEItemDef b ) { - int nbt = this.compare( ( this.def.tagCompound == null ? 0 : this.def.tagCompound.getHash() ), ( b.tagCompound == null ? 0 : b.tagCompound.getHash() ) ); + final int nbt = this.compare( ( this.def.tagCompound == null ? 0 : this.def.tagCompound.getHash() ), ( b.tagCompound == null ? 0 : b.tagCompound.getHash() ) ); if( nbt == 0 ) { return this.compare( System.identityHashCode( this.def.tagCompound ), System.identityHashCode( b.tagCompound ) ); @@ -564,7 +564,7 @@ public final class AEItemStack extends AEStack implements IAEItemS return nbt; } - private int compare( int l, int m ) + private int compare( final int l, final int m ) { return l < m ? -1 : ( l > m ? 1 : 0 ); } @@ -602,7 +602,7 @@ public final class AEItemStack extends AEStack implements IAEItemS return this.getModName( this.def.uniqueID = GameRegistry.findUniqueIdentifierFor( this.def.item ) ); } - private String getModName( UniqueIdentifier uniqueIdentifier ) + private String getModName( final UniqueIdentifier uniqueIdentifier ) { if( uniqueIdentifier == null ) { @@ -612,10 +612,10 @@ public final class AEItemStack extends AEStack implements IAEItemS return uniqueIdentifier.modId == null ? "** Null" : uniqueIdentifier.modId; } - public IAEItemStack getLow( FuzzyMode fuzzy, boolean ignoreMeta ) + public IAEItemStack getLow( final FuzzyMode fuzzy, final boolean ignoreMeta ) { - AEItemStack bottom = new AEItemStack( this ); - AEItemDef newDef = bottom.def = bottom.def.copy(); + final AEItemStack bottom = new AEItemStack( this ); + final AEItemDef newDef = bottom.def = bottom.def.copy(); if( ignoreMeta ) { @@ -643,7 +643,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); + final int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); newDef.displayDamage = breakpoint <= this.def.displayDamage ? breakpoint : 0; } @@ -655,10 +655,10 @@ public final class AEItemStack extends AEStack implements IAEItemS return bottom; } - public IAEItemStack getHigh( FuzzyMode fuzzy, boolean ignoreMeta ) + public IAEItemStack getHigh( final FuzzyMode fuzzy, final boolean ignoreMeta ) { - AEItemStack top = new AEItemStack( this ); - AEItemDef newDef = top.def = top.def.copy(); + final AEItemStack top = new AEItemStack( this ); + final AEItemDef newDef = top.def = top.def.copy(); if( ignoreMeta ) { @@ -686,7 +686,7 @@ public final class AEItemStack extends AEStack implements IAEItemS } else { - int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); + final int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage ); newDef.displayDamage = this.def.displayDamage < breakpoint ? breakpoint - 1 : this.def.maxDamage + 1; } @@ -704,24 +704,24 @@ public final class AEItemStack extends AEStack implements IAEItemS } @Override - void writeIdentity( ByteBuf i ) throws IOException + void writeIdentity( final ByteBuf i ) throws IOException { i.writeShort( Item.itemRegistry.getIDForObject( this.def.item ) ); i.writeShort( this.getItemDamage() ); } @Override - void readNBT( ByteBuf i ) throws IOException + void readNBT( final ByteBuf i ) throws IOException { if( this.hasTagCompound() ) { - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream( bytes ); + final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + final DataOutputStream data = new DataOutputStream( bytes ); CompressedStreamTools.write( (NBTTagCompound) this.getTagCompound(), data ); - byte[] tagBytes = bytes.toByteArray(); - int size = tagBytes.length; + final byte[] tagBytes = bytes.toByteArray(); + final int size = tagBytes.length; i.writeInt( size ); i.writeBytes( tagBytes ); diff --git a/src/main/java/appeng/util/item/AESharedNBT.java b/src/main/java/appeng/util/item/AESharedNBT.java index e57a0f2b..e0f84f39 100644 --- a/src/main/java/appeng/util/item/AESharedNBT.java +++ b/src/main/java/appeng/util/item/AESharedNBT.java @@ -47,13 +47,13 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound private int hash; private IItemComparison comp; - private AESharedNBT( Item itemID, int damageValue ) + private AESharedNBT( final Item itemID, final int damageValue ) { this.item = itemID; this.meta = damageValue; } - public AESharedNBT( int fakeValue ) + public AESharedNBT( final int fakeValue ) { this.item = null; this.meta = 0; @@ -71,14 +71,14 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound /* * Returns an NBT Compound that is used for accelerating comparisons. */ - public static synchronized NBTTagCompound getSharedTagCompound( NBTTagCompound tagCompound, ItemStack s ) + public static synchronized NBTTagCompound getSharedTagCompound( final NBTTagCompound tagCompound, final ItemStack s ) { if( tagCompound.hasNoTags() ) { return null; } - Item item = s.getItem(); + final Item item = s.getItem(); int meta = -1; if( s.getItem() != null && s.isItemStackDamageable() && s.getHasSubtypes() ) { @@ -90,12 +90,12 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound return tagCompound; } - SharedSearchObject sso = new SharedSearchObject( item, meta, tagCompound ); + final SharedSearchObject sso = new SharedSearchObject( item, meta, tagCompound ); - WeakReference c = SHARED_TAG_COMPOUND.get( sso ); + final WeakReference c = SHARED_TAG_COMPOUND.get( sso ); if( c != null ) { - SharedSearchObject cg = c.get(); + final SharedSearchObject cg = c.get(); if( cg != null ) { return cg.shared; // I don't think I really need to check this @@ -103,7 +103,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound // as its already certain to exist.. } - AESharedNBT clone = AESharedNBT.createFromCompound( item, meta, tagCompound ); + final AESharedNBT clone = AESharedNBT.createFromCompound( item, meta, tagCompound ); sso.compound = (NBTTagCompound) sso.compound.copy(); // prevent // modification // of data based @@ -119,25 +119,25 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound /* * returns true if the compound is part of the shared compound system ( and can thus be compared directly ). */ - public static boolean isShared( NBTTagCompound ta ) + public static boolean isShared( final NBTTagCompound ta ) { return ta instanceof AESharedNBT; } - public static AESharedNBT createFromCompound( Item itemID, int damageValue, NBTTagCompound c ) + public static AESharedNBT createFromCompound( final Item itemID, final int damageValue, final NBTTagCompound c ) { - AESharedNBT x = new AESharedNBT( itemID, damageValue ); + final AESharedNBT x = new AESharedNBT( itemID, damageValue ); // c.getTags() - for( Object o : c.getKeySet() ) + for( final Object o : c.getKeySet() ) { - String name = (String) o; + final String name = (String) o; x.setTag( name, c.getTag( name ).copy() ); } x.hash = Platform.NBTOrderlessHash( c ); - ItemStack isc = new ItemStack( itemID, 1, damageValue ); + final ItemStack isc = new ItemStack( itemID, 1, damageValue ); isc.setTagCompound( c ); x.comp = AEApi.instance().registries().specialComparison().getSpecialComparison( isc ); @@ -162,7 +162,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound } @Override - public boolean equals( Object par1Obj ) + public boolean equals( final Object par1Obj ) { if( par1Obj instanceof AESharedNBT ) { @@ -171,12 +171,12 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound return super.equals( par1Obj ); } - public boolean matches( Item item, int meta, int orderlessHash ) + public boolean matches( final Item item, final int meta, final int orderlessHash ) { return item == this.item && this.meta == meta && this.hash == orderlessHash; } - public boolean comparePreciseWithRegistry( AESharedNBT tagCompound ) + public boolean comparePreciseWithRegistry( final AESharedNBT tagCompound ) { if( this == tagCompound ) { @@ -191,7 +191,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound return false; } - public boolean compareFuzzyWithRegistry( AESharedNBT tagCompound ) + public boolean compareFuzzyWithRegistry( final AESharedNBT tagCompound ) { if( this == tagCompound ) { diff --git a/src/main/java/appeng/util/item/AEStack.java b/src/main/java/appeng/util/item/AEStack.java index 6427b413..bb51b81a 100644 --- a/src/main/java/appeng/util/item/AEStack.java +++ b/src/main/java/appeng/util/item/AEStack.java @@ -33,7 +33,7 @@ public abstract class AEStack implements IAEStack implements IAEStack implements IAEStack implements IAEStack implements IAEStack implements IAEStack implements IAEStack private final Map records = new HashMap(); @Override - public void add( IAEFluidStack option ) + public void add( final IAEFluidStack option ) { if( option == null ) { @@ -57,7 +57,7 @@ public final class FluidList implements IItemList } @Override - public IAEFluidStack findPrecise( IAEFluidStack fluidStack ) + public IAEFluidStack findPrecise( final IAEFluidStack fluidStack ) { if( fluidStack == null ) { @@ -68,7 +68,7 @@ public final class FluidList implements IItemList } @Override - public Collection findFuzzy( IAEFluidStack filter, FuzzyMode fuzzy ) + public Collection findFuzzy( final IAEFluidStack filter, final FuzzyMode fuzzy ) { if( filter == null ) { @@ -85,7 +85,7 @@ public final class FluidList implements IItemList } @Override - public void addStorage( IAEFluidStack option ) + public void addStorage( final IAEFluidStack option ) { if( option == null ) { @@ -111,7 +111,7 @@ public final class FluidList implements IItemList */ @Override - public void addCrafting( IAEFluidStack option ) + public void addCrafting( final IAEFluidStack option ) { if( option == null ) { @@ -134,7 +134,7 @@ public final class FluidList implements IItemList } @Override - public void addRequestable( IAEFluidStack option ) + public void addRequestable( final IAEFluidStack option ) { if( option == null ) { @@ -160,7 +160,7 @@ public final class FluidList implements IItemList @Override public IAEFluidStack getFirstItem() { - for( IAEFluidStack stackType : this ) + for( final IAEFluidStack stackType : this ) { return stackType; } @@ -183,18 +183,18 @@ public final class FluidList implements IItemList @Override public void resetStatus() { - for( IAEFluidStack i : this ) + for( final IAEFluidStack i : this ) { i.reset(); } } - private IAEFluidStack getFluidRecord( IAEFluidStack fluid ) + private IAEFluidStack getFluidRecord( final IAEFluidStack fluid ) { return this.records.get( fluid ); } - private IAEFluidStack putFluidRecord( IAEFluidStack fluid ) + private IAEFluidStack putFluidRecord( final IAEFluidStack fluid ) { return this.records.put( fluid, fluid ); } diff --git a/src/main/java/appeng/util/item/ItemList.java b/src/main/java/appeng/util/item/ItemList.java index 6b5a1d24..4feb5c68 100644 --- a/src/main/java/appeng/util/item/ItemList.java +++ b/src/main/java/appeng/util/item/ItemList.java @@ -43,7 +43,7 @@ public final class ItemList implements IItemList private final Map> records = new IdentityHashMap>(); @Override - public void add( IAEItemStack option ) + public void add( final IAEItemStack option ) { if( option == null ) { @@ -64,7 +64,7 @@ public final class ItemList implements IItemList } @Override - public IAEItemStack findPrecise( IAEItemStack itemStack ) + public IAEItemStack findPrecise( final IAEItemStack itemStack ) { if( itemStack == null ) { @@ -75,7 +75,7 @@ public final class ItemList implements IItemList } @Override - public Collection findFuzzy( IAEItemStack filter, FuzzyMode fuzzy ) + public Collection findFuzzy( final IAEItemStack filter, final FuzzyMode fuzzy ) { if( filter == null ) { @@ -98,7 +98,7 @@ public final class ItemList implements IItemList { final Collection output = new LinkedList(); - for( IAEItemStack is : or.getAEEquivalents() ) + for( final IAEItemStack is : or.getAEEquivalents() ) { output.addAll( this.findFuzzyDamage( (AEItemStack) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) ); } @@ -117,7 +117,7 @@ public final class ItemList implements IItemList } @Override - public void addStorage( IAEItemStack option ) + public void addStorage( final IAEItemStack option ) { if( option == null ) { @@ -143,7 +143,7 @@ public final class ItemList implements IItemList */ @Override - public void addCrafting( IAEItemStack option ) + public void addCrafting( final IAEItemStack option ) { if( option == null ) { @@ -166,7 +166,7 @@ public final class ItemList implements IItemList } @Override - public void addRequestable( IAEItemStack option ) + public void addRequestable( final IAEItemStack option ) { if( option == null ) { @@ -192,7 +192,7 @@ public final class ItemList implements IItemList @Override public IAEItemStack getFirstItem() { - for( IAEItemStack stackType : this ) + for( final IAEItemStack stackType : this ) { return stackType; } @@ -205,7 +205,7 @@ public final class ItemList implements IItemList { int size = 0; - for( Map element : this.records.values() ) + for( final Map element : this.records.values() ) { size += element.size(); } @@ -222,13 +222,13 @@ public final class ItemList implements IItemList @Override public void resetStatus() { - for( IAEItemStack i : this ) + for( final IAEItemStack i : this ) { i.reset(); } } - private NavigableMap getItemRecord( Item item ) + private NavigableMap getItemRecord( final Item item ) { NavigableMap itemRecords = this.records.get( item ); @@ -241,12 +241,12 @@ public final class ItemList implements IItemList return itemRecords; } - private IAEItemStack putItemRecord( IAEItemStack itemStack ) + private IAEItemStack putItemRecord( final IAEItemStack itemStack ) { return this.getItemRecord( itemStack.getItem() ).put( itemStack, itemStack ); } - private Collection findFuzzyDamage( AEItemStack filter, FuzzyMode fuzzy, boolean ignoreMeta ) + private Collection findFuzzyDamage( final AEItemStack filter, final FuzzyMode fuzzy, final boolean ignoreMeta ) { final IAEItemStack low = filter.getLow( fuzzy, ignoreMeta ); final IAEItemStack high = filter.getHigh( fuzzy, ignoreMeta ); diff --git a/src/main/java/appeng/util/item/ItemModList.java b/src/main/java/appeng/util/item/ItemModList.java index 0a850f6f..66e0be9f 100644 --- a/src/main/java/appeng/util/item/ItemModList.java +++ b/src/main/java/appeng/util/item/ItemModList.java @@ -33,13 +33,13 @@ public class ItemModList implements IItemContainer final IItemContainer backingStore; final IItemContainer overrides = AEApi.instance().storage().createItemList(); - public ItemModList( IItemContainer backend ) + public ItemModList( final IItemContainer backend ) { this.backingStore = backend; } @Override - public void add( IAEItemStack option ) + public void add( final IAEItemStack option ) { IAEItemStack over = this.overrides.findPrecise( option ); if( over == null ) @@ -62,9 +62,9 @@ public class ItemModList implements IItemContainer } @Override - public IAEItemStack findPrecise( IAEItemStack i ) + public IAEItemStack findPrecise( final IAEItemStack i ) { - IAEItemStack over = this.overrides.findPrecise( i ); + final IAEItemStack over = this.overrides.findPrecise( i ); if( over == null ) { return this.backingStore.findPrecise( i ); @@ -73,7 +73,7 @@ public class ItemModList implements IItemContainer } @Override - public Collection findFuzzy( IAEItemStack input, FuzzyMode fuzzy ) + public Collection findFuzzy( final IAEItemStack input, final FuzzyMode fuzzy ) { return this.overrides.findFuzzy( input, fuzzy ); } diff --git a/src/main/java/appeng/util/item/MeaningfulFluidIterator.java b/src/main/java/appeng/util/item/MeaningfulFluidIterator.java index c65ec676..768fdbb4 100644 --- a/src/main/java/appeng/util/item/MeaningfulFluidIterator.java +++ b/src/main/java/appeng/util/item/MeaningfulFluidIterator.java @@ -31,7 +31,7 @@ public class MeaningfulFluidIterator implements Iterator private final Iterator parent; private T next; - public MeaningfulFluidIterator( Iterator iterator ) + public MeaningfulFluidIterator( final Iterator iterator ) { this.parent = iterator; } diff --git a/src/main/java/appeng/util/item/MeaningfulItemIterator.java b/src/main/java/appeng/util/item/MeaningfulItemIterator.java index 2becf838..94d389cb 100644 --- a/src/main/java/appeng/util/item/MeaningfulItemIterator.java +++ b/src/main/java/appeng/util/item/MeaningfulItemIterator.java @@ -33,7 +33,7 @@ public class MeaningfulItemIterator implements Iterator< private Iterator innerIterater = null; private T next; - public MeaningfulItemIterator( Iterator> iterator ) + public MeaningfulItemIterator( final Iterator> iterator ) { this.parent = iterator; diff --git a/src/main/java/appeng/util/item/OreHelper.java b/src/main/java/appeng/util/item/OreHelper.java index d39827de..c2194770 100644 --- a/src/main/java/appeng/util/item/OreHelper.java +++ b/src/main/java/appeng/util/item/OreHelper.java @@ -47,7 +47,7 @@ public class OreHelper private final LoadingCache> oreDictCache = CacheBuilder.newBuilder().build( new CacheLoader>() { @Override - public List load( String oreName ) + public List load( final String oreName ) { return OreDictionary.getOres( oreName ); } @@ -62,9 +62,9 @@ public class OreHelper * * @return true if an ore entry exists, false otherwise */ - public OreReference isOre( ItemStack itemStack ) + public OreReference isOre( final ItemStack itemStack ) { - ItemRef ir = new ItemRef( itemStack ); + final ItemRef ir = new ItemRef( itemStack ); if( !this.references.containsKey( ir ) ) { @@ -72,9 +72,9 @@ public class OreHelper final Collection ores = ref.getOres(); final Collection set = ref.getEquivalents(); - Set toAdd = new HashSet(); + final Set toAdd = new HashSet(); - for( String ore : OreDictionary.getOreNames() ) + for( final String ore : OreDictionary.getOreNames() ) { // skip ore if it is a match already or null. if( ore == null || toAdd.contains( ore ) ) @@ -82,7 +82,7 @@ public class OreHelper continue; } - for( ItemStack oreItem : this.oreDictCache.getUnchecked( ore ) ) + for( final ItemStack oreItem : this.oreDictCache.getUnchecked( ore ) ) { if( OreDictionary.itemMatches( oreItem, itemStack, false ) ) { @@ -92,7 +92,7 @@ public class OreHelper } } - for( String ore : toAdd ) + for( final String ore : toAdd ) { set.add( ore ); ores.add( OreDictionary.getOreID( ore ) ); @@ -111,15 +111,15 @@ public class OreHelper return this.references.get( ir ); } - public boolean sameOre( AEItemStack aeItemStack, IAEItemStack is ) + public boolean sameOre( final AEItemStack aeItemStack, final IAEItemStack is ) { - OreReference a = aeItemStack.def.isOre; - OreReference b = aeItemStack.def.isOre; + final OreReference a = aeItemStack.def.isOre; + final OreReference b = aeItemStack.def.isOre; return this.sameOre( a, b ); } - public boolean sameOre( OreReference a, OreReference b ) + public boolean sameOre( final OreReference a, final OreReference b ) { if( a == null || b == null ) { @@ -131,8 +131,8 @@ public class OreHelper return true; } - Collection bOres = b.getOres(); - for( Integer ore : a.getOres() ) + final Collection bOres = b.getOres(); + for( final Integer ore : a.getOres() ) { if( bOres.contains( ore ) ) { @@ -143,17 +143,17 @@ public class OreHelper return false; } - public boolean sameOre( AEItemStack aeItemStack, ItemStack o ) + public boolean sameOre( final AEItemStack aeItemStack, final ItemStack o ) { - OreReference a = aeItemStack.def.isOre; + final OreReference a = aeItemStack.def.isOre; if( a == null ) { return false; } - for( String oreName : a.getEquivalents() ) + for( final String oreName : a.getEquivalents() ) { - for( ItemStack oreItem : this.oreDictCache.getUnchecked( oreName ) ) + for( final ItemStack oreItem : this.oreDictCache.getUnchecked( oreName ) ) { if( OreDictionary.itemMatches( oreItem, o, false ) ) { @@ -165,7 +165,7 @@ public class OreHelper return false; } - public List getCachedOres( String oreName ) + public List getCachedOres( final String oreName ) { return this.oreDictCache.getUnchecked( oreName ); } @@ -177,7 +177,7 @@ public class OreHelper private final int damage; private final int hash; - ItemRef( ItemStack stack ) + ItemRef( final ItemStack stack ) { this.ref = stack.getItem(); @@ -200,7 +200,7 @@ public class OreHelper } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -210,7 +210,7 @@ public class OreHelper { return false; } - ItemRef other = (ItemRef) obj; + final ItemRef other = (ItemRef) obj; return this.damage == other.damage && this.ref == other.ref; } diff --git a/src/main/java/appeng/util/item/OreReference.java b/src/main/java/appeng/util/item/OreReference.java index 00dfb61c..11d01a93 100644 --- a/src/main/java/appeng/util/item/OreReference.java +++ b/src/main/java/appeng/util/item/OreReference.java @@ -49,9 +49,9 @@ public class OreReference this.aeOtherOptions = new ArrayList( this.otherOptions.size() ); // SUMMON AE STACKS! - for( String oreName : this.otherOptions ) + for( final String oreName : this.otherOptions ) { - for( ItemStack is : OreHelper.INSTANCE.getCachedOres( oreName ) ) + for( final ItemStack is : OreHelper.INSTANCE.getCachedOres( oreName ) ) { if( is.getItem() != null ) { diff --git a/src/main/java/appeng/util/item/SharedSearchObject.java b/src/main/java/appeng/util/item/SharedSearchObject.java index c99fa1dd..a7725cae 100644 --- a/src/main/java/appeng/util/item/SharedSearchObject.java +++ b/src/main/java/appeng/util/item/SharedSearchObject.java @@ -32,7 +32,7 @@ public class SharedSearchObject public AESharedNBT shared; NBTTagCompound compound; - public SharedSearchObject( Item itemID, int damageValue, NBTTagCompound tagCompound ) + public SharedSearchObject( final Item itemID, final int damageValue, final NBTTagCompound tagCompound ) { this.def = ( damageValue << Platform.DEF_OFFSET ) | Item.itemRegistry.getIDForObject( itemID ); this.hash = Platform.NBTOrderlessHash( tagCompound ); @@ -46,7 +46,7 @@ public class SharedSearchObject } @Override - public boolean equals( Object obj ) + public boolean equals( final Object obj ) { if( obj == null ) { @@ -56,7 +56,7 @@ public class SharedSearchObject { return false; } - SharedSearchObject other = (SharedSearchObject) obj; + final SharedSearchObject other = (SharedSearchObject) obj; if( this.def == other.def && this.hash == other.hash ) { return Platform.NBTEqualityTest( this.compound, other.compound ); diff --git a/src/main/java/appeng/util/iterators/AEInvIterator.java b/src/main/java/appeng/util/iterators/AEInvIterator.java index b39f1bd0..796d43e3 100644 --- a/src/main/java/appeng/util/iterators/AEInvIterator.java +++ b/src/main/java/appeng/util/iterators/AEInvIterator.java @@ -32,7 +32,7 @@ public final class AEInvIterator implements Iterator private int counter = 0; - public AEInvIterator( AppEngInternalAEInventory inventory ) + public AEInvIterator( final AppEngInternalAEInventory inventory ) { this.inventory = inventory; this.size = this.inventory.getSizeInventory(); diff --git a/src/main/java/appeng/util/iterators/ChainedIterator.java b/src/main/java/appeng/util/iterators/ChainedIterator.java index 6134d1f1..93f3769f 100644 --- a/src/main/java/appeng/util/iterators/ChainedIterator.java +++ b/src/main/java/appeng/util/iterators/ChainedIterator.java @@ -28,7 +28,7 @@ public final class ChainedIterator implements Iterator private int offset = 0; - public ChainedIterator( T... list ) + public ChainedIterator( final T... list ) { this.list = list; } @@ -42,7 +42,7 @@ public final class ChainedIterator implements Iterator @Override public T next() { - T result = this.list[this.offset]; + final T result = this.list[this.offset]; this.offset++; return result; } diff --git a/src/main/java/appeng/util/iterators/InvIterator.java b/src/main/java/appeng/util/iterators/InvIterator.java index 92eb8a17..7ee8b63f 100644 --- a/src/main/java/appeng/util/iterators/InvIterator.java +++ b/src/main/java/appeng/util/iterators/InvIterator.java @@ -32,7 +32,7 @@ public final class InvIterator implements Iterator private int counter = 0; - public InvIterator( IInventory inventory ) + public InvIterator( final IInventory inventory ) { this.inventory = inventory; this.size = this.inventory.getSizeInventory(); @@ -47,7 +47,7 @@ public final class InvIterator implements Iterator @Override public ItemStack next() { - ItemStack result = this.inventory.getStackInSlot( this.counter ); + final ItemStack result = this.inventory.getStackInSlot( this.counter ); this.counter++; return result; diff --git a/src/main/java/appeng/util/iterators/ProxyNodeIterator.java b/src/main/java/appeng/util/iterators/ProxyNodeIterator.java index b35b83b9..662c094a 100644 --- a/src/main/java/appeng/util/iterators/ProxyNodeIterator.java +++ b/src/main/java/appeng/util/iterators/ProxyNodeIterator.java @@ -30,7 +30,7 @@ public final class ProxyNodeIterator implements Iterator { private final Iterator hosts; - public ProxyNodeIterator( Iterator hosts ) + public ProxyNodeIterator( final Iterator hosts ) { this.hosts = hosts; } @@ -44,7 +44,7 @@ public final class ProxyNodeIterator implements Iterator @Override public IGridNode next() { - IGridHost host = this.hosts.next(); + final IGridHost host = this.hosts.next(); return host.getGridNode( AEPartLocation.INTERNAL ); } diff --git a/src/main/java/appeng/util/iterators/StackToSlotIterator.java b/src/main/java/appeng/util/iterators/StackToSlotIterator.java index 2172f5bf..7c2d6012 100644 --- a/src/main/java/appeng/util/iterators/StackToSlotIterator.java +++ b/src/main/java/appeng/util/iterators/StackToSlotIterator.java @@ -32,7 +32,7 @@ public class StackToSlotIterator implements Iterator final Iterator is; int x = 0; - public StackToSlotIterator( Iterator is ) + public StackToSlotIterator( final Iterator is ) { this.is = is; } diff --git a/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java b/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java index 4953d690..bde03441 100644 --- a/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java @@ -31,7 +31,7 @@ public class DefaultPriorityList> implements IPartitionLis static final List NULL_LIST = new ArrayList(); @Override - public boolean isListed( T input ) + public boolean isListed( final T input ) { return false; } diff --git a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java index bdcd3e9d..9d2d3c47 100644 --- a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java @@ -32,16 +32,16 @@ public class FuzzyPriorityList> implements IPartitionList< final IItemList list; final FuzzyMode mode; - public FuzzyPriorityList( IItemList in, FuzzyMode mode ) + public FuzzyPriorityList( final IItemList in, final FuzzyMode mode ) { this.list = in; this.mode = mode; } @Override - public boolean isListed( T input ) + public boolean isListed( final T input ) { - Collection out = this.list.findFuzzy( input, this.mode ); + final Collection out = this.list.findFuzzy( input, this.mode ); return out != null && !out.isEmpty(); } diff --git a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java index 4eb746f2..b4baa07e 100644 --- a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java @@ -31,7 +31,7 @@ public final class MergedPriorityList> implements IPartiti private final Collection> positive = new ArrayList>(); private final Collection> negative = new ArrayList>(); - public void addNewList( IPartitionList list, boolean isWhitelist ) + public void addNewList( final IPartitionList list, final boolean isWhitelist ) { if( isWhitelist ) { @@ -44,9 +44,9 @@ public final class MergedPriorityList> implements IPartiti } @Override - public boolean isListed( T input ) + public boolean isListed( final T input ) { - for( IPartitionList l : this.negative ) + for( final IPartitionList l : this.negative ) { if( l.isListed( input ) ) { @@ -56,7 +56,7 @@ public final class MergedPriorityList> implements IPartiti if( !this.positive.isEmpty() ) { - for( IPartitionList l : this.positive ) + for( final IPartitionList l : this.positive ) { if( l.isListed( input ) ) { diff --git a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java index c34ff151..c4390186 100644 --- a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java +++ b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java @@ -28,13 +28,13 @@ public class PrecisePriorityList> implements IPartitionLis final IItemList list; - public PrecisePriorityList( IItemList in ) + public PrecisePriorityList( final IItemList in ) { this.list = in; } @Override - public boolean isListed( T input ) + public boolean isListed( final T input ) { return this.list.findPrecise( input ) != null; } diff --git a/src/main/java/appeng/worldgen/MeteoritePlacer.java b/src/main/java/appeng/worldgen/MeteoritePlacer.java index be1ee053..a320df82 100644 --- a/src/main/java/appeng/worldgen/MeteoritePlacer.java +++ b/src/main/java/appeng/worldgen/MeteoritePlacer.java @@ -93,7 +93,7 @@ public final class MeteoritePlacer this.validSpawn.add( Blocks.snow ); this.validSpawn.add( Blocks.stained_hardened_clay ); - for( Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) + for( final Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) { this.invalidSpawn.add( skyStoneBlock ); } @@ -116,20 +116,20 @@ public final class MeteoritePlacer this.type = new Fallout( this.putter, this.skyStoneDefinition ); } - public boolean spawnMeteorite( IMeteoriteWorld w, NBTTagCompound meteoriteBlob ) + public boolean spawnMeteorite( final IMeteoriteWorld w, final NBTTagCompound meteoriteBlob ) { this.settings = meteoriteBlob; - int x = this.settings.getInteger( "x" ); - int y = this.settings.getInteger( "y" ); - int z = this.settings.getInteger( "z" ); + final int x = this.settings.getInteger( "x" ); + final int y = this.settings.getInteger( "y" ); + final int z = this.settings.getInteger( "z" ); this.meteoriteSize = this.settings.getDouble( "real_sizeOfMeteorite" ); this.realCrater = this.settings.getDouble( "realCrater" ); this.squaredMeteoriteSize = this.settings.getDouble( "sizeOfMeteorite" ); this.crater = this.settings.getDouble( "crater" ); - Block blk = Block.getBlockById( this.settings.getInteger( "blk" ) ); + final Block blk = Block.getBlockById( this.settings.getInteger( "blk" ) ); if( blk == Blocks.sand ) { @@ -144,7 +144,7 @@ public final class MeteoritePlacer this.type = new FalloutSnow( w, x, y, z, this.putter, this.skyStoneDefinition ); } - int skyMode = this.settings.getInteger( "skyMode" ); + final int skyMode = this.settings.getInteger( "skyMode" ); // creator if( skyMode > 10 ) @@ -164,15 +164,15 @@ public final class MeteoritePlacer return true; } - private void placeCrater( IMeteoriteWorld w, int x, int y, int z ) + private void placeCrater( final IMeteoriteWorld w, final int x, final int y, final int z ) { - boolean lava = this.settings.getBoolean( "lava" ); + final boolean lava = this.settings.getBoolean( "lava" ); - int maxY = 255; - int minX = w.minX( x - 200 ); - int maxX = w.maxX( x + 200 ); - int minZ = w.minZ( z - 200 ); - int maxZ = w.maxZ( z + 200 ); + final int maxY = 255; + final int minX = w.minX( x - 200 ); + final int maxX = w.maxX( x + 200 ); + final int minZ = w.minZ( z - 200 ); + final int maxZ = w.maxZ( z + 200 ); for( int j = y - 5; j < maxY; j++ ) { @@ -182,11 +182,11 @@ public final class MeteoritePlacer { for( int k = minZ; k < maxZ; k++ ) { - double dx = i - x; - double dz = k - z; - double h = y - this.meteoriteSize + 1 + this.type.adjustCrater(); + final double dx = i - x; + final double dz = k - z; + final double h = y - this.meteoriteSize + 1 + this.type.adjustCrater(); - double distanceFrom = dx * dx + dz * dz; + final double distanceFrom = dx * dx + dz * dz; if( j > h + distanceFrom * 0.02 ) { @@ -206,19 +206,19 @@ public final class MeteoritePlacer } } - for( Object o : w.getWorld().getEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.fromBounds( w.minX( x - 30 ), y - 5, w.minZ( z - 30 ), w.maxX( x + 30 ), y + 30, w.maxZ( z + 30 ) ) ) ) + for( final Object o : w.getWorld().getEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.fromBounds( w.minX( x - 30 ), y - 5, w.minZ( z - 30 ), w.maxX( x + 30 ), y + 30, w.maxZ( z + 30 ) ) ) ) { - Entity e = (Entity) o; + final Entity e = (Entity) o; e.setDead(); } } - private void placeMeteorite( IMeteoriteWorld w, int x, int y, int z ) + private void placeMeteorite( final IMeteoriteWorld w, final int x, final int y, final int z ) { - int meteorXLength = w.minX( x - 8 ); - int meteorXHeight = w.maxX( x + 8 ); - int meteorZLength = w.minZ( z - 8 ); - int meteorZHeight = w.maxZ( z + 8 ); + final int meteorXLength = w.minX( x - 8 ); + final int meteorXHeight = w.maxX( x + 8 ); + final int meteorZLength = w.minZ( z - 8 ); + final int meteorZHeight = w.maxZ( z + 8 ); // spawn meteor for( int i = meteorXLength; i < meteorXHeight; i++ ) @@ -227,13 +227,13 @@ public final class MeteoritePlacer { for( int k = meteorZLength; k < meteorZHeight; k++ ) { - double dx = i - x; - double dy = j - y; - double dz = k - z; + final double dx = i - x; + final double dy = j - y; + final double dz = k - z; if( dx * dx * 0.7 + dy * dy * ( j > y ? 1.4 : 0.8 ) + dz * dz * 0.7 < this.squaredMeteoriteSize ) { - for( Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) + for( final Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) { this.putter.put( w, i, j, k, skyStoneBlock ); } @@ -244,15 +244,15 @@ public final class MeteoritePlacer if( AEConfig.instance.isFeatureEnabled( AEFeature.SpawnPressesInMeteorites ) ) { - for( Block skyChestBlock : this.skyChestDefinition.maybeBlock().asSet() ) + for( final Block skyChestBlock : this.skyChestDefinition.maybeBlock().asSet() ) { this.putter.put( w, x, y, z, skyChestBlock ); } - TileEntity te = w.getTileEntity( x, y, z ); + final TileEntity te = w.getTileEntity( x, y, z ); if( te instanceof IInventory ) { - InventoryAdaptor ap = InventoryAdaptor.getAdaptor( te, EnumFacing.UP ); + final InventoryAdaptor ap = InventoryAdaptor.getAdaptor( te, EnumFacing.UP ); int primary = Math.max( 1, (int) ( Math.random() * 4 ) ); @@ -285,25 +285,25 @@ public final class MeteoritePlacer switch( r % 4 ) { case 0: - for( ItemStack calc : materials.calcProcessorPress().maybeStack( 1 ).asSet() ) + for( final ItemStack calc : materials.calcProcessorPress().maybeStack( 1 ).asSet() ) { toAdd = calc; } break; case 1: - for( ItemStack calc : materials.engProcessorPress().maybeStack( 1 ).asSet() ) + for( final ItemStack calc : materials.engProcessorPress().maybeStack( 1 ).asSet() ) { toAdd = calc; } break; case 2: - for( ItemStack calc : materials.logicProcessorPress().maybeStack( 1 ).asSet() ) + for( final ItemStack calc : materials.logicProcessorPress().maybeStack( 1 ).asSet() ) { toAdd = calc; } break; case 3: - for( ItemStack calc : materials.siliconPress().maybeStack( 1 ).asSet() ) + for( final ItemStack calc : materials.siliconPress().maybeStack( 1 ).asSet() ) { toAdd = calc; } @@ -326,20 +326,20 @@ public final class MeteoritePlacer while( duplicate ); } - int secondary = Math.max( 1, (int) ( Math.random() * 3 ) ); + final int secondary = Math.max( 1, (int) ( Math.random() * 3 ) ); for( int zz = 0; zz < secondary; zz++ ) { switch( (int) ( Math.random() * 1000 ) % 3 ) { case 0: final int amount = (int) ( ( Math.random() * SKYSTONE_SPAWN_LIMIT ) + 1 ); - for( ItemStack skyStoneStack : this.skyStoneDefinition.maybeStack( amount ).asSet() ) + for( final ItemStack skyStoneStack : this.skyStoneDefinition.maybeStack( amount ).asSet() ) { ap.addItems( skyStoneStack ); } break; case 1: - List possibles = new LinkedList(); + final List possibles = new LinkedList(); possibles.addAll( OreDictionary.getOres( "nuggetIron" ) ); possibles.addAll( OreDictionary.getOres( "nuggetCopper" ) ); possibles.addAll( OreDictionary.getOres( "nuggetTin" ) ); @@ -365,14 +365,14 @@ public final class MeteoritePlacer } } - private void decay( IMeteoriteWorld w, int x, int y, int z ) + private void decay( final IMeteoriteWorld w, final int x, final int y, final int z ) { double randomShit = 0; - int meteorXLength = w.minX( x - 30 ); - int meteorXHeight = w.maxX( x + 30 ); - int meteorZLength = w.minZ( z - 30 ); - int meteorZHeight = w.maxZ( z + 30 ); + final int meteorXLength = w.minX( x - 30 ); + final int meteorXHeight = w.maxX( x + 30 ); + final int meteorZLength = w.minZ( z - 30 ); + final int meteorZHeight = w.maxZ( z + 30 ); for( int i = meteorXLength; i < meteorXHeight; i++ ) { @@ -389,26 +389,26 @@ public final class MeteoritePlacer if( blk.isReplaceable( w.getWorld(), new BlockPos( i, j, k ) ) ) { blk = Platform.AIR_BLOCK; - Block blk_b = w.getBlock( i, j + 1, k ); + final Block blk_b = w.getBlock( i, j + 1, k ); if( blk_b != blk ) { - IBlockState meta_b = w.getBlockState( i, j + 1, k ); + final IBlockState meta_b = w.getBlockState( i, j + 1, k ); w.setBlock( i, j, k, meta_b, 3 ); } else if( randomShit < 100 * this.crater ) { - double dx = i - x; - double dy = j - y; - double dz = k - z; - double dist = dx * dx + dy * dy + dz * dz; + final double dx = i - x; + final double dy = j - y; + final double dz = k - z; + final double dist = dx * dx + dy * dy + dz * dz; - Block xf = w.getBlock( i, j - 1, k ); + final Block xf = w.getBlock( i, j - 1, k ); if( !xf.isReplaceable( w.getWorld(), new BlockPos(i, j - 1, k) ) ) { - double extraRange = Math.random() * 0.6; - double height = this.crater * ( extraRange + 0.2 ) - Math.abs( dist - this.crater * 1.7 ); + final double extraRange = Math.random() * 0.6; + final double height = this.crater * ( extraRange + 0.2 ) - Math.abs( dist - this.crater * 1.7 ); if( xf != blk && height > 0 && Math.random() > 0.6 ) { @@ -421,14 +421,14 @@ public final class MeteoritePlacer else { // decay. - Block blk_b = w.getBlock( i, j + 1, k ); + final Block blk_b = w.getBlock( i, j + 1, k ); if( blk_b == Platform.AIR_BLOCK ) { if( Math.random() > 0.4 ) { - double dx = i - x; - double dy = j - y; - double dz = k - z; + final double dx = i - x; + final double dy = j - y; + final double dz = k - z; if( dx * dx + dy * dy + dz * dz < this.crater * 1.6 ) { @@ -442,15 +442,15 @@ public final class MeteoritePlacer } } - public double getSqDistance( int x, int z ) + public double getSqDistance( final int x, final int z ) { - int chunkX = this.settings.getInteger( "x" ) - x; - int chunkZ = this.settings.getInteger( "z" ) - z; + final int chunkX = this.settings.getInteger( "x" ) - x; + final int chunkZ = this.settings.getInteger( "z" ) - z; return chunkX * chunkX + chunkZ * chunkZ; } - public boolean spawnMeteorite( IMeteoriteWorld w, int x, int y, int z ) + public boolean spawnMeteorite( final IMeteoriteWorld w, final int x, final int y, final int z ) { if( !w.hasNoSky() ) @@ -527,7 +527,7 @@ public final class MeteoritePlacer } } - int minBLocks = 200; + final int minBLocks = 200; if( validBlocks > minBLocks && realValidBlocks > 80 ) { // we can spawn here! diff --git a/src/main/java/appeng/worldgen/MeteoriteWorldGen.java b/src/main/java/appeng/worldgen/MeteoriteWorldGen.java index 4ee00196..30b1feaa 100644 --- a/src/main/java/appeng/worldgen/MeteoriteWorldGen.java +++ b/src/main/java/appeng/worldgen/MeteoriteWorldGen.java @@ -38,17 +38,17 @@ import appeng.worldgen.meteorite.ChunkOnly; public final class MeteoriteWorldGen implements IWorldGenerator { @Override - public void generate( Random r, int chunkX, int chunkZ, World w, IChunkProvider chunkGenerator, IChunkProvider chunkProvider ) + public void generate( final Random r, final int chunkX, final int chunkZ, final World w, final IChunkProvider chunkGenerator, final IChunkProvider chunkProvider ) { if( WorldGenRegistry.INSTANCE.isWorldGenEnabled( WorldGenType.Meteorites, w ) ) { // add new meteorites? if( r.nextFloat() < AEConfig.instance.meteoriteSpawnChance ) { - int x = r.nextInt( 16 ) + ( chunkX << 4 ); - int z = r.nextInt( 16 ) + ( chunkZ << 4 ); + final int x = r.nextInt( 16 ) + ( chunkX << 4 ); + final int z = r.nextInt( 16 ) + ( chunkZ << 4 ); - int depth = 180 + r.nextInt( 20 ); + final int depth = 180 + r.nextInt( 20 ); TickHandler.INSTANCE.addCallable( w, new MeteoriteSpawn( x, depth, z ) ); } else @@ -62,16 +62,16 @@ public final class MeteoriteWorldGen implements IWorldGenerator } } - private boolean tryMeteorite( World w, int depth, int x, int z ) + private boolean tryMeteorite( final World w, int depth, final int x, final int z ) { for( int tries = 0; tries < 20; tries++ ) { - MeteoritePlacer mp = new MeteoritePlacer(); + final MeteoritePlacer mp = new MeteoritePlacer(); if( mp.spawnMeteorite( new ChunkOnly( w, x >> 4, z >> 4 ), x, depth, z ) ) { - int px = x >> 4; - int pz = z >> 4; + final int px = x >> 4; + final int pz = z >> 4; for( int cx = px - 6; cx < px + 6; cx++ ) { @@ -86,7 +86,7 @@ public final class MeteoriteWorldGen implements IWorldGenerator if( WorldData.instance().spawnData().hasGenerated( w.provider.getDimensionId(), cx, cz ) ) { - MeteoritePlacer mp2 = new MeteoritePlacer(); + final MeteoritePlacer mp2 = new MeteoritePlacer(); mp2.spawnMeteorite( new ChunkOnly( w, cx, cz ), mp.getSettings() ); } } @@ -106,7 +106,7 @@ public final class MeteoriteWorldGen implements IWorldGenerator return false; } - private Iterable getNearByMeteorites( World w, int chunkX, int chunkZ ) + private Iterable getNearByMeteorites( final World w, final int chunkX, final int chunkZ ) { return WorldData.instance().spawnData().getNearByMeteorites( w.provider.getDimensionId(), chunkX, chunkZ ); } @@ -118,7 +118,7 @@ public final class MeteoriteWorldGen implements IWorldGenerator final int z; final int depth; - public MeteoriteSpawn( int x, int depth, int z ) + public MeteoriteSpawn( final int x, final int depth, final int z ) { this.x = x; this.z = z; @@ -126,23 +126,23 @@ public final class MeteoriteWorldGen implements IWorldGenerator } @Override - public Object call( World world ) throws Exception + public Object call( final World world ) throws Exception { - int chunkX = this.x >> 4; - int chunkZ = this.z >> 4; + final int chunkX = this.x >> 4; + final int chunkZ = this.z >> 4; double minSqDist = Double.MAX_VALUE; // near by meteorites! - for( NBTTagCompound data : MeteoriteWorldGen.this.getNearByMeteorites( world, chunkX, chunkZ ) ) + for( final NBTTagCompound data : MeteoriteWorldGen.this.getNearByMeteorites( world, chunkX, chunkZ ) ) { - MeteoritePlacer mp = new MeteoritePlacer(); + final MeteoritePlacer mp = new MeteoritePlacer(); mp.spawnMeteorite( new ChunkOnly( world, chunkX, chunkZ ), data ); minSqDist = Math.min( minSqDist, mp.getSqDistance( this.x, this.z ) ); } - boolean isCluster = ( minSqDist < 30 * 30 ) && Platform.getRandomFloat() < AEConfig.instance.meteoriteClusterChance; + final boolean isCluster = ( minSqDist < 30 * 30 ) && Platform.getRandomFloat() < AEConfig.instance.meteoriteClusterChance; if( minSqDist > AEConfig.instance.minMeteoriteDistanceSq || isCluster ) { diff --git a/src/main/java/appeng/worldgen/QuartzWorldGen.java b/src/main/java/appeng/worldgen/QuartzWorldGen.java index e0f946f3..68779cd0 100644 --- a/src/main/java/appeng/worldgen/QuartzWorldGen.java +++ b/src/main/java/appeng/worldgen/QuartzWorldGen.java @@ -54,14 +54,14 @@ public final class QuartzWorldGen implements IWorldGenerator } @Override - public void generate( Random r, int chunkX, int chunkZ, World w, IChunkProvider chunkGenerator, IChunkProvider chunkProvider ) + public void generate( final Random r, final int chunkX, final int chunkZ, final World w, final IChunkProvider chunkGenerator, final IChunkProvider chunkProvider ) { int seaLevel = w.provider.getAverageGroundLevel() + 1; if( seaLevel < 20 ) { - int x = ( chunkX << 4 ) + 8; - int z = ( chunkZ << 4 ) + 8; + final int x = ( chunkX << 4 ) + 8; + final int z = ( chunkZ << 4 ) + 8; seaLevel = (int) w.getHorizon(); } @@ -70,19 +70,19 @@ public final class QuartzWorldGen implements IWorldGenerator return; } - double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * seaLevel / 64; - int scale = (int) Math.round( r.nextGaussian() * Math.sqrt( oreDepthMultiplier ) + oreDepthMultiplier ); + final double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * seaLevel / 64; + final int scale = (int) Math.round( r.nextGaussian() * Math.sqrt( oreDepthMultiplier ) + oreDepthMultiplier ); for( int x = 0; x < ( r.nextBoolean() ? scale * 2 : scale ) / 2; ++x ) { - boolean isCharged = r.nextFloat() > AEConfig.instance.spawnChargedChance; - WorldGenMinable whichOre = isCharged ? this.oreCharged : this.oreNormal; + final boolean isCharged = r.nextFloat() > AEConfig.instance.spawnChargedChance; + final WorldGenMinable whichOre = isCharged ? this.oreCharged : this.oreNormal; if( WorldGenRegistry.INSTANCE.isWorldGenEnabled( isCharged ? WorldGenType.ChargedCertusQuartz : WorldGenType.CertusQuartz, w ) ) { - int cx = chunkX * 16 + r.nextInt( 22 ); - int cy = r.nextInt( 40 * seaLevel / 64 ) + r.nextInt( 22 * seaLevel / 64 ) + 12 * seaLevel / 64; - int cz = chunkZ * 16 + r.nextInt( 22 ); + final int cx = chunkX * 16 + r.nextInt( 22 ); + final int cy = r.nextInt( 40 * seaLevel / 64 ) + r.nextInt( 22 * seaLevel / 64 ) + 12 * seaLevel / 64; + final int cz = chunkZ * 16 + r.nextInt( 22 ); whichOre.generate( w, r, new BlockPos( cx, cy, cz ) ); } } diff --git a/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java b/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java index 71217b70..3c62e88e 100644 --- a/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java +++ b/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java @@ -17,7 +17,7 @@ public class ChunkOnly extends StandardWorld final int cz; int verticalBits = 0; - public ChunkOnly( World w, int cx, int cz ) + public ChunkOnly( final World w, final int cx, final int cz ) { super( w ); this.target = w.getChunkFromChunkCoords( cx, cz ); @@ -26,31 +26,31 @@ public class ChunkOnly extends StandardWorld } @Override - public int minX( int in ) + public int minX( final int in ) { return Math.max( in, this.cx << 4 ); } @Override - public int minZ( int in ) + public int minZ( final int in ) { return Math.max( in, this.cz << 4 ); } @Override - public int maxX( int in ) + public int maxX( final int in ) { return Math.min( in, ( this.cx + 1 ) << 4 ); } @Override - public int maxZ( int in ) + public int maxZ( final int in ) { return Math.min( in, ( this.cz + 1 ) << 4 ); } @Override - public Block getBlock( int x, int y, int z ) + public Block getBlock( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -60,7 +60,7 @@ public class ChunkOnly extends StandardWorld } @Override - public void setBlock( int x, int y, int z, Block blk ) + public void setBlock( final int x, final int y, final int z, final Block blk ) { if( this.range( x, y, z ) ) { @@ -70,7 +70,7 @@ public class ChunkOnly extends StandardWorld } @Override - public void setBlock( int x, int y, int z, IBlockState state, int flags ) + public void setBlock( final int x, final int y, final int z, final IBlockState state, final int flags ) { if( this.range( x, y, z ) ) { @@ -89,7 +89,7 @@ public class ChunkOnly extends StandardWorld } @Override - public boolean range( int x, int y, int z ) + public boolean range( final int x, final int y, final int z ) { return this.cx == ( x >> 4 ) && this.cz == ( z >> 4 ); } diff --git a/src/main/java/appeng/worldgen/meteorite/Fallout.java b/src/main/java/appeng/worldgen/meteorite/Fallout.java index 3db4b782..13850b61 100644 --- a/src/main/java/appeng/worldgen/meteorite/Fallout.java +++ b/src/main/java/appeng/worldgen/meteorite/Fallout.java @@ -12,7 +12,7 @@ public class Fallout private final MeteoriteBlockPutter putter; private final IBlockDefinition skyStoneDefinition; - public Fallout( MeteoriteBlockPutter putter, IBlockDefinition skyStoneDefinition ) + public Fallout( final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition ) { this.putter = putter; this.skyStoneDefinition = skyStoneDefinition; @@ -23,9 +23,9 @@ public class Fallout return 0; } - public void getRandomFall( IMeteoriteWorld w, int x, int y, int z ) + public void getRandomFall( final IMeteoriteWorld w, final int x, final int y, final int z ) { - double a = Math.random(); + final double a = Math.random(); if( a > 0.9 ) { this.putter.put( w, x, y, z, Blocks.stone ); @@ -44,9 +44,9 @@ public class Fallout } } - public void getRandomInset( IMeteoriteWorld w, int x, int y, int z ) + public void getRandomInset( final IMeteoriteWorld w, final int x, final int y, final int z ) { - double a = Math.random(); + final double a = Math.random(); if( a > 0.9 ) { this.putter.put( w, x, y, z, Blocks.cobblestone ); @@ -61,7 +61,7 @@ public class Fallout } else if( a > 0.6 ) { - for( Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) + for( final Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() ) { this.putter.put( w, x, y, z, skyStoneBlock ); } diff --git a/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java b/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java index a34a34c4..a591431e 100644 --- a/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java +++ b/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java @@ -15,7 +15,7 @@ public class FalloutCopy extends Fallout private final IBlockState block; private final MeteoriteBlockPutter putter; - public FalloutCopy( IMeteoriteWorld w, int x, int y, int z, MeteoriteBlockPutter putter, IBlockDefinition skyStoneDefinition ) + public FalloutCopy( final IMeteoriteWorld w, final int x, final int y, final int z, final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition ) { super( putter, skyStoneDefinition ); this.putter = putter; @@ -23,9 +23,9 @@ public class FalloutCopy extends Fallout } @Override - public void getRandomFall( IMeteoriteWorld w, int x, int y, int z ) + public void getRandomFall( final IMeteoriteWorld w, final int x, final int y, final int z ) { - double a = Math.random(); + final double a = Math.random(); if( a > SPECIFIED_BLOCK_THRESHOLD ) { this.putter.put( w, x, y, z, this.block, 3 ); @@ -36,15 +36,15 @@ public class FalloutCopy extends Fallout } } - public void getOther( IMeteoriteWorld w, int x, int y, int z, double a ) + public void getOther( final IMeteoriteWorld w, final int x, final int y, final int z, final double a ) { } @Override - public void getRandomInset( IMeteoriteWorld w, int x, int y, int z ) + public void getRandomInset( final IMeteoriteWorld w, final int x, final int y, final int z ) { - double a = Math.random(); + final double a = Math.random(); if( a > SPECIFIED_BLOCK_THRESHOLD ) { this.putter.put( w, x, y, z, this.block, 3 ); diff --git a/src/main/java/appeng/worldgen/meteorite/FalloutSand.java b/src/main/java/appeng/worldgen/meteorite/FalloutSand.java index c8ea8434..af2a6745 100644 --- a/src/main/java/appeng/worldgen/meteorite/FalloutSand.java +++ b/src/main/java/appeng/worldgen/meteorite/FalloutSand.java @@ -10,7 +10,7 @@ public class FalloutSand extends FalloutCopy public static final double GLASS_THRESHOLD = 0.66; private final MeteoriteBlockPutter putter; - public FalloutSand( IMeteoriteWorld w, int x, int y, int z, MeteoriteBlockPutter putter, IBlockDefinition skyStoneDefinition ) + public FalloutSand( final IMeteoriteWorld w, final int x, final int y, final int z, final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition ) { super( w, x, y, z, putter, skyStoneDefinition ); this.putter = putter; @@ -23,7 +23,7 @@ public class FalloutSand extends FalloutCopy } @Override - public void getOther( IMeteoriteWorld w, int x, int y, int z, double a ) + public void getOther( final IMeteoriteWorld w, final int x, final int y, final int z, final double a ) { if( a > GLASS_THRESHOLD ) { diff --git a/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java b/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java index 17783fa7..bb1b8ddc 100644 --- a/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java +++ b/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java @@ -11,7 +11,7 @@ public class FalloutSnow extends FalloutCopy public static final double ICE_THRESHOLD = 0.5; private final MeteoriteBlockPutter putter; - public FalloutSnow( IMeteoriteWorld w, int x, int y, int z, MeteoriteBlockPutter putter, IBlockDefinition skyStoneDefinition ) + public FalloutSnow( final IMeteoriteWorld w, final int x, final int y, final int z, final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition ) { super( w, x, y, z, putter, skyStoneDefinition ); this.putter = putter; @@ -24,7 +24,7 @@ public class FalloutSnow extends FalloutCopy } @Override - public void getOther( IMeteoriteWorld w, int x, int y, int z, double a ) + public void getOther( final IMeteoriteWorld w, final int x, final int y, final int z, final double a ) { if( a > SNOW_THRESHOLD ) { diff --git a/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java b/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java index 9b6814ba..a42a0a99 100644 --- a/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java +++ b/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java @@ -8,9 +8,9 @@ import net.minecraft.init.Blocks; public class MeteoriteBlockPutter { - public boolean put( IMeteoriteWorld w, int i, int j, int k, Block blk ) + public boolean put( final IMeteoriteWorld w, final int i, final int j, final int k, final Block blk ) { - Block original = w.getBlock( i, j, k ); + final Block original = w.getBlock( i, j, k ); if( original == Blocks.bedrock || original == blk ) { @@ -21,7 +21,7 @@ public class MeteoriteBlockPutter return true; } - public void put( IMeteoriteWorld w, int i, int j, int k, IBlockState state, int meta ) + public void put( final IMeteoriteWorld w, final int i, final int j, final int k, final IBlockState state, final int meta ) { if( w.getBlock( i, j, k ) == Blocks.bedrock ) { diff --git a/src/main/java/appeng/worldgen/meteorite/StandardWorld.java b/src/main/java/appeng/worldgen/meteorite/StandardWorld.java index 1b2bdb19..d20d8c61 100644 --- a/src/main/java/appeng/worldgen/meteorite/StandardWorld.java +++ b/src/main/java/appeng/worldgen/meteorite/StandardWorld.java @@ -15,31 +15,31 @@ public class StandardWorld implements IMeteoriteWorld protected final World w; - public StandardWorld( World w ) + public StandardWorld( final World w ) { this.w = w; } @Override - public int minX( int in ) + public int minX( final int in ) { return in; } @Override - public int minZ( int in ) + public int minZ( final int in ) { return in; } @Override - public int maxX( int in ) + public int maxX( final int in ) { return in; } @Override - public int maxZ( int in ) + public int maxZ( final int in ) { return in; } @@ -51,7 +51,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public Block getBlock( int x, int y, int z ) + public Block getBlock( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -61,7 +61,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public boolean canBlockSeeTheSky( int x, int y, int z ) + public boolean canBlockSeeTheSky( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -71,7 +71,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public TileEntity getTileEntity( int x, int y, int z ) + public TileEntity getTileEntity( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { @@ -87,7 +87,7 @@ public class StandardWorld implements IMeteoriteWorld } @Override - public void setBlock( int x, int y, int z, Block blk ) + public void setBlock( final int x, final int y, final int z, final Block blk ) { if( this.range( x, y, z ) ) { @@ -101,18 +101,18 @@ public class StandardWorld implements IMeteoriteWorld } - public boolean range( int x, int y, int z ) + public boolean range( final int x, final int y, final int z ) { return true; } @Override public void setBlock( - int x, - int y, - int z, - IBlockState state, - int l ) + final int x, + final int y, + final int z, + final IBlockState state, + final int l ) { if( this.range( x, y, z ) ) { @@ -122,9 +122,9 @@ public class StandardWorld implements IMeteoriteWorld @Override public IBlockState getBlockState( - int x, - int y, - int z ) + final int x, + final int y, + final int z ) { if( this.range( x, y, z ) ) {