final variables and parameters
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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 ) )
|
||||
{
|
||||
|
||||
@@ -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<ItemStack> obtainBlockDrops( WorldServer w, BlockPos pos )
|
||||
protected List<ItemStack> 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<ItemStack> items )
|
||||
protected float calculateEnergyUsage( final WorldServer w, final BlockPos pos, final List<ItemStack> 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<ItemStack> itemStacks )
|
||||
protected boolean canStoreItemStacks( final List<ItemStack> 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<ItemStack> items )
|
||||
protected void breakBlockAndStoreItems( final WorldServer w, final BlockPos pos, final List<ItemStack> items )
|
||||
{
|
||||
w.setBlockToAir( pos );
|
||||
|
||||
|
||||
@@ -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<IAEItemStack> inv, IAEItemStack ais )
|
||||
private void pushItemIntoTarget( final InventoryAdaptor d, final IEnergyGrid energy, final IMEInventory<IAEItemStack> 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 )
|
||||
{
|
||||
|
||||
@@ -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<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 );
|
||||
@@ -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<IMEInventoryHandler> getCellArray( StorageChannel channel )
|
||||
public List<IMEInventoryHandler> getCellArray( final StorageChannel channel )
|
||||
{
|
||||
if( this.proxy.isActive() && channel == StorageChannel.ITEMS )
|
||||
{
|
||||
List<IMEInventoryHandler> Handler = new ArrayList<IMEInventoryHandler>( 1 );
|
||||
final List<IMEInventoryHandler> Handler = new ArrayList<IMEInventoryHandler>( 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<IAEItemStack> getAvailableItems( IItemList<IAEItemStack> out )
|
||||
public IItemList<IAEItemStack> getAvailableItems( final IItemList<IAEItemStack> 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!
|
||||
}
|
||||
|
||||
@@ -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<ItemStack> items )
|
||||
protected float calculateEnergyUsage( final WorldServer w, final BlockPos pos, final List<ItemStack> items )
|
||||
{
|
||||
final float requiredEnergy = super.calculateEnergyUsage( w, pos, items );
|
||||
|
||||
@@ -79,7 +79,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ItemStack> obtainBlockDrops( WorldServer w, BlockPos pos )
|
||||
protected List<ItemStack> 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;
|
||||
|
||||
@@ -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<IAEItemStack> inv, IEnergySource energy, FuzzyMode fzMode )
|
||||
private boolean importStuff( final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, final IMEMonitor<IAEItemStack> 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<IAEItemStack> inv, FuzzyMode fzMode )
|
||||
private int calculateMaximumAmountToImport( final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, final IMEMonitor<IAEItemStack> 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<IAEItemStack> itemInventory )
|
||||
private IInventoryDestination configDestination( final IMEMonitor<IAEItemStack> itemInventory )
|
||||
{
|
||||
this.destination = itemInventory;
|
||||
return this;
|
||||
|
||||
@@ -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<IAEItemStack> monitor )
|
||||
private void updateReportingValue( final IMEMonitor<IAEItemStack> 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<IAEItemStack> fuzzyList = monitor.getStorageList().findFuzzy( myStack, fzMode );
|
||||
for( IAEItemStack st : fuzzyList )
|
||||
final FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE );
|
||||
final Collection<IAEItemStack> 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<IAEItemStack> monitor, Iterable<IAEItemStack> change, BaseActionSource actionSource )
|
||||
public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final BaseActionSource actionSource )
|
||||
{
|
||||
this.updateReportingValue( (IMEMonitor<IAEItemStack>) 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 );
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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<ItemStack> drops, boolean wrenched )
|
||||
public void getDrops( final List<ItemStack> 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" ) )
|
||||
{
|
||||
|
||||
@@ -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 ) )
|
||||
{
|
||||
|
||||
@@ -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() )
|
||||
|
||||
Reference in New Issue
Block a user