Code cleanup

Added missing this, annotations, etc.
This commit is contained in:
yueh
2018-08-30 20:33:08 +02:00
parent fed12cb99f
commit a2091d10fe
77 changed files with 227 additions and 270 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
{
this.renderFragment = 100;
output = readFromStream( stream );
output = this.readFromStream( stream );
if( ( this.renderFragment & 1 ) == 1 )
{
@@ -57,7 +57,7 @@ public class AppEngCellInventory implements IInternalItemHandler
public ItemStack insertItem( int slot, ItemStack stack, boolean simulate )
{
this.persist( slot );
final ItemStack ret = inv.insertItem( slot, stack, simulate );
final ItemStack ret = this.inv.insertItem( slot, stack, simulate );
this.cleanup( slot );
return ret;
}
@@ -66,7 +66,7 @@ public class AppEngCellInventory implements IInternalItemHandler
public ItemStack extractItem( int slot, int amount, boolean simulate )
{
this.persist( slot );
final ItemStack ret = inv.extractItem( slot, amount, simulate );
final ItemStack ret = this.inv.extractItem( slot, amount, simulate );
this.cleanup( slot );
return ret;
}
@@ -74,13 +74,13 @@ public class AppEngCellInventory implements IInternalItemHandler
@Override
public int getSlotLimit( int slot )
{
return inv.getSlotLimit( slot );
return this.inv.getSlotLimit( slot );
}
@Override
public boolean isItemValidForSlot( int slot, ItemStack stack )
{
return inv.isItemValidForSlot( slot, stack );
return this.inv.isItemValidForSlot( slot, stack );
}
@Override
@@ -70,11 +70,11 @@ class CondenserItemInventory implements IMEMonitor<IAEItemStack>, ITickingMonito
public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final IActionSource src )
{
AEItemStack ret = null;
ItemStack slotItem = target.getOutputSlot().getStackInSlot( 0 );
ItemStack slotItem = this.target.getOutputSlot().getStackInSlot( 0 );
if( !slotItem.isEmpty() && request.isSameType( slotItem ) )
{
int count = (int) Math.min( request.getStackSize(), Integer.MAX_VALUE );
ret = AEItemStack.fromItemStack( target.getOutputSlot().extractItem( 0, count, mode == Actionable.SIMULATE ) );
ret = AEItemStack.fromItemStack( this.target.getOutputSlot().extractItem( 0, count, mode == Actionable.SIMULATE ) );
}
return ret;
}
@@ -82,9 +82,9 @@ class CondenserItemInventory implements IMEMonitor<IAEItemStack>, ITickingMonito
@Override
public IItemList<IAEItemStack> getAvailableItems( final IItemList<IAEItemStack> out )
{
if( !target.getOutputSlot().getStackInSlot( 0 ).isEmpty() )
if( !this.target.getOutputSlot().getStackInSlot( 0 ).isEmpty() )
{
out.add( AEItemStack.fromItemStack( target.getOutputSlot().getStackInSlot( 0 ) ) );
out.add( AEItemStack.fromItemStack( this.target.getOutputSlot().getStackInSlot( 0 ) ) );
}
return out;
}
@@ -351,7 +351,7 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
void outputChanged( ItemStack added, ItemStack removed )
{
itemInventory.updateOutput( added, removed );
this.itemInventory.updateOutput( added, removed );
}
@Nullable
@@ -58,7 +58,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
private static final double DILATION_SCALING = 25.0; // x4 ~ 40 AE/t at max
private static final int MIN_BURN_SPEED = 20;
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
private final IItemHandler invExt = new WrapperFilteredItemHandler( inv, new FuelSlotFilter() );
private final IItemHandler invExt = new WrapperFilteredItemHandler( this.inv, new FuelSlotFilter() );
private int burnSpeed = 100;
private double burnTime = 0;
@@ -24,7 +24,7 @@ class ForgeEnergyAdapter implements IEnergyStorage
@Override
public final int receiveEnergy( int maxReceive, boolean simulate )
{
final double offered = (double) maxReceive;
final double offered = maxReceive;
final double overflow = this.sink.injectExternalPower( PowerUnits.RF, offered, simulate ? Actionable.SIMULATE : Actionable.MODULATE );
return (int) ( maxReceive - overflow );
@@ -42,7 +42,7 @@ class TeslaEnergyAdapter implements ITeslaConsumer
public long givePower( long power, boolean simulated )
{
// Cut it down to what we can represent in a double
double offeredPower = (double) power;
double offeredPower = power;
final double overflow = this.sink.injectExternalPower( PowerUnits.RF, offeredPower, simulated ? Actionable.SIMULATE : Actionable.MODULATE );
@@ -56,7 +56,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl
{
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
private final IItemHandler invExt = new WrapperFilteredItemHandler( inv, new SpatialIOFilter() );
private final IItemHandler invExt = new WrapperFilteredItemHandler( this.inv, new SpatialIOFilter() );
private YesNo lastRedstoneState = YesNo.UNDECIDED;
public TileSpatialIOPort()
@@ -149,9 +149,9 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl
if( !res.isCanceled() )
{
int playerId = -1;
if( getProxy().getSecurity().isAvailable() )
if( this.getProxy().getSecurity().isAvailable() )
{
playerId = getProxy().getSecurity().getOwner();
playerId = this.getProxy().getSecurity().getOwner();
}
final TransitionResult tr = sc.doSpatialTransition( cell, this.world, spc.getMin(), spc.getMax(), playerId );
@@ -472,7 +472,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
if( this.cellHandler != null && this.cellHandler.getChannel() == channel )
{
return (IMEMonitor<T>) this.cellHandler;
return this.cellHandler;
}
return null;
}
@@ -878,7 +878,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
if( TileChest.this.cellHandler != null && TileChest.this.cellHandler
.getChannel() == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
{
return TANK_PROPS;
return this.TANK_PROPS;
}
return null;
}