Changed access to use this qualifier

This commit is contained in:
yueh
2014-12-29 15:13:47 +01:00
parent 2a5e57a59b
commit f471513bd0
604 changed files with 11573 additions and 11573 deletions
@@ -49,45 +49,45 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe
protected void setPowerSides(EnumSet<ForgeDirection> sides)
{
internalPowerSides = sides;
this.internalPowerSides = sides;
// trigger re-calc!
}
protected EnumSet<ForgeDirection> getPowerSides()
{
return internalPowerSides.clone();
return this.internalPowerSides.clone();
}
@TileEvent(TileEventType.WORLD_NBT_WRITE)
public void writeToNBT_AERootPoweredTile(NBTTagCompound data)
{
data.setDouble( "internalCurrentPower", internalCurrentPower );
data.setDouble( "internalCurrentPower", this.internalCurrentPower );
}
@TileEvent(TileEventType.WORLD_NBT_READ)
public void readFromNBT_AERootPoweredTile(NBTTagCompound data)
{
internalCurrentPower = data.getDouble( "internalCurrentPower" );
this.internalCurrentPower = data.getDouble( "internalCurrentPower" );
}
final protected double getExternalPowerDemand(PowerUnits externalUnit, double maxPowerRequired)
{
return PowerUnits.AE.convertTo( externalUnit, Math.max( 0.0, getFunnelPowerDemand( externalUnit.convertTo( PowerUnits.AE, maxPowerRequired ) ) ) );
return PowerUnits.AE.convertTo( externalUnit, Math.max( 0.0, this.getFunnelPowerDemand( externalUnit.convertTo( PowerUnits.AE, maxPowerRequired ) ) ) );
}
protected double getFunnelPowerDemand(double maxRequired)
{
return internalMaxPower - internalCurrentPower;
return this.internalMaxPower - this.internalCurrentPower;
}
final public double injectExternalPower(PowerUnits input, double amt)
{
return PowerUnits.AE.convertTo( input, funnelPowerIntoStorage( input.convertTo( PowerUnits.AE, amt ), Actionable.MODULATE ) );
return PowerUnits.AE.convertTo( input, this.funnelPowerIntoStorage( input.convertTo( PowerUnits.AE, amt ), Actionable.MODULATE ) );
}
protected double funnelPowerIntoStorage(double AEUnits, Actionable mode)
{
return injectAEPower( AEUnits, mode );
return this.injectAEPower( AEUnits, mode );
}
@Override
@@ -98,23 +98,23 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe
if ( mode == Actionable.SIMULATE )
{
double fakeBattery = internalCurrentPower + amt;
double fakeBattery = this.internalCurrentPower + amt;
if ( fakeBattery > internalMaxPower )
return fakeBattery - internalMaxPower;
if ( fakeBattery > this.internalMaxPower )
return fakeBattery - this.internalMaxPower;
return 0;
}
else
{
if ( internalCurrentPower < 0.01 && amt > 0.01 )
PowerEvent( PowerEventType.PROVIDE_POWER );
if ( this.internalCurrentPower < 0.01 && amt > 0.01 )
this.PowerEvent( PowerEventType.PROVIDE_POWER );
internalCurrentPower += amt;
if ( internalCurrentPower > internalMaxPower )
this.internalCurrentPower += amt;
if ( this.internalCurrentPower > this.internalMaxPower )
{
amt = internalCurrentPower - internalMaxPower;
internalCurrentPower = internalMaxPower;
amt = this.internalCurrentPower - this.internalMaxPower;
this.internalCurrentPower = this.internalMaxPower;
return amt;
}
@@ -131,55 +131,55 @@ public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowe
{
if ( mode == Actionable.SIMULATE )
{
if ( internalCurrentPower > amt )
if ( this.internalCurrentPower > amt )
return amt;
return internalCurrentPower;
return this.internalCurrentPower;
}
boolean wasFull = internalCurrentPower >= internalMaxPower - 0.001;
boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001;
if ( wasFull && amt > 0.001 )
{
PowerEvent( PowerEventType.REQUEST_POWER );
this.PowerEvent( PowerEventType.REQUEST_POWER );
}
if ( internalCurrentPower > amt )
if ( this.internalCurrentPower > amt )
{
internalCurrentPower -= amt;
this.internalCurrentPower -= amt;
return amt;
}
amt = internalCurrentPower;
internalCurrentPower = 0;
amt = this.internalCurrentPower;
this.internalCurrentPower = 0;
return amt;
}
@Override
final public double extractAEPower(double amt, Actionable mode, PowerMultiplier multiplier)
{
return multiplier.divide( extractAEPower( multiplier.multiply( amt ), mode ) );
return multiplier.divide( this.extractAEPower( multiplier.multiply( amt ), mode ) );
}
@Override
final public double getAEMaxPower()
{
return internalMaxPower;
return this.internalMaxPower;
}
@Override
final public double getAECurrentPower()
{
return internalCurrentPower;
return this.internalCurrentPower;
}
@Override
final public boolean isAEPublicPowerStorage()
{
return internalPublicPowerStorage;
return this.internalPublicPowerStorage;
}
@Override
final public AccessRestriction getPowerFlow()
{
return internalPowerFlow;
return this.internalPowerFlow;
}
}
+13 -13
View File
@@ -40,13 +40,13 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink
@Override
final public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
{
return getPowerSides().contains( direction );
return this.getPowerSides().contains( direction );
}
@Override
final public double getDemandedEnergy()
{
return getExternalPowerDemand( PowerUnits.EU, Double.MAX_VALUE );
return this.getExternalPowerDemand( PowerUnits.EU, Double.MAX_VALUE );
}
@Override
@@ -54,8 +54,8 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink
{
// just store the excess in the current block, if I return the waste,
// IC2 will just disintegrate it - Oct 20th 2013
double overflow = PowerUnits.EU.convertTo( PowerUnits.AE, injectExternalPower( PowerUnits.EU, amount ) );
internalCurrentPower += overflow;
double overflow = PowerUnits.EU.convertTo( PowerUnits.AE, this.injectExternalPower( PowerUnits.EU, amount ) );
this.internalCurrentPower += overflow;
return 0; // see above comment.
}
@@ -69,29 +69,29 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink
public void invalidate()
{
super.invalidate();
removeFromENet();
this.removeFromENet();
}
@Override
public void onChunkUnload()
{
super.onChunkUnload();
removeFromENet();
this.removeFromENet();
}
@Override
public void onReady()
{
super.onReady();
addToENet();
this.addToENet();
}
@Override
protected void setPowerSides(EnumSet<ForgeDirection> sides)
{
super.setPowerSides( sides );
removeFromENet();
addToENet();
this.removeFromENet();
this.addToENet();
}
private void addToENet()
@@ -99,10 +99,10 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) )
{
IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( IntegrationType.IC2 );
if ( !isInIC2 && Platform.isServer() && ic2Integration != null )
if ( !this.isInIC2 && Platform.isServer() && ic2Integration != null )
{
ic2Integration.addToEnergyNet( this );
isInIC2 = true;
this.isInIC2 = true;
}
}
}
@@ -112,10 +112,10 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) )
{
IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( IntegrationType.IC2 );
if ( isInIC2 && Platform.isServer() && ic2Integration != null )
if ( this.isInIC2 && Platform.isServer() && ic2Integration != null )
{
ic2Integration.removeFromEnergyNet( this );
isInIC2 = false;
this.isInIC2 = false;
}
}
}
@@ -33,8 +33,8 @@ public abstract class MekJoules extends RedstoneFlux implements IStrictEnergyAcc
@Override
public void setEnergy(double energy) {
double extra = injectExternalPower( PowerUnits.MK, energy );
internalCurrentPower += PowerUnits.MK.convertTo(PowerUnits.AE, extra );
double extra = this.injectExternalPower( PowerUnits.MK, energy );
this.internalCurrentPower += PowerUnits.MK.convertTo(PowerUnits.AE, extra );
}
@Override
@@ -45,17 +45,17 @@ public abstract class MekJoules extends RedstoneFlux implements IStrictEnergyAcc
@Override
public double transferEnergyToAcceptor(ForgeDirection side, double amount)
{
double demand = getExternalPowerDemand( PowerUnits.MK, Double.MAX_VALUE );
double demand = this.getExternalPowerDemand( PowerUnits.MK, Double.MAX_VALUE );
if ( amount > demand )
amount = demand;
double overflow = injectExternalPower( PowerUnits.MK, amount );
double overflow = this.injectExternalPower( PowerUnits.MK, amount );
return amount - overflow;
}
@Override
public boolean canReceiveEnergy(ForgeDirection side) {
return getPowerSides().contains(side);
return this.getPowerSides().contains(side);
}
}
@@ -44,8 +44,8 @@ public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPow
@TileEvent(TileEventType.TICK)
public void Tick_MinecraftJoules5()
{
if ( bcPowerWrapper != null )
bcPowerWrapper.Tick();
if ( this.bcPowerWrapper != null )
this.bcPowerWrapper.Tick();
}
public MinecraftJoules5() {
@@ -58,9 +58,9 @@ public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPow
IMJ5 mjIntegration = (IMJ5) AppEng.instance.getIntegration( IntegrationType.MJ5 );
if ( mjIntegration != null )
{
bcPowerWrapper = (BaseMJPerdition) mjIntegration.createPerdition( this );
if ( bcPowerWrapper != null )
bcPowerWrapper.configure( 1, 380, 1.0f / 5.0f, 1000 );
this.bcPowerWrapper = (BaseMJPerdition) mjIntegration.createPerdition( this );
if ( this.bcPowerWrapper != null )
this.bcPowerWrapper.configure( 1, 380, 1.0f / 5.0f, 1000 );
}
}
}
@@ -75,8 +75,8 @@ public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPow
@Method(iname = "MJ5")
final public PowerReceiver getPowerReceiver(ForgeDirection side)
{
if ( getPowerSides().contains( side ) && bcPowerWrapper != null )
return bcPowerWrapper.getPowerReceiver();
if ( this.getPowerSides().contains( side ) && this.bcPowerWrapper != null )
return this.bcPowerWrapper.getPowerReceiver();
return null;
}
@@ -84,17 +84,17 @@ public abstract class MinecraftJoules5 extends AERootPoweredTile implements IPow
@Method(iname = "MJ5")
final public void doWork(PowerHandler workProvider)
{
float required = (float) getExternalPowerDemand( PowerUnits.MJ, bcPowerWrapper.getPowerReceiver().getEnergyStored() );
double failed = injectExternalPower( PowerUnits.MJ, bcPowerWrapper.useEnergy( 0.0f, required, true ) );
float required = (float) this.getExternalPowerDemand( PowerUnits.MJ, this.bcPowerWrapper.getPowerReceiver().getEnergyStored() );
double failed = this.injectExternalPower( PowerUnits.MJ, this.bcPowerWrapper.useEnergy( 0.0f, required, true ) );
if ( failed > 0.01 )
bcPowerWrapper.addEnergy( (float) failed );
this.bcPowerWrapper.addEnergy( (float) failed );
}
@Override
@Method(iname = "MJ5")
final public World getWorld()
{
return worldObj;
return this.worldObj;
}
}
@@ -41,18 +41,18 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt
@Method(iname = "MJ6")
public double getEnergyRequested()
{
return getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE );
return this.getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE );
}
@Override
@Method(iname = "MJ6")
public double addEnergy(double amount)
{
double demand = getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE );
double demand = this.getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE );
if ( amount > demand )
amount = demand;
double overflow = injectExternalPower( PowerUnits.MJ, amount );
double overflow = this.injectExternalPower( PowerUnits.MJ, amount );
return amount - overflow;
}
@@ -60,7 +60,7 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt
@Method(iname = "MJ6")
public double addEnergy(double amount, boolean ignoreCycleLimit)
{
double overflow = injectExternalPower( PowerUnits.MJ, amount );
double overflow = this.injectExternalPower( PowerUnits.MJ, amount );
return amount - overflow;
}
@@ -68,21 +68,21 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt
@Method(iname = "MJ6")
public double getEnergyStored()
{
return PowerUnits.AE.convertTo( PowerUnits.MJ, internalCurrentPower );
return PowerUnits.AE.convertTo( PowerUnits.MJ, this.internalCurrentPower );
}
@Override
@Method(iname = "MJ6")
public void setEnergyStored(double mj)
{
internalCurrentPower = PowerUnits.MJ.convertTo( PowerUnits.AE, mj );
this.internalCurrentPower = PowerUnits.MJ.convertTo( PowerUnits.AE, mj );
}
@Override
@Method(iname = "MJ6")
public double maxCapacity()
{
return PowerUnits.AE.convertTo( PowerUnits.MJ, internalMaxPower );
return PowerUnits.AE.convertTo( PowerUnits.MJ, this.internalMaxPower );
}
@Override
@@ -103,7 +103,7 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt
@Method(iname = "MJ6")
public IBatteryObject reconfigure(double maxCapacity, double maxReceivedPerCycle, double minimumConsumption)
{
return getMjBattery( "" );
return this.getMjBattery( "" );
}
@Override
@@ -40,26 +40,26 @@ public abstract class RotaryCraft extends IC2 implements ShaftPowerReceiver
@Method(iname = "RotaryCraft")
public void Tick_RotaryCraft()
{
if ( worldObj != null && !worldObj.isRemote && power > 0 )
injectExternalPower( PowerUnits.WA, power );
if ( this.worldObj != null && !this.worldObj.isRemote && this.power > 0 )
this.injectExternalPower( PowerUnits.WA, this.power );
}
@Override
final public int getOmega()
{
return omega;
return this.omega;
}
@Override
final public int getTorque()
{
return torque;
return this.torque;
}
@Override
final public long getPower()
{
return power;
return this.power;
}
@Override
@@ -71,44 +71,44 @@ public abstract class RotaryCraft extends IC2 implements ShaftPowerReceiver
@Override
final public int getIORenderAlpha()
{
return alpha;
return this.alpha;
}
@Override
final public void setIORenderAlpha(int io)
{
alpha = io;
this.alpha = io;
}
@Override
final public int getMachineX()
{
return xCoord;
return this.xCoord;
}
@Override
final public int getMachineY()
{
return yCoord;
return this.yCoord;
}
@Override
final public int getMachineZ()
{
return zCoord;
return this.zCoord;
}
@Override
final public void setOmega(int o)
{
omega = o;
this.omega = o;
}
@Override
final public void setTorque(int t)
{
torque = t;
this.torque = t;
}
@Override
@@ -117,27 +117,27 @@ public abstract class RotaryCraft extends IC2 implements ShaftPowerReceiver
if ( Platform.isClient() )
return;
power = p;
this.power = p;
}
final public boolean canReadFromBlock(int x, int y, int z)
{
ForgeDirection side = ForgeDirection.UNKNOWN;
if ( x == xCoord - 1 )
if ( x == this.xCoord - 1 )
side = ForgeDirection.WEST;
else if ( x == xCoord + 1 )
else if ( x == this.xCoord + 1 )
side = ForgeDirection.EAST;
else if ( z == zCoord - 1 )
else if ( z == this.zCoord - 1 )
side = ForgeDirection.NORTH;
else if ( z == zCoord + 1 )
else if ( z == this.zCoord + 1 )
side = ForgeDirection.SOUTH;
else if ( y == yCoord - 1 )
else if ( y == this.yCoord - 1 )
side = ForgeDirection.DOWN;
else if ( y == yCoord + 1 )
else if ( y == this.yCoord + 1 )
side = ForgeDirection.UP;
return getPowerSides().contains( side );
return this.getPowerSides().contains( side );
}
@Override
@@ -149,15 +149,15 @@ public abstract class RotaryCraft extends IC2 implements ShaftPowerReceiver
@Override
final public void noInputMachine()
{
power = 0;
torque = 0;
omega = 0;
this.power = 0;
this.torque = 0;
this.omega = 0;
}
@Override
final public boolean canReadFrom(ForgeDirection side)
{
return getPowerSides().contains( side );
return this.getPowerSides().contains( side );
}
@Override