Basic reformat, hit once, hope never again

This commit is contained in:
thatsIch
2015-04-03 08:54:31 +02:00
parent 4ff1631f89
commit d34c988c88
886 changed files with 31400 additions and 30990 deletions
@@ -71,7 +71,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
this.totalBytes = kilobytes * 1024;
this.component = whichCell;
switch ( this.component )
switch( this.component )
{
case Cell1kPart:
this.idleDrain = 0.5;
@@ -100,31 +100,25 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
{
IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
if ( inventory instanceof ICellInventoryHandler )
if( inventory instanceof ICellInventoryHandler )
{
ICellInventoryHandler handler = ( ICellInventoryHandler ) inventory;
ICellInventoryHandler handler = (ICellInventoryHandler) inventory;
ICellInventory cellInventory = handler.getCellInv();
if ( cellInventory != null )
if( cellInventory != null )
{
lines.add( cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' '
+ cellInventory.getTotalBytes() + ' '
+ GuiText.BytesUsed.getLocal() );
lines.add( cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() );
lines.add( cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal()
+ ' ' + cellInventory.getTotalItemTypes() + ' '
+ GuiText.Types.getLocal() );
lines.add( cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal() );
if ( handler.isPreformatted() )
if( handler.isPreformatted() )
{
String List = ( handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included
: GuiText.Excluded ).getLocal();
String List = ( handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded ).getLocal();
if ( handler.isFuzzy() )
if( handler.isFuzzy() )
lines.add( GuiText.Partitioned.getLocal() + " - " + List + ' ' + GuiText.Fuzzy.getLocal() );
else
lines.add( GuiText.Partitioned.getLocal() + " - " + List + ' ' + GuiText.Precise.getLocal() );
}
}
}
@@ -204,7 +198,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
{
return FuzzyMode.valueOf( fz );
}
catch ( Throwable t )
catch( Throwable t )
{
return FuzzyMode.IGNORE_ALL;
}
@@ -225,35 +219,35 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
private boolean disassembleDrive( ItemStack stack, World world, EntityPlayer player )
{
if ( player.isSneaking() )
if( player.isSneaking() )
{
if ( Platform.isClient() )
if( Platform.isClient() )
return false;
InventoryPlayer playerInventory = player.inventory;
IMEInventoryHandler inv = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
if ( inv != null && playerInventory.getCurrentItem() == stack )
if( inv != null && playerInventory.getCurrentItem() == stack )
{
InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
IItemList<IAEItemStack> list = inv.getAvailableItems( StorageChannel.ITEMS.createList() );
if ( list.isEmpty() && ia != null )
if( list.isEmpty() && ia != null )
{
playerInventory.setInventorySlotContents( playerInventory.currentItem, null );
ItemStack extraB = ia.addItems( this.component.stack( 1 ) );
if ( extraB != null )
if( extraB != null )
player.dropPlayerItemWithRandomChoice( extraB, false );
for ( ItemStack storageCellStack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() )
for( ItemStack storageCellStack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() )
{
final ItemStack extraA = ia.addItems( storageCellStack );
if ( extraA != null )
if( extraA != null )
{
player.dropPlayerItemWithRandomChoice( extraA, false );
}
}
if ( player.inventoryContainer != null )
if( player.inventoryContainer != null )
player.inventoryContainer.detectAndSendChanges();
return true;
@@ -272,7 +266,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
@Override
public ItemStack getContainerItem( ItemStack itemStack )
{
for ( ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() )
for( ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() )
{
return stack;
}
@@ -58,7 +58,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
{
WorldCoord wc = this.getStoredSize( stack );
if ( wc.x > 0 )
if( wc.x > 0 )
lines.add( GuiText.StoredSize.getLocal() + ": " + wc.x + " x " + wc.y + " x " + wc.z );
}
@@ -77,20 +77,20 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
@Override
public World getWorld( ItemStack is )
{
if ( is.hasTagCompound() )
if( is.hasTagCompound() )
{
NBTTagCompound c = is.getTagCompound();
int dim = c.getInteger( "StorageDim" );
World w = DimensionManager.getWorld( dim );
if ( w == null )
if( w == null )
{
DimensionManager.initDimension( dim );
w = DimensionManager.getWorld( dim );
}
if ( w != null )
if( w != null )
{
if ( w.provider instanceof StorageWorldProvider )
if( w.provider instanceof StorageWorldProvider )
{
return w;
}
@@ -102,10 +102,10 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
@Override
public WorldCoord getStoredSize( ItemStack is )
{
if ( is.hasTagCompound() )
if( is.hasTagCompound() )
{
NBTTagCompound c = is.getTagCompound();
if ( Platform.isServer() )
if( Platform.isServer() )
{
int dim = c.getInteger( "StorageDim" );
return WorldSettings.getInstance().getStoredSize( dim );
@@ -120,10 +120,10 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
public WorldCoord getMin( ItemStack is )
{
World w = this.getWorld( is );
if ( w != null )
if( w != null )
{
NBTTagCompound info = ( NBTTagCompound ) w.getWorldInfo().getAdditionalProperty( "storageCell" );
if ( info != null )
NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
if( info != null )
{
return new WorldCoord( info.getInteger( "minX" ), info.getInteger( "minY" ), info.getInteger( "minZ" ) );
}
@@ -135,10 +135,10 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
public WorldCoord getMax( ItemStack is )
{
World w = this.getWorld( is );
if ( w != null )
if( w != null )
{
NBTTagCompound info = ( NBTTagCompound ) w.getWorldInfo().getAdditionalProperty( "storageCell" );
if ( info != null )
NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
if( info != null )
{
return new WorldCoord( info.getInteger( "maxX" ), info.getInteger( "maxY" ), info.getInteger( "maxZ" ) );
}
@@ -159,15 +159,14 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
int floorBuffer = 64;
World destination = this.getWorld( is );
if ( ( scale.x == 0 && scale.y == 0 && scale.z == 0 ) || ( scale.x == targetX && scale.y == targetY && scale.z == targetZ ) )
if( ( scale.x == 0 && scale.y == 0 && scale.z == 0 ) || ( scale.x == targetX && scale.y == targetY && scale.z == targetZ ) )
{
if ( targetX <= maxSize && targetY <= maxSize && targetZ <= maxSize )
if( targetX <= maxSize && targetY <= maxSize && targetZ <= maxSize )
{
if ( destination == null )
if( destination == null )
destination = this.createNewWorld( is );
StorageHelper.getInstance()
.swapRegions( w, destination, min.x + 1, min.y + 1, min.z + 1, 1, floorBuffer + 1, 1, targetX - 1, targetY - 1, targetZ - 1 );
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 );
return new TransitionResult( true, 0 );
@@ -189,7 +188,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
private void setStoredSize( ItemStack is, int targetX, int targetY, int targetZ )
{
if ( is.hasTagCompound() )
if( is.hasTagCompound() )
{
NBTTagCompound c = is.getTagCompound();
int dim = c.getInteger( "StorageDim" );
@@ -199,5 +198,4 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
WorldSettings.getInstance().setStoredSize( dim, targetX, targetY, targetZ );
}
}
}
@@ -57,12 +57,12 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
MergedPriorityList<IAEItemStack> myMergedList = new MergedPriorityList<IAEItemStack>();
for ( ItemStack currentViewCell : list )
for( ItemStack currentViewCell : list )
{
if ( currentViewCell == null )
if( currentViewCell == null )
continue;
if ( ( currentViewCell.getItem() instanceof ItemViewCell ) )
if( ( currentViewCell.getItem() instanceof ItemViewCell ) )
{
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
@@ -74,15 +74,15 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
boolean hasInverter = false;
boolean hasFuzzy = false;
for ( int x = 0; x < upgrades.getSizeInventory(); x++ )
for( int x = 0; x < upgrades.getSizeInventory(); x++ )
{
ItemStack is = upgrades.getStackInSlot( x );
if ( is != null && is.getItem() instanceof IUpgradeModule )
if( is != null && is.getItem() instanceof IUpgradeModule )
{
Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is );
if ( u != null )
if( u != null )
{
switch ( u )
switch( u )
{
case FUZZY:
hasFuzzy = true;
@@ -96,16 +96,16 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
}
}
for ( int x = 0; x < config.getSizeInventory(); x++ )
for( int x = 0; x < config.getSizeInventory(); x++ )
{
ItemStack is = config.getStackInSlot( x );
if ( is != null )
if( is != null )
priorityList.add( AEItemStack.create( is ) );
}
if ( !priorityList.isEmpty() )
if( !priorityList.isEmpty() )
{
if ( hasFuzzy )
if( hasFuzzy )
myMergedList.addNewList( new FuzzyPriorityList<IAEItemStack>( priorityList, fzMode ), !hasInverter );
else
myMergedList.addNewList( new PrecisePriorityList<IAEItemStack>( priorityList ), !hasInverter );
@@ -144,7 +144,7 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
{
return FuzzyMode.valueOf( fz );
}
catch ( Throwable t )
catch( Throwable t )
{
return FuzzyMode.IGNORE_ALL;
}