Changed access to use this qualifier
This commit is contained in:
@@ -56,45 +56,45 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable
|
||||
@TileEvent(TileEventType.WORLD_NBT_WRITE)
|
||||
public void writeToNBT_TileSpatialIOPort(NBTTagCompound data)
|
||||
{
|
||||
data.setInteger( "lastRedstoneState", lastRedstoneState.ordinal() );
|
||||
data.setInteger( "lastRedstoneState", this.lastRedstoneState.ordinal() );
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.WORLD_NBT_READ)
|
||||
public void readFromNBT_TileSpatialIOPort(NBTTagCompound data)
|
||||
{
|
||||
if ( data.hasKey( "lastRedstoneState" ) )
|
||||
lastRedstoneState = YesNo.values()[data.getInteger( "lastRedstoneState" )];
|
||||
this.lastRedstoneState = YesNo.values()[data.getInteger( "lastRedstoneState" )];
|
||||
}
|
||||
|
||||
public TileSpatialIOPort() {
|
||||
gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
}
|
||||
|
||||
public void updateRedstoneState()
|
||||
{
|
||||
YesNo currentState = worldObj.isBlockIndirectlyGettingPowered( xCoord, yCoord, zCoord ) ? YesNo.YES : YesNo.NO;
|
||||
if ( lastRedstoneState != currentState )
|
||||
YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( this.xCoord, this.yCoord, this.zCoord ) ? YesNo.YES : YesNo.NO;
|
||||
if ( this.lastRedstoneState != currentState )
|
||||
{
|
||||
lastRedstoneState = currentState;
|
||||
if ( lastRedstoneState == YesNo.YES )
|
||||
triggerTransition();
|
||||
this.lastRedstoneState = currentState;
|
||||
if ( this.lastRedstoneState == YesNo.YES )
|
||||
this.triggerTransition();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getRedstoneState()
|
||||
{
|
||||
if ( lastRedstoneState == YesNo.UNDECIDED )
|
||||
updateRedstoneState();
|
||||
if ( this.lastRedstoneState == YesNo.UNDECIDED )
|
||||
this.updateRedstoneState();
|
||||
|
||||
return lastRedstoneState == YesNo.YES;
|
||||
return this.lastRedstoneState == YesNo.YES;
|
||||
}
|
||||
|
||||
private void triggerTransition()
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
{
|
||||
ItemStack cell = getStackInSlot( 0 );
|
||||
if ( isSpatialCell( cell ) )
|
||||
ItemStack cell = this.getStackInSlot( 0 );
|
||||
if ( this.isSpatialCell( cell ) )
|
||||
{
|
||||
TickHandler.instance.addCallable( null, this );// this needs to be cross world synced.
|
||||
}
|
||||
@@ -105,11 +105,11 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable
|
||||
public Object call() throws Exception
|
||||
{
|
||||
|
||||
ItemStack cell = getStackInSlot( 0 );
|
||||
if ( isSpatialCell( cell ) && getStackInSlot( 1 ) == null )
|
||||
ItemStack cell = this.getStackInSlot( 0 );
|
||||
if ( this.isSpatialCell( cell ) && this.getStackInSlot( 1 ) == null )
|
||||
{
|
||||
IGrid gi = gridProxy.getGrid();
|
||||
IEnergyGrid energy = gridProxy.getEnergy();
|
||||
IGrid gi = this.gridProxy.getGrid();
|
||||
IEnergyGrid energy = this.gridProxy.getEnergy();
|
||||
|
||||
ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem();
|
||||
|
||||
@@ -123,12 +123,12 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable
|
||||
MENetworkEvent res = gi.postEvent( new MENetworkSpatialEvent( this, req ) );
|
||||
if ( !res.isCanceled() )
|
||||
{
|
||||
TransitionResult tr = sc.doSpatialTransition( cell, worldObj, spc.getMin(), spc.getMax(), true );
|
||||
TransitionResult tr = sc.doSpatialTransition( cell, this.worldObj, spc.getMin(), spc.getMax(), true );
|
||||
if ( tr.success )
|
||||
{
|
||||
energy.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG );
|
||||
setInventorySlotContents( 0, null );
|
||||
setInventorySlotContents( 1, cell );
|
||||
this.setInventorySlotContents( 0, null );
|
||||
this.setInventorySlotContents( 1, cell );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,13 +153,13 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable
|
||||
@Override
|
||||
public IInventory getInternalInventory()
|
||||
{
|
||||
return inv;
|
||||
return this.inv;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack)
|
||||
{
|
||||
return (i == 0 && isSpatialCell( itemstack ));
|
||||
return (i == 0 && this.isSpatialCell( itemstack ));
|
||||
}
|
||||
|
||||
private boolean isSpatialCell(ItemStack cell)
|
||||
@@ -175,7 +175,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, int j)
|
||||
{
|
||||
return isItemValidForSlot( i, itemstack );
|
||||
return this.isItemValidForSlot( i, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,7 +193,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide(ForgeDirection side)
|
||||
{
|
||||
return sides;
|
||||
return this.sides;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
@Override
|
||||
protected AENetworkProxy createProxy()
|
||||
{
|
||||
return new AENetworkProxyMultiblock( this, "proxy", getItemFromTile( this ), true );
|
||||
return new AENetworkProxyMultiblock( this, "proxy", this.getItemFromTile( this ), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,46 +73,46 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
@TileEvent(TileEventType.NETWORK_READ)
|
||||
public boolean readFromStream_TileSpatialPylon(ByteBuf data)
|
||||
{
|
||||
int old = displayBits;
|
||||
displayBits = data.readByte();
|
||||
return old != displayBits;
|
||||
int old = this.displayBits;
|
||||
this.displayBits = data.readByte();
|
||||
return old != this.displayBits;
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.NETWORK_WRITE)
|
||||
public void writeToStream_TileSpatialPylon(ByteBuf data)
|
||||
{
|
||||
data.writeByte( displayBits );
|
||||
data.writeByte( this.displayBits );
|
||||
}
|
||||
|
||||
public TileSpatialPylon() {
|
||||
gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.MULTIBLOCK );
|
||||
gridProxy.setIdlePowerUsage( 0.5 );
|
||||
gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) );
|
||||
this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.MULTIBLOCK );
|
||||
this.gridProxy.setIdlePowerUsage( 0.5 );
|
||||
this.gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReady()
|
||||
{
|
||||
super.onReady();
|
||||
onNeighborBlockChange();
|
||||
this.onNeighborBlockChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markForUpdate()
|
||||
{
|
||||
super.markForUpdate();
|
||||
boolean hasLight = getLightValue() > 0;
|
||||
if ( hasLight != didHaveLight )
|
||||
boolean hasLight = this.getLightValue() > 0;
|
||||
if ( hasLight != this.didHaveLight )
|
||||
{
|
||||
didHaveLight = hasLight;
|
||||
worldObj.func_147451_t( xCoord, yCoord, zCoord );
|
||||
this.didHaveLight = hasLight;
|
||||
this.worldObj.func_147451_t( this.xCoord, this.yCoord, this.zCoord );
|
||||
// worldObj.updateAllLightTypes( xCoord, yCoord, zCoord );
|
||||
}
|
||||
}
|
||||
|
||||
public int getLightValue()
|
||||
{
|
||||
if ( (displayBits & DISPLAY_POWERED_ENABLED) == DISPLAY_POWERED_ENABLED )
|
||||
if ( (this.displayBits & this.DISPLAY_POWERED_ENABLED) == this.DISPLAY_POWERED_ENABLED )
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
@@ -122,78 +122,78 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender(MENetworkPowerStatusChange c)
|
||||
{
|
||||
recalculateDisplay();
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void activeRender(MENetworkChannelsChanged c)
|
||||
{
|
||||
recalculateDisplay();
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
disconnect( false );
|
||||
this.disconnect( false );
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
disconnect( false );
|
||||
this.disconnect( false );
|
||||
super.onChunkUnload();
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange()
|
||||
{
|
||||
calc.calculateMultiblock( worldObj, getLocation() );
|
||||
this.calc.calculateMultiblock( this.worldObj, this.getLocation() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpatialPylonCluster getCluster()
|
||||
{
|
||||
return cluster;
|
||||
return this.cluster;
|
||||
}
|
||||
|
||||
public void recalculateDisplay()
|
||||
{
|
||||
int oldBits = displayBits;
|
||||
int oldBits = this.displayBits;
|
||||
|
||||
displayBits = 0;
|
||||
this.displayBits = 0;
|
||||
|
||||
if ( cluster != null )
|
||||
if ( this.cluster != null )
|
||||
{
|
||||
if ( cluster.min.equals( getLocation() ) )
|
||||
displayBits = DISPLAY_END_MIN;
|
||||
else if ( cluster.max.equals( getLocation() ) )
|
||||
displayBits = DISPLAY_END_MAX;
|
||||
if ( this.cluster.min.equals( this.getLocation() ) )
|
||||
this.displayBits = this.DISPLAY_END_MIN;
|
||||
else if ( this.cluster.max.equals( this.getLocation() ) )
|
||||
this.displayBits = this.DISPLAY_END_MAX;
|
||||
else
|
||||
displayBits = DISPLAY_MIDDLE;
|
||||
this.displayBits = this.DISPLAY_MIDDLE;
|
||||
|
||||
switch (cluster.currentAxis)
|
||||
switch (this.cluster.currentAxis)
|
||||
{
|
||||
case X:
|
||||
displayBits |= DISPLAY_X;
|
||||
this.displayBits |= this.DISPLAY_X;
|
||||
break;
|
||||
case Y:
|
||||
displayBits |= DISPLAY_Y;
|
||||
this.displayBits |= this.DISPLAY_Y;
|
||||
break;
|
||||
case Z:
|
||||
displayBits |= DISPLAY_Z;
|
||||
this.displayBits |= this.DISPLAY_Z;
|
||||
break;
|
||||
default:
|
||||
displayBits = 0;
|
||||
this.displayBits = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if ( gridProxy.getEnergy().isNetworkPowered() )
|
||||
displayBits |= DISPLAY_POWERED_ENABLED;
|
||||
if ( this.gridProxy.getEnergy().isNetworkPowered() )
|
||||
this.displayBits |= this.DISPLAY_POWERED_ENABLED;
|
||||
|
||||
if ( cluster.isValid && gridProxy.isActive() )
|
||||
displayBits |= DISPLAY_ENABLED;
|
||||
if ( this.cluster.isValid && this.gridProxy.isActive() )
|
||||
this.displayBits |= this.DISPLAY_ENABLED;
|
||||
}
|
||||
catch (GridAccessException e)
|
||||
{
|
||||
@@ -202,24 +202,24 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
|
||||
}
|
||||
|
||||
if ( oldBits != displayBits )
|
||||
markForUpdate();
|
||||
if ( oldBits != this.displayBits )
|
||||
this.markForUpdate();
|
||||
}
|
||||
|
||||
public void updateStatus(SpatialPylonCluster c)
|
||||
{
|
||||
cluster = c;
|
||||
gridProxy.setValidSides( c == null ? EnumSet.noneOf( ForgeDirection.class ) : EnumSet.allOf( ForgeDirection.class ) );
|
||||
recalculateDisplay();
|
||||
this.cluster = c;
|
||||
this.gridProxy.setValidSides( c == null ? EnumSet.noneOf( ForgeDirection.class ) : EnumSet.allOf( ForgeDirection.class ) );
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnect(boolean b)
|
||||
{
|
||||
if ( cluster != null )
|
||||
if ( this.cluster != null )
|
||||
{
|
||||
cluster.destroy();
|
||||
updateStatus( null );
|
||||
this.cluster.destroy();
|
||||
this.updateStatus( null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
|
||||
public int getDisplayBits()
|
||||
{
|
||||
return displayBits;
|
||||
return this.displayBits;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user