Fixed some warnings about unnecessary code

This commit is contained in:
Andrew 2014-09-28 11:55:09 -07:00
parent da90b07194
commit 94d5319038
7 changed files with 25 additions and 32 deletions

View file

@ -54,7 +54,9 @@ public class PacketCompressedNBT extends AppEngPacket
} );
in = CompressedStreamTools.read( new DataInputStream( gzReader ) );
DataInputStream inStream = new DataInputStream( gzReader );
in = CompressedStreamTools.read( inStream );
inStream.close();
}
@Override

View file

@ -221,8 +221,8 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
egc.motionY = location.motionY;
egc.motionZ = location.motionZ;
if ( location instanceof EntityItem && egc instanceof EntityItem )
((EntityItem) egc).delayBeforeCanPickup = ((EntityItem) location).delayBeforeCanPickup;
if ( location instanceof EntityItem )
egc.delayBeforeCanPickup = ((EntityItem) location).delayBeforeCanPickup;
return egc;
}

View file

@ -62,7 +62,7 @@ public class QuantumCluster implements ILocatable, IAECluster
public boolean canUseNode(long qe)
{
QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().findLocatableBySerial( qe );
if ( qc != null && qc.center instanceof TileQuantumBridge )
if ( qc != null )
{
World theWorld = qc.getCenter().getWorldObj();
if ( !qc.isDestroyed )

View file

@ -299,7 +299,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
*/
public void uploadSettings(SettingsFrom from, NBTTagCompound compound)
{
if ( compound != null && this instanceof IConfigurableObject )
if ( compound != null )
{
IConfigManager cm = ((IConfigurableObject) this).getConfigManager();
if ( cm != null )
@ -312,17 +312,14 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
pHost.setPriority( compound.getInteger( "priority" ) );
}
if ( this instanceof ISegmentedInventory )
IInventory inv = ((ISegmentedInventory) this).getInventoryByName( "config" );
if ( inv != null && inv instanceof AppEngInternalAEInventory )
{
IInventory inv = ((ISegmentedInventory) this).getInventoryByName( "config" );
if ( inv != null && inv instanceof AppEngInternalAEInventory )
{
AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv;
AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() );
tmp.readFromNBT( compound, "config" );
for (int x = 0; x < tmp.getSizeInventory(); x++)
target.setInventorySlotContents( x, tmp.getStackInSlot( x ) );
}
AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv;
AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() );
tmp.readFromNBT( compound, "config" );
for (int x = 0; x < tmp.getSizeInventory(); x++)
target.setInventorySlotContents( x, tmp.getStackInSlot( x ) );
}
}
@ -336,12 +333,9 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
{
NBTTagCompound output = new NBTTagCompound();
if ( this instanceof IConfigurableObject )
{
IConfigManager cm = this.getConfigManager();
if ( cm != null )
cm.writeToNBT( output );
}
IConfigManager cm = this.getConfigManager();
if ( cm != null )
cm.writeToNBT( output );
if ( this instanceof IPriorityHost )
{
@ -349,13 +343,10 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
output.setInteger( "priority", pHost.getPriority() );
}
if ( this instanceof ISegmentedInventory )
IInventory inv = ((ISegmentedInventory) this).getInventoryByName( "config" );
if ( inv != null && inv instanceof AppEngInternalAEInventory )
{
IInventory inv = ((ISegmentedInventory) this).getInventoryByName( "config" );
if ( inv != null && inv instanceof AppEngInternalAEInventory )
{
((AppEngInternalAEInventory) inv).writeToNBT( output, "config" );
}
((AppEngInternalAEInventory) inv).writeToNBT( output, "config" );
}
return output.hasNoTags() ? null : output;

View file

@ -35,7 +35,7 @@ public class Inscribe implements ICraftHandler, IWebsiteSerializer
final public ItemStack plateB;
final public ItemStack output;
};
}
public boolean usePlates = false;

View file

@ -61,8 +61,8 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
{
int oldState = 0;
boolean currentActive;
if ( currentActive = gridProxy.isActive() )
boolean currentActive = gridProxy.isActive();
if ( currentActive )
state |= 0x80000000;
else
state &= ~0x80000000;

View file

@ -79,7 +79,7 @@ public class ASMTweaker implements IClassTransformer
MethodNode newNode = new MethodNode( Opcodes.ACC_PUBLIC, "func_146977_a_original", mn.desc, mn.signature, new String[0] );
newNode.instructions.add( new VarInsnNode( Opcodes.ALOAD, 0 ) );
newNode.instructions.add( new VarInsnNode( Opcodes.ALOAD, 1 ) );
newNode.instructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, classNode.name, mn.name, mn.desc ) );
newNode.instructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, classNode.name, mn.name, mn.desc, false ) );
newNode.instructions.add( new InsnNode( Opcodes.RETURN ) );
log( newNode.name + newNode.desc + " - New Method" );
classNode.methods.add( newNode );
@ -101,7 +101,7 @@ public class ASMTweaker implements IClassTransformer
if ( n.name.equals( "func_146977_a" ) || (n.name.equals( "a" ) && n.desc.equals( "(Lzk;)V" )) )
{
log( n.name + n.desc + " - Invoke Virtual" );
mn.instructions.insertBefore( n, new MethodInsnNode( Opcodes.INVOKEVIRTUAL, n.owner, n.name, n.desc ) );
mn.instructions.insertBefore( n, new MethodInsnNode( Opcodes.INVOKEVIRTUAL, n.owner, n.name, n.desc, false ) );
mn.instructions.remove( in );
break;
}