final variables and parameters

This commit is contained in:
thatsIch
2015-09-30 14:24:40 +02:00
parent 059523f543
commit 8b3a954f73
732 changed files with 9253 additions and 9256 deletions
@@ -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<String> lines, boolean displayMoreInfo )
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> 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<ItemStack> others, ItemStack is )
public String getUnlocalizedGroupName( final Set<ItemStack> 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<IAEItemStack> list = inv.getAvailableItems( StorageChannel.ITEMS.createList() );
final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
final IItemList<IAEItemStack> 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 );
}
@@ -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 )
{
}
@@ -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<String> lines, boolean displayMoreInfo )
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> 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 );
@@ -50,13 +50,13 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
this.setMaxStackSize( 1 );
}
public static IPartitionList<IAEItemStack> createFilter( ItemStack[] list )
public static IPartitionList<IAEItemStack> createFilter( final ItemStack[] list )
{
IPartitionList<IAEItemStack> myPartitionList = null;
MergedPriorityList<IAEItemStack> myMergedList = new MergedPriorityList<IAEItemStack>();
final MergedPriorityList<IAEItemStack> myMergedList = new MergedPriorityList<IAEItemStack>();
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<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
final IItemList<IAEItemStack> 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() );
}