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
@@ -51,7 +51,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
this.setMaxStackSize( 1 );
if( Platform.isClient() )
{
MinecraftForgeClient.registerItemRenderer( this, new ToolBiometricCardRender() );
}
}
@Override
@@ -73,7 +75,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
if( target instanceof EntityPlayer && !par2EntityPlayer.isSneaking() )
{
if( par2EntityPlayer.capabilities.isCreativeMode )
{
is = par2EntityPlayer.getCurrentEquippedItem();
}
this.encode( is, (EntityPlayer) target );
par2EntityPlayer.swingItem();
return true;
@@ -93,9 +97,13 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
GameProfile username = this.getProfile( is );
if( username != null && username.equals( p.getGameProfile() ) )
{
this.setProfile( is, null );
}
else
{
this.setProfile( is, p.getGameProfile() );
}
}
@Override
@@ -110,7 +118,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
tag.setTag( "profile", pNBT );
}
else
{
tag.removeTag( "profile" );
}
}
@Override
@@ -118,7 +128,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
{
NBTTagCompound tag = Platform.openNbtData( is );
if( tag.hasKey( "profile" ) )
{
return NBTUtil.func_152459_a( tag.getCompoundTag( "profile" ) );
}
return null;
}
@@ -131,7 +143,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
for( SecurityPermissions sp : SecurityPermissions.values() )
{
if( tag.getBoolean( sp.name() ) )
{
result.add( sp );
}
}
return result;
@@ -149,7 +163,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
{
NBTTagCompound tag = Platform.openNbtData( itemStack );
if( tag.hasKey( permission.name() ) )
{
tag.removeTag( permission.name() );
}
}
@Override
@@ -170,7 +186,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
{
EnumSet<SecurityPermissions> perms = this.getPermissions( stack );
if( perms.isEmpty() )
{
lines.add( GuiText.NoPermissions.getLocal() );
}
else
{
String msg = null;
@@ -178,9 +196,13 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
for( SecurityPermissions sp : perms )
{
if( msg == null )
{
msg = Platform.gui_localize( sp.getUnlocalizedName() );
}
else
{
msg = msg + ", " + Platform.gui_localize( sp.getUnlocalizedName() );
}
}
lines.add( msg );
}
@@ -52,7 +52,9 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
NBTTagCompound data = this.getData( stack );
if( data.hasKey( "tooltip" ) )
{
lines.add( StatCollector.translateToLocal( this.getLocalizedName( data.getString( "tooltip" ) + ".name", data.getString( "tooltip" ) ) ) );
}
}
/**
@@ -68,11 +70,15 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
{
String l = StatCollector.translateToLocal( n );
if( !l.equals( n ) )
{
return l;
}
}
for( String n : name )
{
return n;
}
return "";
}
@@ -99,7 +105,9 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
NBTTagCompound c = Platform.openNbtData( is );
NBTTagCompound o = c.getCompoundTag( "Data" );
if( o == null )
{
o = new NBTTagCompound();
}
return (NBTTagCompound) o.copy();
}
@@ -107,7 +115,9 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
public void notifyUser( EntityPlayer player, MemoryCardMessages msg )
{
if( Platform.isClient() )
{
return;
}
switch( msg )
{
@@ -138,7 +148,9 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
return true;
}
else
{
return super.onItemUse( is, player, w, x, y, z, side, hx, hy, hz );
}
}
@Override
@@ -91,7 +91,9 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
int k = mop.blockZ;
if( w.getBlock( i, j, k ).isAir( w, i, j, k ) )
{
this.onItemUseFirst( it, p, w, 0, 0, 0, -1, 0, 0, 0 );
}
}
}
@@ -109,7 +111,9 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
if( part.part != null )
{
if( part.part instanceof INetworkToolAgent && !( (INetworkToolAgent) part.part ).showNetworkInfo( mop ) )
{
return false;
}
}
}
else if( te instanceof INetworkToolAgent && !( (INetworkToolAgent) te ).showNetworkInfo( mop ) )
@@ -135,7 +139,9 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
if( side >= 0 )
{
if( !Platform.hasPermissions( new DimensionalCoord( w, x, y, z ), p ) )
{
return false;
}
Block b = w.getBlock( x, y, z );
if( b != null && !p.isSneaking() )
@@ -155,22 +161,32 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
if( !p.isSneaking() )
{
if( p.openContainer instanceof AEBaseContainer )
{
return true;
}
TileEntity te = w.getTileEntity( x, y, z );
if( te instanceof IGridHost )
{
Platform.openGUI( p, te, ForgeDirection.getOrientation( side ), GuiBridge.GUI_NETWORK_STATUS );
}
else
{
Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_NETWORK_TOOL );
}
return true;
}
else
{
b.onBlockActivated( w, x, y, z, p, side, hitX, hitY, hitZ );
}
}
else
{
Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_NETWORK_TOOL );
}
return false;
}
@@ -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 ) );
}
@@ -55,7 +55,9 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
public boolean onItemUse( ItemStack is, EntityPlayer p, World w, int x, int y, int z, int s, float hitX, float hitY, float hitZ )
{
if( Platform.isServer() )
{
Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_QUARTZ_KNIFE );
}
return true;
}
@@ -63,7 +65,9 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
public ItemStack onItemRightClick( ItemStack it, World w, EntityPlayer p )
{
if( Platform.isServer() )
{
Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_QUARTZ_KNIFE );
}
p.swingItem();
return it;
}
@@ -58,7 +58,9 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWren
if( b != null && !player.isSneaking() && Platform.hasPermissions( new DimensionalCoord( world, x, y, z ), player ) )
{
if( Platform.isClient() )
{
return !world.isRemote;
}
ForgeDirection mySide = ForgeDirection.getOrientation( side );
if( b.rotateBlock( world, x, y, z, mySide ) )