final variables and parameters
seeing some methods it does actually help to enforce the parameters
This commit is contained in:
@@ -105,7 +105,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 );
|
||||
@@ -116,14 +116,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;
|
||||
@@ -132,7 +132,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
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void updateChannels( MENetworkChannelsChanged changedChannels )
|
||||
public void updateChannels( final MENetworkChannelsChanged changedChannels )
|
||||
{
|
||||
this.updateStatus();
|
||||
}
|
||||
@@ -152,14 +152,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 );
|
||||
|
||||
@@ -177,7 +177,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" );
|
||||
@@ -185,7 +185,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" );
|
||||
@@ -193,7 +193,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" ) )
|
||||
{
|
||||
@@ -203,7 +203,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().getWorldObj() == null || this.host.getTile().getWorldObj().isRemote )
|
||||
{
|
||||
@@ -223,20 +223,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<IAEItemStack> monitor, Iterable<IAEItemStack> change, BaseActionSource source )
|
||||
public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final BaseActionSource source )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -245,7 +245,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 )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
@@ -258,7 +258,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 );
|
||||
@@ -267,7 +267,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final RenderBlocks renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
@@ -283,7 +283,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderStatic( final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer )
|
||||
{
|
||||
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
@@ -320,7 +320,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() )
|
||||
{
|
||||
@@ -337,13 +337,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 )
|
||||
{
|
||||
@@ -360,10 +360,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<IAEItemStack> in = this.getInternalHandler();
|
||||
final IMEInventory<IAEItemStack> in = this.getInternalHandler();
|
||||
IItemList<IAEItemStack> before = AEApi.instance().storage().createItemList();
|
||||
if( in != null )
|
||||
{
|
||||
@@ -376,7 +376,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
this.handlerHash = 0;
|
||||
}
|
||||
|
||||
IMEInventory<IAEItemStack> out = this.getInternalHandler();
|
||||
final IMEInventory<IAEItemStack> out = this.getInternalHandler();
|
||||
|
||||
if( this.monitor != null )
|
||||
{
|
||||
@@ -399,13 +399,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.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ );
|
||||
final TileEntity self = this.getHost().getTile();
|
||||
final TileEntity target = self.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ );
|
||||
|
||||
int newHandlerHash = Platform.generateTileHash( target );
|
||||
final int newHandlerHash = Platform.generateTileHash( target );
|
||||
|
||||
if( this.handlerHash == newHandlerHash && this.handlerHash != 0 )
|
||||
{
|
||||
@@ -417,7 +417,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
|
||||
}
|
||||
@@ -427,14 +427,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.getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
final IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
if( esh != null )
|
||||
{
|
||||
IMEInventory inv = esh.getInventory( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
final IMEInventory inv = esh.getInventory( target, this.side.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 );
|
||||
}
|
||||
@@ -454,12 +454,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<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
||||
final IItemList<IAEItemStack> 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 );
|
||||
@@ -488,7 +488,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() );
|
||||
@@ -498,7 +498,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
tm.wakeDevice( this.proxy.getNode() );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
@@ -507,7 +507,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
return this.handler;
|
||||
}
|
||||
|
||||
private void checkInterfaceVsStorageBus( TileEntity target, ForgeDirection side )
|
||||
private void checkInterfaceVsStorageBus( final TileEntity target, final ForgeDirection side )
|
||||
{
|
||||
IInterfaceHost achievement = null;
|
||||
|
||||
@@ -518,7 +518,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;
|
||||
@@ -533,11 +533,11 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IMEInventoryHandler> getCellArray( StorageChannel channel )
|
||||
public List<IMEInventoryHandler> 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 );
|
||||
@@ -553,7 +553,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();
|
||||
@@ -561,19 +561,19 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blinkCell( int slot )
|
||||
public void blinkCell( final int slot )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method( iname = IntegrationType.BuildCraftTransport )
|
||||
public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
public ConnectOverride overridePipeConnection( final PipeType type, final ForgeDirection with )
|
||||
{
|
||||
return type == PipeType.ITEM && with == this.side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChanges( IMEInventory cellInventory )
|
||||
public void saveChanges( final IMEInventory cellInventory )
|
||||
{
|
||||
// nope!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user