Puts everywhere brackets

This commit is contained in:
thatsIch
2015-04-29 02:30:53 +02:00
parent 23aa8fd72d
commit 64ed05a1b4
465 changed files with 6726 additions and 14 deletions
@@ -90,7 +90,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
for( AEColor col : AEColor.values() )
{
if( col == AEColor.Transparent )
{
continue;
}
ORE_TO_COLOR.put( OreDictionary.getOreID( "dye" + col.name() ), col );
}
@@ -101,7 +103,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
super( AEConfig.instance.colorApplicatorBattery, Optional.<String>absent() );
this.setFeature( EnumSet.of( AEFeature.ColorApplicator, AEFeature.PoweredTools ) );
if( Platform.isClient() )
{
MinecraftForgeClient.registerItemRenderer( this, new ToolColorApplicatorRender() );
}
}
@Override
@@ -130,10 +134,14 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
paintBall.stackSize = 1;
}
else
{
paintBall = null;
}
if( !Platform.hasPermissions( new DimensionalCoord( w, x, y, z ), p ) )
{
return false;
}
if( paintBall != null && paintBall.getItem() instanceof ItemSnowball )
{
@@ -196,7 +204,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
AEColor selected = this.getActiveColor( par1ItemStack );
if( selected != null && Platform.isClient() )
{
extra = Platform.gui_localize( selected.unlocalizedName );
}
return super.getItemStackDisplayName( par1ItemStack ) + " - " + extra;
}
@@ -209,10 +219,14 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
public AEColor getColorFromItem( ItemStack paintBall )
{
if( paintBall == null )
{
return null;
}
if( paintBall.getItem() instanceof ItemSnowball )
{
return AEColor.Transparent;
}
if( paintBall.getItem() instanceof ItemPaintBall )
{
@@ -226,7 +240,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
for( int oreID : id )
{
if( ORE_TO_COLOR.containsKey( oreID ) )
{
return ORE_TO_COLOR.get( oreID );
}
}
}
@@ -241,7 +257,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
NBTTagCompound color = c.getCompoundTag( "color" );
ItemStack oldColor = ItemStack.loadItemStackFromNBT( color );
if( oldColor != null )
{
return oldColor;
}
}
return this.findNextColor( is, null, 0 );
@@ -259,14 +277,18 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
{
IAEItemStack firstItem = itemList.getFirstItem();
if( firstItem != null )
{
newColor = firstItem.getItemStack();
}
}
else
{
LinkedList<IAEItemStack> list = new LinkedList<IAEItemStack>();
for( IAEItemStack i : itemList )
{
list.add( i );
}
Collections.sort( list, new Comparator<IAEItemStack>()
{
@@ -279,7 +301,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
} );
if( list.size() <= 0 )
{
return null;
}
IAEItemStack where = list.getFirst();
int cycles = 1 + list.size();
@@ -292,17 +316,23 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
}
if( scrollOffset > 0 )
{
list.addLast( list.removeFirst() );
}
if( scrollOffset < 0 )
{
list.addFirst( list.removeLast() );
}
return list.get( 0 ).getItemStack();
}
}
if( newColor != null )
{
this.setColor( is, newColor );
}
return newColor;
}
@@ -311,7 +341,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
{
NBTTagCompound data = Platform.openNbtData( is );
if( newColor == null )
{
data.removeTag( "color" );
}
else
{
NBTTagCompound color = new NBTTagCompound();
@@ -326,7 +358,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
{
int meta = w.getBlockMetadata( x, y, z );
if( newColor.ordinal() == meta )
{
return false;
}
return w.setBlock( x, y, z, Blocks.carpet, newColor.ordinal(), 3 );
}
@@ -339,7 +373,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
{
int meta = w.getBlockMetadata( x, y, z );
if( newColor.ordinal() == meta )
{
return false;
}
return w.setBlock( x, y, z, Blocks.stained_glass, newColor.ordinal(), 3 );
}
@@ -352,7 +388,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
{
int meta = w.getBlockMetadata( x, y, z );
if( newColor.ordinal() == meta )
{
return false;
}
return w.setBlock( x, y, z, Blocks.stained_glass_pane, newColor.ordinal(), 3 );
}
@@ -365,12 +403,16 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
{
int meta = w.getBlockMetadata( x, y, z );
if( newColor.ordinal() == meta )
{
return false;
}
return w.setBlock( x, y, z, Blocks.stained_hardened_clay, newColor.ordinal(), 3 );
}
if( blk instanceof BlockCableBus )
{
return ( (BlockCableBus) blk ).recolourBlock( w, x, y, z, side, newColor.ordinal(), p );
}
return blk.recolourBlock( w, x, y, z, side, newColor.ordinal() );
}
@@ -439,11 +481,15 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
for( int x : id )
{
if( ORE_TO_COLOR.containsKey( x ) )
{
return false;
}
}
if( requestedAddition.getItem() instanceof ItemSnowball )
{
return false;
}
return !( requestedAddition.getItem() instanceof ItemPaintBall && requestedAddition.getItemDamage() < 20 );
}
@@ -114,9 +114,13 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
public boolean equals( Object obj )
{
if( obj == null )
{
return false;
}
if( this.getClass() != obj.getClass() )
{
return false;
}
InWorldToolOperationIngredient other = (InWorldToolOperationIngredient) obj;
return this.blockID == other.blockID && this.metadata == other.metadata;
}
@@ -212,7 +216,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
MovingObjectPosition target = this.getMovingObjectPositionFromPlayer( w, p, true );
if( target == null )
{
return item;
}
else
{
if( target.typeOfHit == MovingObjectType.BLOCK )
@@ -240,7 +246,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
if( this.getAECurrentPower( item ) > 1600 )
{
if( !p.canPlayerEdit( x, y, z, side, item ) )
{
return false;
}
Block blockID = w.getBlock( x, y, z );
int metadata = w.getBlockMetadata( x, y, z );
@@ -335,7 +343,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
z += dir.offsetZ;
if( !p.canPlayerEdit( x, y, z, side, item ) )
{
return false;
}
if( w.isAirBlock( x, y, z ) )
{
@@ -121,7 +121,9 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
CellUpgrades cu = (CellUpgrades) this.getUpgradesInventory( item );
if( cu != null )
{
shots += cu.getInstalledUpgrades( Upgrades.SPEED );
}
IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( item, null, StorageChannel.ITEMS );
if( inv != null )
@@ -136,17 +138,23 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
this.extractAEPower( item, 1600 );
if( Platform.isClient() )
{
return item;
}
aeAmmo.setStackSize( 1 );
ItemStack ammo = ( (IAEItemStack) aeAmmo ).getItemStack();
if( ammo == null )
{
return item;
}
ammo.stackSize = 1;
aeAmmo = inv.extractItems( aeAmmo, Actionable.MODULATE, new PlayerSource( p, null ) );
if( aeAmmo == null )
{
return item;
}
float f = 1.0F;
float f1 = p.prevRotationPitch + ( p.rotationPitch - p.prevRotationPitch ) * f;
@@ -186,7 +194,9 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
else
{
if( Platform.isServer() )
{
p.addChatMessage( PlayerMessages.AmmoDepleted.get() );
}
return item;
}
}
@@ -213,7 +223,9 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
{
// prevent killing / flying of mounts.
if( entity1.riddenByEntity == p )
{
continue;
}
float f1 = 0.3F;
@@ -286,7 +298,9 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
int z = pos.blockZ + side.offsetZ;
if( !Platform.hasPermissions( new DimensionalCoord( w, x, y, z ), p ) )
{
return;
}
Block whatsThere = w.getBlock( x, y, z );
if( whatsThere.isReplaceable( w, x, y, z ) && w.isAirBlock( x, y, z ) )
@@ -333,7 +347,9 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
{
// prevent killing / flying of mounts.
if( entity1.riddenByEntity == p )
{
continue;
}
float f1 = 0.3F;
@@ -391,7 +407,9 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
// vec3.zCoord );
el.attackEntityFrom( dmgSrc, dmg );
if( !el.isEntityAlive() )
{
hasDestroyedSomething = true;
}
}
else if( pos.entityHit instanceof EntityItem )
{
@@ -406,7 +424,9 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
else if( pos.typeOfHit == MovingObjectType.BLOCK )
{
if( !AEConfig.instance.isFeatureEnabled( AEFeature.MassCannonBlockDamage ) )
{
penetration = 0;
}
else
{
Block b = w.getBlock( pos.blockX, pos.blockY, pos.blockZ );
@@ -498,10 +518,14 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
{
float pen = AEApi.instance().registries().matterCannon().getPenetration( requestedAddition.getItemStack() );
if( pen > 0 )
{
return false;
}
if( requestedAddition.getItem() instanceof ItemPaintBall )
{
return false;
}
return true;
}
@@ -85,13 +85,19 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
String encKey = tag.getString( "encryptionKey" );
if( encKey == null || encKey.isEmpty() )
{
lines.add( GuiText.Unlinked.getLocal() );
}
else
{
lines.add( GuiText.Linked.getLocal() );
}
}
}
else
{
lines.add( StatCollector.translateToLocal( "AppEng.GuiITooltip.Unlinked" ) );
}
}
@Override
@@ -156,7 +156,9 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
{
int requiredEU = (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( is ) - this.getAECurrentPower( is ) );
if( amount < requiredEU )
{
return 0;
}
return amount - requiredEU;
}
else
@@ -48,7 +48,9 @@ public abstract class IC2 extends AERootPoweredItem implements IElectricItemMana
double limit = this.getTransferLimit( is );
if( !ignoreTransferLimit && amount > limit )
{
addedAmt = limit;
}
return addedAmt - ( (int) this.injectExternalPower( PowerUnits.EU, is, addedAmt, simulate ) );
}