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
+35 -35
View File
@@ -82,8 +82,8 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
public AEBasePart(Class c, ItemStack is) {
this.is = is;
proxy = new AENetworkProxy( this, "part", is, this instanceof PartCable );
proxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) );
this.proxy = new AENetworkProxy( this, "part", is, this instanceof PartCable );
this.proxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) );
}
@Override
@@ -117,11 +117,11 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
{
if ( type == PartItemStack.Network )
{
ItemStack copy = is.copy();
ItemStack copy = this.is.copy();
copy.setTagCompound( null );
return copy;
}
return is;
return this.is;
}
@Override
@@ -145,13 +145,13 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
@Override
public void readFromNBT(NBTTagCompound data)
{
proxy.readFromNBT( data );
this.proxy.readFromNBT( data );
}
@Override
public void writeToNBT(NBTTagCompound data)
{
proxy.writeToNBT( data );
this.proxy.writeToNBT( data );
}
@Override
@@ -181,7 +181,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
@Override
public IGridNode getGridNode()
{
return proxy.getNode();
return this.proxy.getNode();
}
@Override
@@ -193,13 +193,13 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
@Override
public void removeFromWorld()
{
proxy.invalidate();
this.proxy.invalidate();
}
@Override
public void addToWorld()
{
proxy.onReady();
this.proxy.onReady();
}
@Override
@@ -212,7 +212,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
public IPartHost getHost()
{
return host;
return this.host;
}
@Override
@@ -224,20 +224,20 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
@Override
public IGridNode getGridNode(ForgeDirection dir)
{
return proxy.getNode();
return this.proxy.getNode();
}
protected AEColor getColor()
{
if ( getHost() == null )
if ( this.getHost() == null )
return AEColor.Transparent;
return getHost().getColor();
return this.getHost().getColor();
}
@Override
public DimensionalCoord getLocation()
{
return new DimensionalCoord( tile );
return new DimensionalCoord( this.tile );
}
@Override
@@ -377,11 +377,11 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
{
ItemStack memCardIS = player.inventory.getCurrentItem();
if ( memCardIS != null && useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard )
if ( memCardIS != null && this.useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard )
{
IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem();
ItemStack is = getItemStack( PartItemStack.Network );
ItemStack is = this.getItemStack( PartItemStack.Network );
// Blocks and parts share the same soul!
if ( AEApi.instance().parts().partInterface.sameAsStack( is ) )
@@ -391,7 +391,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
if ( player.isSneaking() )
{
NBTTagCompound data = downloadSettings( SettingsFrom.MEMORY_CARD );
NBTTagCompound data = this.downloadSettings( SettingsFrom.MEMORY_CARD );
if ( data != null )
{
memoryCard.setMemoryCardContents( memCardIS, name, data );
@@ -404,7 +404,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
NBTTagCompound data = memoryCard.getData( memCardIS );
if ( name.equals( storedName ) )
{
uploadSettings( SettingsFrom.MEMORY_CARD, data );
this.uploadSettings( SettingsFrom.MEMORY_CARD, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
}
else
@@ -418,19 +418,19 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
@Override
final public boolean onActivate(EntityPlayer player, Vec3 pos)
{
if ( useMemoryCard( player ) )
if ( this.useMemoryCard( player ) )
return true;
return onPartActivate( player, pos );
return this.onPartActivate( player, pos );
}
@Override
final public boolean onShiftActivate(EntityPlayer player, Vec3 pos)
{
if ( useMemoryCard( player ) )
if ( this.useMemoryCard( player ) )
return true;
return onPartShiftActivate( player, pos );
return this.onPartShiftActivate( player, pos );
}
public boolean onPartActivate(EntityPlayer player, Vec3 pos)
@@ -446,38 +446,38 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
@Override
public void onPlacement(EntityPlayer player, ItemStack held, ForgeDirection side)
{
proxy.setOwner( player );
this.proxy.setOwner( player );
}
@Override
public TileEntity getTile()
{
return tile;
return this.tile;
}
@Override
public void securityBreak()
{
if ( is.stackSize > 0 )
if ( this.is.stackSize > 0 )
{
List<ItemStack> items = new ArrayList<ItemStack>();
items.add( is.copy() );
host.removePart( side, false );
Platform.spawnDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, items );
is.stackSize = 0;
items.add( this.is.copy() );
this.host.removePart( this.side, false );
Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items );
this.is.stackSize = 0;
}
}
@Override
public AENetworkProxy getProxy()
{
return proxy;
return this.proxy;
}
@Override
public IGridNode getActionableNode()
{
return proxy.getNode();
return this.proxy.getNode();
}
@Override
@@ -488,7 +488,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
public void saveChanges()
{
host.markForSave();
this.host.markForSave();
}
@Override
@@ -500,13 +500,13 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
@Override
public String getCustomName()
{
return is.getDisplayName();
return this.is.getDisplayName();
}
@Override
public boolean hasCustomName()
{
return is.hasDisplayName();
return this.is.hasDisplayName();
}
@Override
@@ -518,6 +518,6 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
public void addEntityCrashInfo(CrashReportCategory crashreportcategory)
{
crashreportcategory.addCrashSection( "Part Side", side );
crashreportcategory.addCrashSection( "Part Side", this.side );
}
}
@@ -42,52 +42,52 @@ public class BusCollisionHelper implements IPartCollisionHelper
this.x = x;
this.y = y;
this.z = z;
entity = e;
isVisual = visual;
this.entity = e;
this.isVisual = visual;
}
public BusCollisionHelper(List<AxisAlignedBB> boxes, ForgeDirection s, Entity e, boolean visual) {
this.boxes = boxes;
entity = e;
isVisual = visual;
this.entity = e;
this.isVisual = visual;
switch (s)
{
case DOWN:
x = ForgeDirection.EAST;
y = ForgeDirection.NORTH;
z = ForgeDirection.DOWN;
this.x = ForgeDirection.EAST;
this.y = ForgeDirection.NORTH;
this.z = ForgeDirection.DOWN;
break;
case UP:
x = ForgeDirection.EAST;
y = ForgeDirection.SOUTH;
z = ForgeDirection.UP;
this.x = ForgeDirection.EAST;
this.y = ForgeDirection.SOUTH;
this.z = ForgeDirection.UP;
break;
case EAST:
x = ForgeDirection.SOUTH;
y = ForgeDirection.UP;
z = ForgeDirection.EAST;
this.x = ForgeDirection.SOUTH;
this.y = ForgeDirection.UP;
this.z = ForgeDirection.EAST;
break;
case WEST:
x = ForgeDirection.NORTH;
y = ForgeDirection.UP;
z = ForgeDirection.WEST;
this.x = ForgeDirection.NORTH;
this.y = ForgeDirection.UP;
this.z = ForgeDirection.WEST;
break;
case NORTH:
x = ForgeDirection.WEST;
y = ForgeDirection.UP;
z = ForgeDirection.NORTH;
this.x = ForgeDirection.WEST;
this.y = ForgeDirection.UP;
this.z = ForgeDirection.NORTH;
break;
case SOUTH:
x = ForgeDirection.EAST;
y = ForgeDirection.UP;
z = ForgeDirection.SOUTH;
this.x = ForgeDirection.EAST;
this.y = ForgeDirection.UP;
this.z = ForgeDirection.SOUTH;
break;
case UNKNOWN:
default:
x = ForgeDirection.EAST;
y = ForgeDirection.UP;
z = ForgeDirection.SOUTH;
this.x = ForgeDirection.EAST;
this.y = ForgeDirection.UP;
this.z = ForgeDirection.SOUTH;
break;
}
}
@@ -95,7 +95,7 @@ public class BusCollisionHelper implements IPartCollisionHelper
@Override
public boolean isBBCollision()
{
return !isVisual;
return !this.isVisual;
}
/**
@@ -103,7 +103,7 @@ public class BusCollisionHelper implements IPartCollisionHelper
*/
public Entity getEntity()
{
return entity;
return this.entity;
}
@Override
@@ -116,27 +116,27 @@ public class BusCollisionHelper implements IPartCollisionHelper
maxY /= 16.0;
maxZ /= 16.0;
double aX = minX * x.offsetX + minY * y.offsetX + minZ * z.offsetX;
double aY = minX * x.offsetY + minY * y.offsetY + minZ * z.offsetY;
double aZ = minX * x.offsetZ + minY * y.offsetZ + minZ * z.offsetZ;
double aX = minX * this.x.offsetX + minY * this.y.offsetX + minZ * this.z.offsetX;
double aY = minX * this.x.offsetY + minY * this.y.offsetY + minZ * this.z.offsetY;
double aZ = minX * this.x.offsetZ + minY * this.y.offsetZ + minZ * this.z.offsetZ;
double bX = maxX * x.offsetX + maxY * y.offsetX + maxZ * z.offsetX;
double bY = maxX * x.offsetY + maxY * y.offsetY + maxZ * z.offsetY;
double bZ = maxX * x.offsetZ + maxY * y.offsetZ + maxZ * z.offsetZ;
double bX = maxX * this.x.offsetX + maxY * this.y.offsetX + maxZ * this.z.offsetX;
double bY = maxX * this.x.offsetY + maxY * this.y.offsetY + maxZ * this.z.offsetY;
double bZ = maxX * this.x.offsetZ + maxY * this.y.offsetZ + maxZ * this.z.offsetZ;
if ( x.offsetX + y.offsetX + z.offsetX < 0 )
if ( this.x.offsetX + this.y.offsetX + this.z.offsetX < 0 )
{
aX += 1;
bX += 1;
}
if ( x.offsetY + y.offsetY + z.offsetY < 0 )
if ( this.x.offsetY + this.y.offsetY + this.z.offsetY < 0 )
{
aY += 1;
bY += 1;
}
if ( x.offsetZ + y.offsetZ + z.offsetZ < 0 )
if ( this.x.offsetZ + this.y.offsetZ + this.z.offsetZ < 0 )
{
aZ += 1;
bZ += 1;
@@ -149,25 +149,25 @@ public class BusCollisionHelper implements IPartCollisionHelper
maxY = Math.max( aY, bY );
maxZ = Math.max( aZ, bZ );
boxes.add( AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) );
this.boxes.add( AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) );
}
@Override
public ForgeDirection getWorldX()
{
return x;
return this.x;
}
@Override
public ForgeDirection getWorldY()
{
return y;
return this.y;
}
@Override
public ForgeDirection getWorldZ()
{
return z;
return this.z;
}
}
+145 -145
View File
@@ -82,53 +82,53 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public boolean isInWorld()
{
return inWorld;
return this.inWorld;
}
public void setHost(IPartHost host)
{
tcb.clearContainer();
tcb = host;
this.tcb.clearContainer();
this.tcb = host;
}
public CableBusContainer(IPartHost host) {
tcb = host;
this.tcb = host;
}
@Override
public IPart getPart(ForgeDirection side)
{
if ( side == ForgeDirection.UNKNOWN )
return getCenter();
return getSide( side );
return this.getCenter();
return this.getSide( side );
}
public void rotateLeft()
{
IPart newSides[] = new IPart[6];
newSides[ForgeDirection.UP.ordinal()] = getSide( ForgeDirection.UP );
newSides[ForgeDirection.DOWN.ordinal()] = getSide( ForgeDirection.DOWN );
newSides[ForgeDirection.UP.ordinal()] = this.getSide( ForgeDirection.UP );
newSides[ForgeDirection.DOWN.ordinal()] = this.getSide( ForgeDirection.DOWN );
newSides[ForgeDirection.EAST.ordinal()] = getSide( ForgeDirection.NORTH );
newSides[ForgeDirection.SOUTH.ordinal()] = getSide( ForgeDirection.EAST );
newSides[ForgeDirection.WEST.ordinal()] = getSide( ForgeDirection.SOUTH );
newSides[ForgeDirection.NORTH.ordinal()] = getSide( ForgeDirection.WEST );
newSides[ForgeDirection.EAST.ordinal()] = this.getSide( ForgeDirection.NORTH );
newSides[ForgeDirection.SOUTH.ordinal()] = this.getSide( ForgeDirection.EAST );
newSides[ForgeDirection.WEST.ordinal()] = this.getSide( ForgeDirection.SOUTH );
newSides[ForgeDirection.NORTH.ordinal()] = this.getSide( ForgeDirection.WEST );
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
setSide( dir, newSides[dir.ordinal()] );
this.setSide( dir, newSides[dir.ordinal()] );
getFacadeContainer().rotateLeft();
this.getFacadeContainer().rotateLeft();
}
public void updateDynamicRender()
{
requiresDynamicRender = false;
this.requiresDynamicRender = false;
for (ForgeDirection s : ForgeDirection.VALID_DIRECTIONS)
{
IPart p = getPart( s );
IPart p = this.getPart( s );
if ( p != null )
requiresDynamicRender = requiresDynamicRender || p.requireDynamicRender();
this.requiresDynamicRender = this.requiresDynamicRender || p.requireDynamicRender();
}
}
@@ -137,24 +137,24 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
if ( side == ForgeDirection.UNKNOWN )
{
if ( getCenter() != null )
getCenter().removeFromWorld();
setCenter( null );
if ( this.getCenter() != null )
this.getCenter().removeFromWorld();
this.setCenter( null );
}
else
{
if ( getSide( side ) != null )
getSide( side ).removeFromWorld();
setSide( side, null );
if ( this.getSide( side ) != null )
this.getSide( side ).removeFromWorld();
this.setSide( side, null );
}
if ( !suppressUpdate )
{
updateDynamicRender();
updateConnections();
markForUpdate();
markForSave();
partChanged();
this.updateDynamicRender();
this.updateConnections();
this.markForUpdate();
this.markForSave();
this.partChanged();
}
}
@@ -163,18 +163,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
*/
public void updateConnections()
{
if ( getCenter() != null )
if ( this.getCenter() != null )
{
EnumSet<ForgeDirection> sides = EnumSet.allOf( ForgeDirection.class );
for (ForgeDirection s : ForgeDirection.VALID_DIRECTIONS)
{
if ( getPart( s ) != null || isBlocked( s ) )
if ( this.getPart( s ) != null || this.isBlocked( s ) )
sides.remove( s );
}
getCenter().setValidSides( sides );
IGridNode n = getCenter().getGridNode();
this.getCenter().setValidSides( sides );
IGridNode n = this.getCenter().getGridNode();
if ( n != null )
n.updateState();
}
@@ -200,21 +200,21 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
boolean canPlace = true;
for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
if ( getPart( d ) != null && !getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) )
if ( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) )
canPlace = false;
if ( !canPlace )
return false;
return getPart( ForgeDirection.UNKNOWN ) == null;
return this.getPart( ForgeDirection.UNKNOWN ) == null;
}
else if ( !(bp instanceof IPartCable) && side != ForgeDirection.UNKNOWN )
{
IPart cable = getPart( ForgeDirection.UNKNOWN );
IPart cable = this.getPart( ForgeDirection.UNKNOWN );
if ( cable != null && !bp.canBePlacedOn( ((IPartCable) cable).supportsBuses() ) )
return false;
return getPart( side ) == null;
return this.getPart( side ) == null;
}
}
}
@@ -224,7 +224,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer player)
{
if ( canAddPart( is, side ) )
if ( this.canAddPart( is, side ) )
{
if ( is.getItem() instanceof IPartItem )
{
@@ -238,30 +238,30 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
boolean canPlace = true;
for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
if ( getPart( d ) != null && !getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) )
if ( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) )
canPlace = false;
if ( !canPlace )
return null;
if ( getPart( ForgeDirection.UNKNOWN ) != null )
if ( this.getPart( ForgeDirection.UNKNOWN ) != null )
return null;
setCenter( (IPartCable) bp );
bp.setPartHostInfo( ForgeDirection.UNKNOWN, this, tcb.getTile() );
this.setCenter( (IPartCable) bp );
bp.setPartHostInfo( ForgeDirection.UNKNOWN, this, this.tcb.getTile() );
if ( player != null )
bp.onPlacement( player, is, side );
if ( inWorld )
if ( this.inWorld )
bp.addToWorld();
IGridNode cn = getCenter().getGridNode();
IGridNode cn = this.getCenter().getGridNode();
if ( cn != null )
{
for (ForgeDirection ins : ForgeDirection.VALID_DIRECTIONS)
{
IPart sbp = getPart( ins );
IPart sbp = this.getPart( ins );
if ( sbp != null )
{
IGridNode sn = sbp.getGridNode();
@@ -276,7 +276,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
// ekk!
bp.removeFromWorld();
setCenter( null );
this.setCenter( null );
return null;
}
}
@@ -284,30 +284,30 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
}
}
updateConnections();
markForUpdate();
markForSave();
partChanged();
this.updateConnections();
this.markForUpdate();
this.markForSave();
this.partChanged();
return ForgeDirection.UNKNOWN;
}
else if ( bp != null && !(bp instanceof IPartCable) && side != ForgeDirection.UNKNOWN )
{
IPart cable = getPart( ForgeDirection.UNKNOWN );
IPart cable = this.getPart( ForgeDirection.UNKNOWN );
if ( cable != null && !bp.canBePlacedOn( ((IPartCable) cable).supportsBuses() ) )
return null;
setSide( side, bp );
this.setSide( side, bp );
bp.setPartHostInfo( side, this, this.getTile() );
if ( player != null )
bp.onPlacement( player, is, side );
if ( inWorld )
if ( this.inWorld )
bp.addToWorld();
if ( getCenter() != null )
if ( this.getCenter() != null )
{
IGridNode cn = getCenter().getGridNode();
IGridNode cn = this.getCenter().getGridNode();
IGridNode sn = bp.getGridNode();
if ( cn != null && sn != null )
@@ -321,17 +321,17 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
// ekk!
bp.removeFromWorld();
setSide( side, null );
this.setSide( side, null );
return null;
}
}
}
updateDynamicRender();
updateConnections();
markForUpdate();
markForSave();
partChanged();
this.updateDynamicRender();
this.updateConnections();
this.markForUpdate();
this.markForSave();
this.partChanged();
return side;
}
}
@@ -349,19 +349,19 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
public void addToWorld()
{
if ( inWorld )
if ( this.inWorld )
return;
inWorld = true;
this.inWorld = true;
isLoading.set( true );
TileEntity te = getTile();
TileEntity te = this.getTile();
// start with the center, then install the side parts into the grid.
for (int x = 6; x >= 0; x--)
{
ForgeDirection s = ForgeDirection.getOrientation( x );
IPart part = getPart( s );
IPart part = this.getPart( s );
if ( part != null )
{
@@ -377,7 +377,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
// here?
// if ( !sn.getConnections().iterator().hasNext() )
IPart center = getPart( ForgeDirection.UNKNOWN );
IPart center = this.getPart( ForgeDirection.UNKNOWN );
if ( center != null )
{
IGridNode cn = center.getGridNode();
@@ -399,26 +399,26 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
}
}
partChanged();
this.partChanged();
isLoading.set( false );
}
public void removeFromWorld()
{
if ( !inWorld )
if ( !this.inWorld )
return;
inWorld = false;
this.inWorld = false;
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = getPart( s );
IPart part = this.getPart( s );
if ( part != null )
part.removeFromWorld();
}
partChanged();
this.partChanged();
}
@Override
@@ -426,7 +426,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
for (ForgeDirection dir : enumSet)
{
IPart part = getPart( dir );
IPart part = this.getPart( dir );
if ( part != null && part.canConnectRedstone() )
return true;
}
@@ -436,7 +436,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public IGridNode getGridNode(ForgeDirection side)
{
IPart part = getPart( side );
IPart part = this.getPart( side );
if ( part != null )
{
IGridNode n = part.getExternalFacingNode();
@@ -444,8 +444,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
return n;
}
if ( getCenter() != null )
return getCenter().getGridNode();
if ( this.getCenter() != null )
return this.getCenter().getGridNode();
return null;
}
@@ -454,12 +454,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
IFacadeContainer fc = getFacadeContainer();
IFacadeContainer fc = this.getFacadeContainer();
for (ForgeDirection s : ForgeDirection.values())
{
IPartCollisionHelper bch = new BusCollisionHelper( boxes, s, e, visual );
IPart part = getPart( s );
IPart part = this.getPart( s );
if ( part != null )
{
if ( ignoreCableConnections && part instanceof IPartCable )
@@ -487,7 +487,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = getPart( s );
IPart part = this.getPart( s );
if ( part != null )
part.onEntityCollision( entity );
}
@@ -496,10 +496,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public boolean isEmpty()
{
IFacadeContainer fc = getFacadeContainer();
IFacadeContainer fc = this.getFacadeContainer();
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = getPart( s );
IPart part = this.getPart( s );
if ( part != null )
return false;
@@ -516,11 +516,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public void onNeighborChanged()
{
hasRedstone = YesNo.UNDECIDED;
this.hasRedstone = YesNo.UNDECIDED;
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = getPart( s );
IPart part = this.getPart( s );
if ( part != null )
part.onNeighborChanged();
}
@@ -528,8 +528,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
private void updateRedstone()
{
TileEntity te = getTile();
hasRedstone = te.getWorldObj().isBlockIndirectlyGettingPowered( te.xCoord, te.yCoord, te.zCoord ) ? YesNo.YES : YesNo.NO;
TileEntity te = this.getTile();
this.hasRedstone = te.getWorldObj().isBlockIndirectlyGettingPowered( te.xCoord, te.yCoord, te.zCoord ) ? YesNo.YES : YesNo.NO;
}
@Override
@@ -539,33 +539,33 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
return false;
// facades are solid..
IFacadePart fp = getFacadeContainer().getFacade( side );
IFacadePart fp = this.getFacadeContainer().getFacade( side );
if ( fp != null )
return true;
// buses can be too.
IPart part = getPart( side );
IPart part = this.getPart( side );
return part != null && part.isSolid();
}
@Override
public int isProvidingWeakPower(ForgeDirection side)
{
IPart part = getPart( side );
IPart part = this.getPart( side );
return part != null ? part.isProvidingWeakPower() : 0;
}
@Override
public int isProvidingStrongPower(ForgeDirection side)
{
IPart part = getPart( side );
IPart part = this.getPart( side );
return part != null ? part.isProvidingStrongPower() : 0;
}
@SideOnly(Side.CLIENT)
public void renderStatic(double x, double y, double z)
{
CableRenderHelper.getInstance().renderStatic( this, getFacadeContainer() );
CableRenderHelper.getInstance().renderStatic( this, this.getFacadeContainer() );
}
@SideOnly(Side.CLIENT)
@@ -579,7 +579,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
int sides = 0;
for (int x = 0; x < 7; x++)
{
IPart p = getPart( ForgeDirection.getOrientation( x ) );
IPart p = this.getPart( ForgeDirection.getOrientation( x ) );
if ( p != null )
{
sides = sides | (1 << x);
@@ -591,7 +591,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
for (int x = 0; x < 7; x++)
{
ItemStack is = null;
IPart p = getPart( ForgeDirection.getOrientation( x ) );
IPart p = this.getPart( ForgeDirection.getOrientation( x ) );
if ( p != null )
{
is = p.getItemStack( PartItemStack.Network );
@@ -603,7 +603,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
}
}
getFacadeContainer().writeToStream( data );
this.getFacadeContainer().writeToStream( data );
}
public boolean readFromStream(ByteBuf data) throws IOException
@@ -617,7 +617,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
ForgeDirection side = ForgeDirection.getOrientation( x );
if ( ((sides & (1 << x)) == (1 << x)) )
{
IPart p = getPart( side );
IPart p = this.getPart( side );
short itemID = data.readShort();
short dmgValue = data.readShort();
@@ -632,22 +632,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
}
else
{
removePart( side, false );
side = addPart( new ItemStack( myItem, 1, dmgValue ), side, null );
this.removePart( side, false );
side = this.addPart( new ItemStack( myItem, 1, dmgValue ), side, null );
if ( side != null )
{
p = getPart( side );
p = this.getPart( side );
p.readFromStream( data );
}
else
throw new RuntimeException( "Invalid Stream For CableBus Container." );
}
}
else if ( getPart( side ) != null )
removePart( side, false );
else if ( this.getPart( side ) != null )
this.removePart( side, false );
}
if ( getFacadeContainer().readFromStream( data ) )
if ( this.getFacadeContainer().readFromStream( data ) )
return true;
return updateBlock;
@@ -655,12 +655,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
ForgeDirection getSide(IPart part)
{
if ( getCenter() == part )
if ( this.getCenter() == part )
return ForgeDirection.UNKNOWN;
else
{
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
if ( getSide( side ) == part )
if ( this.getSide( side ) == part )
{
return side;
}
@@ -670,14 +670,14 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
public void writeToNBT(NBTTagCompound data)
{
data.setInteger( "hasRedstone", hasRedstone.ordinal() );
data.setInteger( "hasRedstone", this.hasRedstone.ordinal() );
IFacadeContainer fc = getFacadeContainer();
IFacadeContainer fc = this.getFacadeContainer();
for (ForgeDirection s : ForgeDirection.values())
{
fc.writeToNBT( data );
IPart part = getPart( s );
IPart part = this.getPart( s );
if ( part != null )
{
NBTTagCompound def = new NBTTagCompound();
@@ -686,8 +686,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
NBTTagCompound extra = new NBTTagCompound();
part.writeToNBT( extra );
data.setTag( "def:" + getSide( part ).ordinal(), def );
data.setTag( "extra:" + getSide( part ).ordinal(), extra );
data.setTag( "def:" + this.getSide( part ).ordinal(), def );
data.setTag( "extra:" + this.getSide( part ).ordinal(), extra );
}
}
}
@@ -695,7 +695,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
public void readFromNBT(NBTTagCompound data)
{
if ( data.hasKey( "hasRedstone" ) )
hasRedstone = YesNo.values()[data.getInteger( "hasRedstone" )];
this.hasRedstone = YesNo.values()[data.getInteger( "hasRedstone" )];
for (int x = 0; x < 7; x++)
{
@@ -705,7 +705,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() );
if ( def != null && extra != null )
{
IPart p = getPart( side );
IPart p = this.getPart( side );
ItemStack iss = ItemStack.loadItemStackFromNBT( def );
if ( iss == null )
continue;
@@ -716,11 +716,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
p.readFromNBT( extra );
else
{
removePart( side, true );
side = addPart( iss, side, null );
this.removePart( side, true );
side = this.addPart( iss, side, null );
if ( side != null )
{
p = getPart( side );
p = this.getPart( side );
p.readFromNBT( extra );
}
else
@@ -730,17 +730,17 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
}
}
else
removePart( side, false );
this.removePart( side, false );
}
getFacadeContainer().readFromNBT( data );
this.getFacadeContainer().readFromNBT( data );
}
public List getDrops(List drops)
{
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = getPart( s );
IPart part = this.getPart( s );
if ( part != null )
{
drops.add( part.getItemStack( PartItemStack.Break ) );
@@ -749,7 +749,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
if ( s != ForgeDirection.UNKNOWN )
{
IFacadePart fp = getFacadeContainer().getFacade( s );
IFacadePart fp = this.getFacadeContainer().getFacade( s );
if ( fp != null )
drops.add( fp.getItemStack() );
}
@@ -762,7 +762,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = getPart( s );
IPart part = this.getPart( s );
if ( part != null )
{
part.getDrops( drops, false );
@@ -775,25 +775,25 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public void markForUpdate()
{
tcb.markForUpdate();
this.tcb.markForUpdate();
}
@Override
public DimensionalCoord getLocation()
{
return tcb.getLocation();
return this.tcb.getLocation();
}
@Override
public TileEntity getTile()
{
return tcb.getTile();
return this.tcb.getTile();
}
@Override
public AECableType getCableConnectionType(ForgeDirection dir)
{
IPart part = getPart( dir );
IPart part = this.getPart( dir );
if ( part != null && part instanceof IGridHost )
{
AECableType t = ((IGridHost) part).getCableConnectionType( dir );
@@ -801,9 +801,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
return t;
}
if ( getCenter() != null )
if ( this.getCenter() != null )
{
IPartCable c = getCenter();
IPartCable c = this.getCenter();
return c.getCableConnectionType();
}
return AECableType.NONE;
@@ -812,9 +812,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public AEColor getColor()
{
if ( getCenter() != null )
if ( this.getCenter() != null )
{
IPartCable c = getCenter();
IPartCable c = this.getCenter();
return c.getCableColor();
}
return AEColor.Transparent;
@@ -835,7 +835,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public boolean isBlocked(ForgeDirection side)
{
return tcb.isBlocked( side );
return this.tcb.isBlocked( side );
}
@Override
@@ -845,13 +845,13 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
for (ForgeDirection d : ForgeDirection.values())
{
IPart p = getPart( d );
IPart p = this.getPart( d );
if ( p != null )
light = Math.max( p.getLightLevel(), light );
}
if ( light > 0 && AppEng.instance.isIntegrationEnabled( IntegrationType.CLApi ) )
return ((ICLApi) AppEng.instance.getIntegration( IntegrationType.CLApi )).colorLight( getColor(), light );
return ((ICLApi) AppEng.instance.getIntegration( IntegrationType.CLApi )).colorLight( this.getColor(), light );
return light;
}
@@ -859,7 +859,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public boolean recolourBlock(ForgeDirection side, AEColor colour, EntityPlayer who)
{
IPart cable = getPart( ForgeDirection.UNKNOWN );
IPart cable = this.getPart( ForgeDirection.UNKNOWN );
if ( cable != null )
{
IPartCable pc = (IPartCable) cable;
@@ -871,7 +871,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public boolean activate(EntityPlayer player, Vec3 pos)
{
SelectedPart p = selectPart( pos );
SelectedPart p = this.selectPart( pos );
if ( p != null && p.part != null )
{
return p.part.onActivate( player, pos );
@@ -884,7 +884,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
for (ForgeDirection side : ForgeDirection.values())
{
IPart p = getPart( side );
IPart p = this.getPart( side );
if ( p != null )
{
List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
@@ -904,7 +904,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
if ( AEApi.instance().partHelper().getCableRenderMode().opaqueFacades )
{
IFacadeContainer fc = getFacadeContainer();
IFacadeContainer fc = this.getFacadeContainer();
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{
IFacadePart p = fc.getFacade( side );
@@ -932,35 +932,35 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public void partChanged()
{
if ( getCenter() == null )
if ( this.getCenter() == null )
{
List<ItemStack> facades = new LinkedList<ItemStack>();
IFacadeContainer fc = getFacadeContainer();
IFacadeContainer fc = this.getFacadeContainer();
for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
{
IFacadePart fp = fc.getFacade( d );
if ( fp != null )
{
facades.add( fp.getItemStack() );
fc.removeFacade( tcb, d );
fc.removeFacade( this.tcb, d );
}
}
if ( !facades.isEmpty() )
{
TileEntity te = tcb.getTile();
TileEntity te = this.tcb.getTile();
Platform.spawnDrops( te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, facades );
}
}
tcb.partChanged();
this.tcb.partChanged();
}
@Override
public void markForSave()
{
tcb.markForSave();
this.tcb.markForSave();
}
@Override
@@ -968,7 +968,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
for (ForgeDirection side : ForgeDirection.values())
{
IPart p = getPart( side );
IPart p = this.getPart( side );
if ( p != null )
{
p.randomDisplayTick( world, x, y, z, r );
@@ -979,10 +979,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public boolean hasRedstone(ForgeDirection side)
{
if ( hasRedstone == YesNo.UNDECIDED )
updateRedstone();
if ( this.hasRedstone == YesNo.UNDECIDED )
this.updateRedstone();
return hasRedstone == YesNo.YES;
return this.hasRedstone == YesNo.YES;
}
@Override
@@ -990,7 +990,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
for (ForgeDirection side : ForgeDirection.values())
{
IPart p = getPart( side );
IPart p = this.getPart( side );
if ( p != null )
{
if ( p.isLadder( entity ) )
@@ -1006,7 +1006,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
for (ForgeDirection d : ForgeDirection.values())
{
IPart p = getPart( d );
IPart p = this.getPart( d );
if ( p != null && p instanceof IGridHost )
((IGridHost) p).securityBreak();
}
@@ -1015,19 +1015,19 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public Set<LayerFlags> getLayerFlags()
{
return myLayerFlags;
return this.myLayerFlags;
}
@Override
public void cleanup()
{
tcb.cleanup();
this.tcb.cleanup();
}
@Override
public void notifyNeighbors()
{
tcb.notifyNeighbors();
this.tcb.notifyNeighbors();
}
}
+15 -15
View File
@@ -35,7 +35,7 @@ public class CableBusStorage
protected IPartCable getCenter()
{
return center;
return this.center;
}
protected void setCenter(IPartCable center)
@@ -46,8 +46,8 @@ public class CableBusStorage
protected IPart getSide(ForgeDirection side)
{
int x = side.ordinal();
if ( sides != null && sides.length > x )
return sides[x];
if ( this.sides != null && this.sides.length > x )
return this.sides[x];
return null;
}
@@ -56,37 +56,37 @@ public class CableBusStorage
{
int x = side.ordinal();
if ( sides != null && sides.length > x && part == null )
if ( this.sides != null && this.sides.length > x && part == null )
{
sides[x] = null;
sides = shrink( sides, true );
this.sides[x] = null;
this.sides = this.shrink( this.sides, true );
}
else if ( part != null )
{
sides = grow( sides, x, true );
sides[x] = part;
this.sides = this.grow( this.sides, x, true );
this.sides[x] = part;
}
}
public IFacadePart getFacade(int x)
{
if ( facades != null && facades.length > x )
return facades[x];
if ( this.facades != null && this.facades.length > x )
return this.facades[x];
return null;
}
public void setFacade(int x, IFacadePart facade)
{
if ( facades != null && facades.length > x && facade == null )
if ( this.facades != null && this.facades.length > x && facade == null )
{
facades[x] = null;
facades = shrink( facades, false );
this.facades[x] = null;
this.facades = this.shrink( this.facades, false );
}
else
{
facades = grow( facades, x, false );
facades[x] = facade;
this.facades = this.grow( this.facades, x, false );
this.facades[x] = facade;
}
}
+18 -18
View File
@@ -49,13 +49,13 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState
@MENetworkEventSubscribe
public void chanRender(MENetworkChannelsChanged c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
@MENetworkEventSubscribe
public void powerRender(MENetworkPowerStatusChange c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
public void setColors(boolean hasChan, boolean hasPower)
@@ -64,13 +64,13 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState
{
int l = 14;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
Tessellator.instance.setColorOpaque_I( getColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getColor().blackVariant );
}
else if ( hasPower )
{
int l = 9;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
Tessellator.instance.setColorOpaque_I( getColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getColor().whiteVariant );
}
else
{
@@ -83,7 +83,7 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState
public void renderLights(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.normalRendering();
setColors( (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG), (clientFlags & POWERED_FLAG) == POWERED_FLAG );
this.setColors( (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG), (this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG );
rh.renderFace( x, y, z, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), ForgeDirection.EAST, renderer );
rh.renderFace( x, y, z, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), ForgeDirection.WEST, renderer );
rh.renderFace( x, y, z, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), ForgeDirection.UP, renderer );
@@ -95,24 +95,24 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState
{
super.writeToStream( data );
clientFlags = 0;
this.clientFlags = 0;
try
{
if ( proxy.getEnergy().isNetworkPowered() )
clientFlags |= POWERED_FLAG;
if ( this.proxy.getEnergy().isNetworkPowered() )
this.clientFlags |= this.POWERED_FLAG;
if ( proxy.getNode().meetsChannelRequirements() )
clientFlags |= CHANNEL_FLAG;
if ( this.proxy.getNode().meetsChannelRequirements() )
this.clientFlags |= this.CHANNEL_FLAG;
clientFlags = populateFlags( clientFlags );
this.clientFlags = this.populateFlags( this.clientFlags );
}
catch (GridAccessException e)
{
// meh
}
data.writeByte( (byte) clientFlags );
data.writeByte( (byte) this.clientFlags );
}
protected int populateFlags(int cf)
@@ -125,27 +125,27 @@ public class PartBasicState extends AEBasePart implements IPowerChannelState
{
boolean eh = super.readFromStream( data );
int old = clientFlags;
clientFlags = data.readByte();
int old = this.clientFlags;
this.clientFlags = data.readByte();
return eh || old != clientFlags;
return eh || old != this.clientFlags;
}
public PartBasicState(Class c, ItemStack is) {
super( c, is );
proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
}
@Override
public boolean isPowered()
{
return (clientFlags & POWERED_FLAG) == POWERED_FLAG;
return (this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG;
}
@Override
public boolean isActive()
{
return (clientFlags & CHANNEL_FLAG) == CHANNEL_FLAG;
return (this.clientFlags & this.CHANNEL_FLAG) == this.CHANNEL_FLAG;
}
@Override
@@ -67,7 +67,7 @@ public class PartPlacement
@SubscribeEvent
public void playerInteract(TickEvent.ClientTickEvent event)
{
wasCanceled = false;
this.wasCanceled = false;
}
@SubscribeEvent
@@ -87,7 +87,7 @@ public class PartPlacement
{
World w = event.entity.worldObj;
TileEntity te = w.getTileEntity( mop.blockX, mop.blockY, mop.blockZ );
if ( te instanceof IPartHost && wasCanceled )
if ( te instanceof IPartHost && this.wasCanceled )
event.setCanceled( true );
}
else if ( event.entityPlayer != null )
@@ -103,19 +103,19 @@ public class PartPlacement
}
else if ( event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote )
{
if ( placing.get() != null )
if ( this.placing.get() != null )
return;
placing.set( event );
this.placing.set( event );
ItemStack held = event.entityPlayer.getHeldItem();
if ( place( held, event.x, event.y, event.z, event.face, event.entityPlayer, event.entityPlayer.worldObj, PlaceType.INTERACT_FIRST_PASS, 0 ) )
{
event.setCanceled( true );
wasCanceled = true;
this.wasCanceled = true;
}
placing.set( null );
this.placing.set( null );
}
}
@@ -29,22 +29,22 @@ public class NonNullArrayIterator<E> implements Iterator<E>
final E[] g;
public NonNullArrayIterator(E[] o) {
g = o;
this.g = o;
}
@Override
public boolean hasNext()
{
while (offset < g.length && g[offset] == null)
offset++;
while (this.offset < this.g.length && this.g[this.offset] == null)
this.offset++;
return offset != g.length;
return this.offset != this.g.length;
}
@Override
public E next()
{
return g[offset++];
return this.g[this.offset++];
}
@Override
@@ -76,7 +76,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(),
CableBusTextures.PartPlaneSides.getIcon() );
rh.setBounds( 1, 1, 15, 15, 15, 16 );
@@ -98,38 +98,38 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
ForgeDirection e = rh.getWorldX();
ForgeDirection u = rh.getWorldY();
TileEntity te = getHost().getTile();
TileEntity te = this.getHost().getTile();
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) )
minX = 0;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) )
maxX = 16;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) )
minY = 0;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) )
maxY = 16;
boolean isActive = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG);
boolean isActive = (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG);
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : is.getIconIndex(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : this.is.getIconIndex(),
CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
rh.setBounds( minX, minY, 15, maxX, maxY, 16 );
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : is.getIconIndex(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : this.is.getIconIndex(),
CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
rh.setBounds( 5, 5, 14, 11, 11, 15 );
rh.renderBlock( x, y, z, renderer );
renderLights( x, y, z, rh, renderer );
this.renderLights( x, y, z, rh, renderer );
}
private boolean isTransitionPlane(TileEntity blockTileEntity, ForgeDirection side)
@@ -150,7 +150,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
int maxX = 15;
int maxY = 15;
IPartHost host = getHost();
IPartHost host = this.getHost();
if ( host != null )
{
TileEntity te = host.getTile();
@@ -162,16 +162,16 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
ForgeDirection e = bch.getWorldX();
ForgeDirection u = bch.getWorldY();
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) )
minX = 0;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) )
maxX = 16;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) )
minY = 0;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) )
maxY = 16;
}
@@ -194,11 +194,11 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
super.writeToNBT( data );
data.setInteger( "bufferSize", Buffer.size() );
for (int x = 0; x < Buffer.size(); x++)
data.setInteger( "bufferSize", this.Buffer.size() );
for (int x = 0; x < this.Buffer.size(); x++)
{
NBTTagCompound pack = new NBTTagCompound();
Buffer.get( x ).writeToNBT( pack );
this.Buffer.get( x ).writeToNBT( pack );
data.setTag( "buffer" + x, pack );
}
}
@@ -209,25 +209,25 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
super.readFromNBT( data );
int size = data.getInteger( "bufferSize" );
Buffer.clear();
this.Buffer.clear();
for (int x = 0; x < size; x++)
{
NBTTagCompound pack = (NBTTagCompound) data.getTag( "buffer" + x );
IAEItemStack ais = AEItemStack.loadItemStackFromNBT( pack );
if ( ais != null )
Buffer.add( ais );
this.Buffer.add( ais );
}
}
private boolean isAccepting()
{
return Buffer.isEmpty();
return this.Buffer.isEmpty();
}
@Override
public void getDrops(List<ItemStack> drops, boolean wrenched)
{
for (IAEItemStack is : Buffer)
for (IAEItemStack is : this.Buffer)
if ( is != null )
drops.add( is.getItemStack() );
}
@@ -236,35 +236,35 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
@MENetworkEventSubscribe
public void chanRender(MENetworkChannelsChanged c)
{
onNeighborChanged();
getHost().markForUpdate();
this.onNeighborChanged();
this.getHost().markForUpdate();
}
@Override
@MENetworkEventSubscribe
public void powerRender(MENetworkPowerStatusChange c)
{
onNeighborChanged();
getHost().markForUpdate();
this.onNeighborChanged();
this.getHost().markForUpdate();
}
public TickRateModulation EatBlock(boolean eatForReal)
{
if ( isAccepting() && proxy.isActive() )
if ( this.isAccepting() && this.proxy.isActive() )
{
try
{
TileEntity te = getTile();
TileEntity te = this.getTile();
WorldServer w = (WorldServer) te.getWorldObj();
int x = te.xCoord + side.offsetX;
int y = te.yCoord + side.offsetY;
int z = te.zCoord + side.offsetZ;
int x = te.xCoord + this.side.offsetX;
int y = te.yCoord + this.side.offsetY;
int z = te.zCoord + this.side.offsetZ;
Block blk = w.getBlock( x, y, z );
IStorageGrid storage = proxy.getStorage();
IEnergyGrid energy = proxy.getEnergy();
IStorageGrid storage = this.proxy.getStorage();
IEnergyGrid energy = this.proxy.getEnergy();
Material mat = blk.getMaterial();
boolean ignore = mat == Material.air || mat == Material.lava || mat == Material.water || mat.isLiquid() || blk == Blocks.bedrock
@@ -299,30 +299,30 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
if ( !item.isDead )
{
IAEItemStack storedItem = AEItemStack.create( item.getEntityItem() );
storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, mySrc );
storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, this.mySrc );
if ( storedItem != null )
Buffer.add( storedItem );
this.Buffer.add( storedItem );
item.setDead();
}
}
}
ServerHelper.proxy.sendToAllNearExcept( null, x, y, z, 64, w, new PacketTransitionEffect( x, y, z, side, true ) );
ServerHelper.proxy.sendToAllNearExcept( null, x, y, z, 64, w, new PacketTransitionEffect( x, y, z, this.side, true ) );
for (ItemStack snaggedItem : out)
{
IAEItemStack storedItem = AEItemStack.create( snaggedItem );
storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, mySrc );
storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, this.mySrc );
if ( storedItem != null )
Buffer.add( storedItem );
this.Buffer.add( storedItem );
}
return TickRateModulation.URGENT;
}
else
{
breaking = true;
this.breaking = true;
TickHandler.instance.addCallable( this.tile.getWorldObj(), this );
return TickRateModulation.URGENT;
}
@@ -352,7 +352,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
try
{
proxy.getTick().alertDevice( proxy.getNode() );
this.proxy.getTick().alertDevice( this.proxy.getNode() );
}
catch (GridAccessException e)
{
@@ -363,33 +363,33 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
@Override
public void onEntityCollision(Entity entity)
{
if ( entity instanceof EntityItem && !entity.isDead && isAccepting() )
if ( entity instanceof EntityItem && !entity.isDead && this.isAccepting() )
{
boolean capture = false;
switch (side)
switch (this.side)
{
case DOWN:
case UP:
if ( entity.posX > tile.xCoord && entity.posX < tile.xCoord + 1 )
if ( entity.posZ > tile.zCoord && entity.posZ < tile.zCoord + 1 )
if ( (entity.posY > tile.yCoord + 0.9 && side == ForgeDirection.UP) || (entity.posY < tile.yCoord + 0.1 && side == ForgeDirection.DOWN) )
if ( entity.posX > this.tile.xCoord && entity.posX < this.tile.xCoord + 1 )
if ( entity.posZ > this.tile.zCoord && entity.posZ < this.tile.zCoord + 1 )
if ( (entity.posY > this.tile.yCoord + 0.9 && this.side == ForgeDirection.UP) || (entity.posY < this.tile.yCoord + 0.1 && this.side == ForgeDirection.DOWN) )
capture = true;
break;
case SOUTH:
case NORTH:
if ( entity.posX > tile.xCoord && entity.posX < tile.xCoord + 1 )
if ( entity.posY > tile.yCoord && entity.posY < tile.yCoord + 1 )
if ( (entity.posZ > tile.zCoord + 0.9 && side == ForgeDirection.SOUTH)
|| (entity.posZ < tile.zCoord + 0.1 && side == ForgeDirection.NORTH) )
if ( entity.posX > this.tile.xCoord && entity.posX < this.tile.xCoord + 1 )
if ( entity.posY > this.tile.yCoord && entity.posY < this.tile.yCoord + 1 )
if ( (entity.posZ > this.tile.zCoord + 0.9 && this.side == ForgeDirection.SOUTH)
|| (entity.posZ < this.tile.zCoord + 0.1 && this.side == ForgeDirection.NORTH) )
capture = true;
break;
case EAST:
case WEST:
if ( entity.posZ > tile.zCoord && entity.posZ < tile.zCoord + 1 )
if ( entity.posY > tile.yCoord && entity.posY < tile.yCoord + 1 )
if ( (entity.posX > tile.xCoord + 0.9 && side == ForgeDirection.EAST)
|| (entity.posX < tile.xCoord + 0.1 && side == ForgeDirection.WEST) )
if ( entity.posZ > this.tile.zCoord && entity.posZ < this.tile.zCoord + 1 )
if ( entity.posY > this.tile.yCoord && entity.posY < this.tile.yCoord + 1 )
if ( (entity.posX > this.tile.xCoord + 0.9 && this.side == ForgeDirection.EAST)
|| (entity.posX < this.tile.xCoord + 0.1 && this.side == ForgeDirection.WEST) )
capture = true;
break;
default:
@@ -397,16 +397,16 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
break;
}
if ( capture && Platform.isServer() && proxy.isActive() )
if ( capture && Platform.isServer() && this.proxy.isActive() )
{
IAEItemStack stack = AEItemStack.create( ((EntityItem) entity).getEntityItem() );
if ( stack != null )
{
ServerHelper.proxy.sendToAllNearExcept( null, tile.xCoord, tile.yCoord, tile.zCoord, 64, tile.getWorldObj(),
new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, side, false ) );
ServerHelper.proxy.sendToAllNearExcept( null, this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, 64, this.tile.getWorldObj(),
new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.side, false ) );
Buffer.add( stack );
storeBuffer();
this.Buffer.add( stack );
this.storeBuffer();
entity.setDead();
}
}
@@ -416,14 +416,14 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
@Override
public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
{
if ( breaking )
if ( this.breaking )
return TickRateModulation.URGENT;
if ( isAccepting() )
return EatBlock( false );
if ( this.isAccepting() )
return this.EatBlock( false );
else
{
storeBuffer();
this.storeBuffer();
return TickRateModulation.IDLE;
}
}
@@ -432,16 +432,16 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
try
{
IStorageGrid storage = proxy.getStorage();
IEnergyGrid energy = proxy.getEnergy();
IStorageGrid storage = this.proxy.getStorage();
IEnergyGrid energy = this.proxy.getEnergy();
while (!Buffer.isEmpty())
while (!this.Buffer.isEmpty())
{
IAEItemStack storedItem = Buffer.pop();
storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, mySrc );
IAEItemStack storedItem = this.Buffer.pop();
storedItem = Platform.poweredInsert( energy, storage.getItemInventory(), storedItem, this.mySrc );
if ( storedItem != null )
{
Buffer.add( storedItem );
this.Buffer.add( storedItem );
break;
}
}
@@ -455,8 +455,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
@Override
public Object call() throws Exception
{
breaking = false;
return EatBlock( true );
this.breaking = false;
return this.EatBlock( true );
}
}
@@ -69,24 +69,24 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
public PartExportBus(ItemStack is)
{
super( PartExportBus.class, is );
settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
settings.registerSetting( Settings.CRAFT_ONLY, YesNo.NO );
mySrc = new MachineSource( this );
this.settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
this.settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
this.settings.registerSetting( Settings.CRAFT_ONLY, YesNo.NO );
this.mySrc = new MachineSource( this );
}
@Override
public void readFromNBT(NBTTagCompound extra)
{
super.readFromNBT( extra );
cratingTracker.readFromNBT( extra );
this.cratingTracker.readFromNBT( extra );
}
@Override
public void writeToNBT(NBTTagCompound extra)
{
super.writeToNBT( extra );
cratingTracker.writeToNBT( extra );
this.cratingTracker.writeToNBT( extra );
}
@Override
@@ -97,7 +97,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
if ( Platform.isClient() )
return true;
Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_BUS );
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_BUS );
return true;
}
@@ -110,7 +110,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
{
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
rh.setBounds( 4, 4, 12, 12, 12, 14 );
rh.renderInventoryBox( renderer );
@@ -126,9 +126,9 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
rh.setBounds( 4, 4, 12, 12, 12, 14 );
rh.renderBlock( x, y, z, renderer );
@@ -140,13 +140,13 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorSidesStatus.getIcon() );
rh.setBounds( 6, 6, 11, 10, 10, 12 );
rh.renderBlock( x, y, z, renderer );
renderLights( x, y, z, rh, renderer );
this.renderLights( x, y, z, rh, renderer );
}
@Override
@@ -170,70 +170,70 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
@Override
TickRateModulation doBusWork()
{
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return TickRateModulation.IDLE;
itemToSend = 1;
didSomething = false;
this.itemToSend = 1;
this.didSomething = false;
switch (getInstalledUpgrades( Upgrades.SPEED ))
switch (this.getInstalledUpgrades( Upgrades.SPEED ))
{
default:
case 0:
itemToSend = 1;
this.itemToSend = 1;
break;
case 1:
itemToSend = 8;
this.itemToSend = 8;
break;
case 2:
itemToSend = 32;
this.itemToSend = 32;
break;
case 3:
itemToSend = 64;
this.itemToSend = 64;
break;
case 4:
itemToSend = 96;
this.itemToSend = 96;
break;
}
try
{
InventoryAdaptor d = getHandler();
IMEMonitor<IAEItemStack> inv = proxy.getStorage().getItemInventory();
IEnergyGrid energy = proxy.getEnergy();
ICraftingGrid cg = proxy.getCrafting();
FuzzyMode fzMode = (FuzzyMode) getConfigManager().getSetting( Settings.FUZZY_MODE );
InventoryAdaptor d = this.getHandler();
IMEMonitor<IAEItemStack> inv = this.proxy.getStorage().getItemInventory();
IEnergyGrid energy = this.proxy.getEnergy();
ICraftingGrid cg = this.proxy.getCrafting();
FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE );
if ( d != null )
{
for (int x = 0; x < availableSlots() && itemToSend > 0; x++)
for (int x = 0; x < this.availableSlots() && this.itemToSend > 0; x++)
{
IAEItemStack ais = config.getAEStackInSlot( x );
if ( ais == null || itemToSend <= 0 || craftOnly() )
IAEItemStack ais = this.config.getAEStackInSlot( x );
if ( ais == null || this.itemToSend <= 0 || this.craftOnly() )
{
if ( isCraftingEnabled() )
didSomething = cratingTracker.handleCrafting( x, itemToSend, ais, d, getTile().getWorldObj(), proxy.getGrid(), cg, mySrc )
|| didSomething;
if ( this.isCraftingEnabled() )
this.didSomething = this.cratingTracker.handleCrafting( x, this.itemToSend, ais, d, this.getTile().getWorldObj(), this.proxy.getGrid(), cg, this.mySrc )
|| this.didSomething;
continue;
}
long before = itemToSend;
long before = this.itemToSend;
if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
{
for (IAEItemStack o : ImmutableList.copyOf( inv.getStorageList().findFuzzy( ais, fzMode ) ))
{
pushItemIntoTarget( d, energy, inv, o );
if ( itemToSend <= 0 )
this.pushItemIntoTarget( d, energy, inv, o );
if ( this.itemToSend <= 0 )
break;
}
}
else
pushItemIntoTarget( d, energy, inv, ais );
this.pushItemIntoTarget( d, energy, inv, ais );
if ( itemToSend == before && isCraftingEnabled() )
didSomething = cratingTracker.handleCrafting( x, itemToSend, ais, d, getTile().getWorldObj(), proxy.getGrid(), cg, mySrc )
|| didSomething;
if ( this.itemToSend == before && this.isCraftingEnabled() )
this.didSomething = this.cratingTracker.handleCrafting( x, this.itemToSend, ais, d, this.getTile().getWorldObj(), this.proxy.getGrid(), cg, this.mySrc )
|| this.didSomething;
}
}
@@ -243,45 +243,45 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
// :P
}
return didSomething ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
return this.didSomething ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
}
private boolean craftOnly()
{
return getConfigManager().getSetting( Settings.CRAFT_ONLY ) == YesNo.YES;
return this.getConfigManager().getSetting( Settings.CRAFT_ONLY ) == YesNo.YES;
}
private boolean isCraftingEnabled()
{
return getInstalledUpgrades( Upgrades.CRAFTING ) > 0;
return this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0;
}
private void pushItemIntoTarget(InventoryAdaptor d, IEnergyGrid energy, IMEInventory<IAEItemStack> inv, IAEItemStack ais)
{
ItemStack is = ais.getItemStack();
is.stackSize = (int) itemToSend;
is.stackSize = (int) this.itemToSend;
ItemStack o = d.simulateAdd( is );
long canFit = o == null ? itemToSend : itemToSend - o.stackSize;
long canFit = o == null ? this.itemToSend : this.itemToSend - o.stackSize;
if ( canFit > 0 )
{
ais = ais.copy();
ais.setStackSize( canFit );
IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, mySrc );
IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc );
if ( itemsToAdd != null )
{
itemToSend -= itemsToAdd.getStackSize();
this.itemToSend -= itemsToAdd.getStackSize();
ItemStack failed = d.addItems( itemsToAdd.getItemStack() );
if ( failed != null )
{
ais.setStackSize( failed.stackSize );
inv.injectItems( ais, Actionable.MODULATE, mySrc );
inv.injectItems( ais, Actionable.MODULATE, this.mySrc );
}
else
didSomething = true;
this.didSomething = true;
}
}
@@ -290,13 +290,13 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
@Override
public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, Actionable mode)
{
InventoryAdaptor d = getHandler();
InventoryAdaptor d = this.getHandler();
try
{
if ( d != null && proxy.isActive() )
if ( d != null && this.proxy.isActive() )
{
IEnergyGrid energy = proxy.getEnergy();
IEnergyGrid energy = this.proxy.getEnergy();
double power = items.getStackSize();
if ( energy.extractAEPower( power, mode, PowerMultiplier.CONFIG ) > power - 0.01 )
@@ -318,37 +318,37 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
@Override
public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
{
return doBusWork();
return this.doBusWork();
}
@Override
public RedstoneMode getRSMode()
{
return (RedstoneMode) settings.getSetting( Settings.REDSTONE_CONTROLLED );
return (RedstoneMode) this.settings.getSetting( Settings.REDSTONE_CONTROLLED );
}
@Override
protected boolean isSleeping()
{
return getHandler() == null || super.isSleeping();
return this.getHandler() == null || super.isSleeping();
}
@Override
public TickingRequest getTickingRequest(IGridNode node)
{
return new TickingRequest( TickRates.ExportBus.min, TickRates.ExportBus.max, isSleeping(), false );
return new TickingRequest( TickRates.ExportBus.min, TickRates.ExportBus.max, this.isSleeping(), false );
}
@Override
public ImmutableSet<ICraftingLink> getRequestedJobs()
{
return cratingTracker.getRequestedJobs();
return this.cratingTracker.getRequestedJobs();
}
@Override
public void jobStateChange(ICraftingLink link)
{
cratingTracker.jobStateChange( link );
this.cratingTracker.jobStateChange( link );
}
}
@@ -89,8 +89,8 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
public PartFormationPlane(ItemStack is) {
super( PartFormationPlane.class, is );
settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
updateHandler();
this.settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
this.updateHandler();
}
@Override
@@ -101,7 +101,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
if ( Platform.isClient() )
return true;
Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_FORMATION_PLANE );
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_FORMATION_PLANE );
return true;
}
@@ -118,7 +118,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
public IInventory getInventoryByName(String name)
{
if ( name.equals( "config" ) )
return Config;
return this.Config;
return super.getInventoryByName( name );
}
@@ -127,24 +127,24 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
@MENetworkEventSubscribe
public void powerRender(MENetworkPowerStatusChange c)
{
boolean currentActive = proxy.isActive();
if ( wasActive != currentActive )
boolean currentActive = this.proxy.isActive();
if ( this.wasActive != currentActive )
{
wasActive = currentActive;
updateHandler();// proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
getHost().markForUpdate();
this.wasActive = currentActive;
this.updateHandler();// proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
this.getHost().markForUpdate();
}
}
@MENetworkEventSubscribe
public void updateChannels(MENetworkChannelsChanged changedChannels)
{
boolean currentActive = proxy.isActive();
if ( wasActive != currentActive )
boolean currentActive = this.proxy.isActive();
if ( this.wasActive != currentActive )
{
wasActive = currentActive;
updateHandler();// proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
getHost().markForUpdate();
this.wasActive = currentActive;
this.updateHandler();// proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
this.getHost().markForUpdate();
}
}
@@ -153,7 +153,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(),
CableBusTextures.PartPlaneSides.getIcon() );
rh.setBounds( 1, 1, 15, 15, 15, 16 );
@@ -175,38 +175,38 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
ForgeDirection e = rh.getWorldX();
ForgeDirection u = rh.getWorldY();
TileEntity te = getHost().getTile();
TileEntity te = this.getHost().getTile();
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) )
minX = 0;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) )
maxX = 16;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) )
minY = 0;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) )
maxY = 16;
boolean isActive = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG);
boolean isActive = (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG);
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : is.getIconIndex(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : this.is.getIconIndex(),
CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
rh.setBounds( minX, minY, 15, maxX, maxY, 16 );
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : is.getIconIndex(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : this.is.getIconIndex(),
CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
rh.setBounds( 5, 5, 14, 11, 11, 15 );
rh.renderBlock( x, y, z, renderer );
renderLights( x, y, z, rh, renderer );
this.renderLights( x, y, z, rh, renderer );
}
private boolean isTransitionPlane(TileEntity blockTileEntity, ForgeDirection side)
@@ -227,7 +227,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
int maxX = 15;
int maxY = 15;
IPartHost host = getHost();
IPartHost host = this.getHost();
if ( host != null )
{
TileEntity te = host.getTile();
@@ -239,16 +239,16 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
ForgeDirection e = bch.getWorldX();
ForgeDirection u = bch.getWorldY();
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - e.offsetX, y - e.offsetY, z - e.offsetZ ), this.side ) )
minX = 0;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + e.offsetX, y + e.offsetY, z + e.offsetZ ), this.side ) )
maxX = 16;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x - u.offsetX, y - u.offsetY, z - u.offsetZ ), this.side ) )
minY = 0;
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) )
if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) )
maxY = 16;
}
@@ -265,10 +265,10 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
@Override
public List<IMEInventoryHandler> getCellArray(StorageChannel channel)
{
if ( proxy.isActive() && channel == StorageChannel.ITEMS )
if ( this.proxy.isActive() && channel == StorageChannel.ITEMS )
{
List<IMEInventoryHandler> Handler = new ArrayList<IMEInventoryHandler>( 1 );
Handler.add( myHandler );
Handler.add( this.myHandler );
return Handler;
}
return new ArrayList<IMEInventoryHandler>();
@@ -277,16 +277,16 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
@Override
public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue)
{
updateHandler();
host.markForSave();
this.updateHandler();
this.host.markForSave();
}
@Override
public void setPriority(int newValue)
{
priority = newValue;
host.markForSave();
updateHandler();
this.priority = newValue;
this.host.markForSave();
this.updateHandler();
}
@Override
@@ -294,40 +294,40 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
{
super.onChangeInventory( inv, slot, mc, removedStack, newStack );
if ( inv == Config )
updateHandler();
if ( inv == this.Config )
this.updateHandler();
}
@Override
public void upgradesChanged()
{
updateHandler();
this.updateHandler();
}
private void updateHandler()
{
myHandler.myAccess = AccessRestriction.WRITE;
myHandler.myWhitelist = getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST;
myHandler.myPriority = priority;
this.myHandler.myAccess = AccessRestriction.WRITE;
this.myHandler.myWhitelist = this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST;
this.myHandler.myPriority = this.priority;
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
int slotsToUse = 18 + getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
for (int x = 0; x < Config.getSizeInventory() && x < slotsToUse; x++)
int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
for (int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++)
{
IAEItemStack is = Config.getAEStackInSlot( x );
IAEItemStack is = this.Config.getAEStackInSlot( x );
if ( is != null )
priorityList.add( is );
}
if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
myHandler.myPartitionList = new FuzzyPriorityList( priorityList, (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) );
if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
this.myHandler.myPartitionList = new FuzzyPriorityList( priorityList, (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) );
else
myHandler.myPartitionList = new PrecisePriorityList( priorityList );
this.myHandler.myPartitionList = new PrecisePriorityList( priorityList );
try
{
proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
}
catch (GridAccessException e)
{
@@ -339,17 +339,17 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
Config.writeToNBT( data, "config" );
data.setInteger( "priority", priority );
this.Config.writeToNBT( data, "config" );
data.setInteger( "priority", this.priority );
}
@Override
public void readFromNBT(NBTTagCompound data)
{
super.readFromNBT( data );
Config.readFromNBT( data, "config" );
priority = data.getInteger( "priority" );
updateHandler();
this.Config.readFromNBT( data, "config" );
this.priority = data.getInteger( "priority" );
this.updateHandler();
}
@Override
@@ -373,7 +373,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
@Override
public int getPriority()
{
return priority;
return this.priority;
}
@Override
@@ -385,7 +385,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
@Override
public void onNeighborChanged()
{
TileEntity te = host.getTile();
TileEntity te = this.host.getTile();
World w = te.getWorldObj();
ForgeDirection side = this.side;
@@ -393,13 +393,13 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
int y = te.yCoord + side.offsetY;
int z = te.zCoord + side.offsetZ;
blocked = !w.getBlock( x, y, z ).isReplaceable( w, x, y, z );
this.blocked = !w.getBlock( x, y, z ).isReplaceable( w, x, y, z );
}
@Override
public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src)
{
if ( blocked || input == null || input.getStackSize() <= 0 )
if ( this.blocked || input == null || input.getStackSize() <= 0 )
return input;
ItemStack is = input.getItemStack();
@@ -408,7 +408,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
long maxStorage = Math.min( input.getStackSize(), is.getMaxStackSize() );
boolean worked = false;
TileEntity te = host.getTile();
TileEntity te = this.host.getTile();
World w = te.getWorldObj();
ForgeDirection side = this.side;
@@ -422,7 +422,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|| i instanceof ItemReed )
{
EntityPlayer player = Platform.getPlayer( (WorldServer) w );
Platform.configurePlayer( player, side, tile );
Platform.configurePlayer( player, side, this.tile );
if ( i instanceof ItemFirework )
{
@@ -514,7 +514,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
}
}
blocked = !w.getBlock( x, y, z ).isReplaceable( w, x, y, z );
this.blocked = !w.getBlock( x, y, z ).isReplaceable( w, x, y, z );
if ( worked )
{
@@ -60,9 +60,9 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
public PartImportBus(ItemStack is) {
super( PartImportBus.class, is );
settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
mySrc = new MachineSource( this );
this.settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
this.settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
this.mySrc = new MachineSource( this );
}
@Override
@@ -73,7 +73,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
if ( Platform.isClient() )
return true;
Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_BUS );
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_BUS );
return true;
}
@@ -86,7 +86,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
if ( stack == null || stack.getItem() == null )
return false;
IAEItemStack out = destination.injectItems( lastItemChecked = AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, mySrc );
IAEItemStack out = this.destination.injectItems( this.lastItemChecked = AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, this.mySrc );
if ( out == null )
return true;
return out.getStackSize() != stack.stackSize;
@@ -94,7 +94,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
private IInventoryDestination configDestination( IMEMonitor<IAEItemStack> itemInventory )
{
destination = itemInventory;
this.destination = itemInventory;
return this;
}
@@ -103,7 +103,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
rh.setBounds( 3, 3, 15, 13, 13, 16 );
rh.renderInventoryBox( renderer );
@@ -119,9 +119,9 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
rh.setBounds( 4, 4, 14, 12, 12, 16 );
rh.renderBlock( x, y, z, renderer );
@@ -132,13 +132,13 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
rh.setBounds( 6, 6, 12, 10, 10, 13 );
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorSidesStatus.getIcon() );
rh.setBounds( 6, 6, 11, 10, 10, 12 );
rh.renderBlock( x, y, z, renderer );
renderLights( x, y, z, rh, renderer );
this.renderLights( x, y, z, rh, renderer );
}
@Override
@@ -158,7 +158,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
@Override
public TickingRequest getTickingRequest(IGridNode node)
{
return new TickingRequest( TickRates.ImportBus.min, TickRates.ImportBus.max, getHandler() == null, false );
return new TickingRequest( TickRates.ImportBus.min, TickRates.ImportBus.max, this.getHandler() == null, false );
}
private int itemToSend; // used in tickingRequest
@@ -167,52 +167,52 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
@Override
TickRateModulation doBusWork()
{
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return TickRateModulation.IDLE;
worked = false;
this.worked = false;
InventoryAdaptor myAdaptor = getHandler();
FuzzyMode fzMode = (FuzzyMode) getConfigManager().getSetting( Settings.FUZZY_MODE );
InventoryAdaptor myAdaptor = this.getHandler();
FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE );
if ( myAdaptor != null )
{
try
{
switch (getInstalledUpgrades( Upgrades.SPEED ))
switch (this.getInstalledUpgrades( Upgrades.SPEED ))
{
default:
case 0:
itemToSend = 1;
this.itemToSend = 1;
break;
case 1:
itemToSend = 8;
this.itemToSend = 8;
break;
case 2:
itemToSend = 32;
this.itemToSend = 32;
break;
case 3:
itemToSend = 64;
this.itemToSend = 64;
break;
case 4:
itemToSend = 96;
this.itemToSend = 96;
break;
}
itemToSend = Math.min( itemToSend, (int) (0.01 + proxy.getEnergy().extractAEPower( itemToSend, Actionable.SIMULATE, PowerMultiplier.CONFIG )) );
IMEMonitor<IAEItemStack> inv = proxy.getStorage().getItemInventory();
IEnergyGrid energy = proxy.getEnergy();
this.itemToSend = Math.min( this.itemToSend, (int) (0.01 + this.proxy.getEnergy().extractAEPower( this.itemToSend, Actionable.SIMULATE, PowerMultiplier.CONFIG )) );
IMEMonitor<IAEItemStack> inv = this.proxy.getStorage().getItemInventory();
IEnergyGrid energy = this.proxy.getEnergy();
boolean Configured = false;
for (int x = 0; x < availableSlots(); x++)
for (int x = 0; x < this.availableSlots(); x++)
{
IAEItemStack ais = config.getAEStackInSlot( x );
if ( ais != null && itemToSend > 0 )
IAEItemStack ais = this.config.getAEStackInSlot( x );
if ( ais != null && this.itemToSend > 0 )
{
Configured = true;
while (itemToSend > 0)
while (this.itemToSend > 0)
{
if ( importStuff( myAdaptor, ais, inv, energy, fzMode ) )
if ( this.importStuff( myAdaptor, ais, inv, energy, fzMode ) )
break;
}
}
@@ -220,9 +220,9 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
if ( !Configured )
{
while (itemToSend > 0)
while (this.itemToSend > 0)
{
if ( importStuff( myAdaptor, null, inv, energy, fzMode ) )
if ( this.importStuff( myAdaptor, null, inv, energy, fzMode ) )
break;
}
}
@@ -235,13 +235,13 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
else
return TickRateModulation.SLEEP;
return worked ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
return this.worked ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
}
@Override
public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
{
return doBusWork();
return this.doBusWork();
}
private boolean importStuff(InventoryAdaptor myAdaptor, IAEItemStack whatToImport, IMEMonitor<IAEItemStack> inv, IEnergySource energy, FuzzyMode fzMode)
@@ -252,22 +252,22 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
toSend = 64;
ItemStack newItems;
if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
newItems = myAdaptor.removeSimilarItems( toSend, whatToImport == null ? null : whatToImport.getItemStack(), fzMode, configDestination( inv ) );
if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
newItems = myAdaptor.removeSimilarItems( toSend, whatToImport == null ? null : whatToImport.getItemStack(), fzMode, this.configDestination( inv ) );
else
newItems = myAdaptor.removeItems( toSend, whatToImport == null ? null : whatToImport.getItemStack(), configDestination( inv ) );
newItems = myAdaptor.removeItems( toSend, whatToImport == null ? null : whatToImport.getItemStack(), this.configDestination( inv ) );
if ( newItems != null )
{
newItems.stackSize = (int) (Math.min( newItems.stackSize, energy.extractAEPower( newItems.stackSize, Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) + 0.01);
itemToSend -= newItems.stackSize;
this.itemToSend -= newItems.stackSize;
if ( lastItemChecked == null || !lastItemChecked.isSameType( newItems ) )
lastItemChecked = AEApi.instance().storage().createItemStack( newItems );
if ( this.lastItemChecked == null || !this.lastItemChecked.isSameType( newItems ) )
this.lastItemChecked = AEApi.instance().storage().createItemStack( newItems );
else
lastItemChecked.setStackSize( newItems.stackSize );
this.lastItemChecked.setStackSize( newItems.stackSize );
IAEItemStack failed = Platform.poweredInsert( energy, destination, lastItemChecked, mySrc );
IAEItemStack failed = Platform.poweredInsert( energy, this.destination, this.lastItemChecked, this.mySrc );
// destination.injectItems( lastItemChecked, Actionable.MODULATE );
if ( failed != null )
{
@@ -275,7 +275,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
return true;
}
else
worked = true;
this.worked = true;
}
else
return true;
@@ -286,13 +286,13 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
@Override
public RedstoneMode getRSMode()
{
return (RedstoneMode) settings.getSetting( Settings.REDSTONE_CONTROLLED );
return (RedstoneMode) this.settings.getSetting( Settings.REDSTONE_CONTROLLED );
}
@Override
protected boolean isSleeping()
{
return getHandler() == null || super.isSleeping();
return this.getHandler() == null || super.isSleeping();
}
}
@@ -94,54 +94,54 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
public long getReportingValue()
{
return reportingValue;
return this.reportingValue;
}
public void setReportingValue(long v)
{
reportingValue = v;
if ( getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL )
configureWatchers();
this.reportingValue = v;
if ( this.getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL )
this.configureWatchers();
else
updateState();
this.updateState();
}
@MENetworkEventSubscribe
public void powerChanged(MENetworkPowerStatusChange c)
{
updateState();
this.updateState();
}
@MENetworkEventSubscribe
public void channelChanged(MENetworkChannelsChanged c)
{
updateState();
this.updateState();
}
@Override
public void upgradesChanged()
{
configureWatchers();
this.configureWatchers();
}
@Override
public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue)
{
configureWatchers();
this.configureWatchers();
}
private void updateState()
{
if ( proxy.isActive() )
if ( this.proxy.isActive() )
{
boolean isOn = isLevelEmitterOn();
if ( prevState != isOn )
boolean isOn = this.isLevelEmitterOn();
if ( this.prevState != isOn )
{
host.markForUpdate();
TileEntity te = host.getTile();
prevState = isOn;
this.host.markForUpdate();
TileEntity te = this.host.getTile();
this.prevState = isOn;
Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord );
Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ );
Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ );
}
}
}
@@ -150,93 +150,93 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
data.setLong( "lastReportedValue", lastReportedValue );
data.setLong( "reportingValue", reportingValue );
data.setBoolean( "prevState", prevState );
config.writeToNBT( data, "config" );
data.setLong( "lastReportedValue", this.lastReportedValue );
data.setLong( "reportingValue", this.reportingValue );
data.setBoolean( "prevState", this.prevState );
this.config.writeToNBT( data, "config" );
}
@Override
public void readFromNBT(NBTTagCompound data)
{
super.readFromNBT( data );
lastReportedValue = data.getLong( "lastReportedValue" );
reportingValue = data.getLong( "reportingValue" );
prevState = data.getBoolean( "prevState" );
config.readFromNBT( data, "config" );
this.lastReportedValue = data.getLong( "lastReportedValue" );
this.reportingValue = data.getLong( "reportingValue" );
this.prevState = data.getBoolean( "prevState" );
this.config.readFromNBT( data, "config" );
}
@Override
protected int populateFlags(int cf)
{
return cf | (prevState ? FLAG_ON : 0);
return cf | (this.prevState ? this.FLAG_ON : 0);
}
@Override
public void updateWatcher(ICraftingWatcher newWatcher)
{
myCraftingWatcher = newWatcher;
configureWatchers();
this.myCraftingWatcher = newWatcher;
this.configureWatchers();
}
@Override
public void updateWatcher(IStackWatcher newWatcher)
{
myWatcher = newWatcher;
configureWatchers();
this.myWatcher = newWatcher;
this.configureWatchers();
}
@Override
public void updateWatcher(IEnergyWatcher newWatcher)
{
myEnergyWatcher = newWatcher;
configureWatchers();
this.myEnergyWatcher = newWatcher;
this.configureWatchers();
}
// update the system...
public void configureWatchers()
{
IAEItemStack myStack = config.getAEStackInSlot( 0 );
IAEItemStack myStack = this.config.getAEStackInSlot( 0 );
if ( myWatcher != null )
myWatcher.clear();
if ( this.myWatcher != null )
this.myWatcher.clear();
if ( myEnergyWatcher != null )
myEnergyWatcher.clear();
if ( this.myEnergyWatcher != null )
this.myEnergyWatcher.clear();
if ( myCraftingWatcher != null )
myCraftingWatcher.clear();
if ( this.myCraftingWatcher != null )
this.myCraftingWatcher.clear();
try
{
proxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, proxy.getNode() ) );
this.proxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.proxy.getNode() ) );
}
catch (GridAccessException e1)
{
// :/
}
if ( getInstalledUpgrades( Upgrades.CRAFTING ) > 0 )
if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 )
{
if ( myCraftingWatcher != null && myStack != null )
myCraftingWatcher.add( myStack );
if ( this.myCraftingWatcher != null && myStack != null )
this.myCraftingWatcher.add( myStack );
return;
}
if ( getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL )
if ( this.getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL )
{
if ( myEnergyWatcher != null )
myEnergyWatcher.add( (double) reportingValue );
if ( this.myEnergyWatcher != null )
this.myEnergyWatcher.add( (double) this.reportingValue );
try
{
// update to power...
lastReportedValue = (long) proxy.getEnergy().getStoredPower();
updateState();
this.lastReportedValue = (long) this.proxy.getEnergy().getStoredPower();
this.updateState();
// no more item stuff..
proxy.getStorage().getItemInventory().removeListener( this );
this.proxy.getStorage().getItemInventory().removeListener( this );
}
catch (GridAccessException e)
{
@@ -248,19 +248,19 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
try
{
if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 || myStack == null )
if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 || myStack == null )
{
proxy.getStorage().getItemInventory().addListener( this, proxy.getGrid() );
this.proxy.getStorage().getItemInventory().addListener( this, this.proxy.getGrid() );
}
else
{
proxy.getStorage().getItemInventory().removeListener( this );
this.proxy.getStorage().getItemInventory().removeListener( this );
if ( myWatcher != null )
myWatcher.add( myStack );
if ( this.myWatcher != null )
this.myWatcher.add( myStack );
}
updateReportingValue( proxy.getStorage().getItemInventory() );
this.updateReportingValue( this.proxy.getStorage().getItemInventory() );
}
catch (GridAccessException e)
{
@@ -271,8 +271,8 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
if ( inv == config )
configureWatchers();
if ( inv == this.config )
this.configureWatchers();
super.onChangeInventory( inv, slot, mc, removedStack, newStack );
}
@@ -280,7 +280,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override
public void postChange(IBaseMonitor<IAEItemStack> monitor, Iterable<IAEItemStack> change, BaseActionSource actionSource)
{
updateReportingValue( (IMEMonitor<IAEItemStack>) monitor );
this.updateReportingValue( (IMEMonitor<IAEItemStack>) monitor );
}
@Override
@@ -291,7 +291,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
if ( Platform.isClient() )
return true;
Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_LEVEL_EMITTER );
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_LEVEL_EMITTER );
return true;
}
@@ -300,32 +300,32 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
private void updateReportingValue(IMEMonitor<IAEItemStack> monitor)
{
IAEItemStack myStack = config.getAEStackInSlot( 0 );
IAEItemStack myStack = this.config.getAEStackInSlot( 0 );
if ( myStack == null )
{
lastReportedValue = 0;
this.lastReportedValue = 0;
for (IAEItemStack st : monitor.getStorageList())
lastReportedValue += st.getStackSize();
this.lastReportedValue += st.getStackSize();
}
else if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
else if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
{
lastReportedValue = 0;
FuzzyMode fzMode = (FuzzyMode) getConfigManager().getSetting( Settings.FUZZY_MODE );
this.lastReportedValue = 0;
FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE );
Collection<IAEItemStack> fuzzyList = monitor.getStorageList().findFuzzy( myStack, fzMode );
for (IAEItemStack st : fuzzyList)
lastReportedValue += st.getStackSize();
this.lastReportedValue += st.getStackSize();
}
else
{
IAEItemStack r = monitor.getStorageList().findPrecise( myStack );
if ( r == null )
lastReportedValue = 0;
this.lastReportedValue = 0;
else
lastReportedValue = r.getStackSize();
this.lastReportedValue = r.getStackSize();
}
updateState();
this.updateState();
}
@Override
@@ -333,7 +333,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
{
try
{
return proxy.getGrid() == effectiveGrid;
return this.proxy.getGrid() == effectiveGrid;
}
catch (GridAccessException e)
{
@@ -344,41 +344,41 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override
public void onRequestChange(ICraftingGrid craftingGrid, IAEItemStack what)
{
updateState();
this.updateState();
}
@Override
public void onThresholdPass(IEnergyGrid energyGrid)
{
lastReportedValue = (long) energyGrid.getStoredPower();
updateState();
this.lastReportedValue = (long) energyGrid.getStoredPower();
this.updateState();
}
@Override
public void onStackChange(IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan)
{
if ( chan == StorageChannel.ITEMS && fullStack.equals( config.getAEStackInSlot( 0 ) ) && getInstalledUpgrades( Upgrades.FUZZY ) == 0 )
if ( chan == StorageChannel.ITEMS && fullStack.equals( this.config.getAEStackInSlot( 0 ) ) && this.getInstalledUpgrades( Upgrades.FUZZY ) == 0 )
{
lastReportedValue = fullStack.getStackSize();
updateState();
this.lastReportedValue = fullStack.getStackSize();
this.updateState();
}
}
public PartLevelEmitter(ItemStack is) {
super( PartLevelEmitter.class, is );
getConfigManager().registerSetting( Settings.REDSTONE_EMITTER, RedstoneMode.HIGH_SIGNAL );
getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
getConfigManager().registerSetting( Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL );
getConfigManager().registerSetting( Settings.CRAFT_VIA_REDSTONE, YesNo.NO );
this.getConfigManager().registerSetting( Settings.REDSTONE_EMITTER, RedstoneMode.HIGH_SIGNAL );
this.getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
this.getConfigManager().registerSetting( Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL );
this.getConfigManager().registerSetting( Settings.CRAFT_VIA_REDSTONE, YesNo.NO );
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( is.getIconIndex() );
rh.setTexture( this.is.getIconIndex() );
Tessellator.instance.startDrawingQuads();
renderTorchAtAngle( 0, -0.5, 0 );
this.renderTorchAtAngle( 0, -0.5, 0 );
Tessellator.instance.draw();
// rh.setBounds( 7, 7, 10, 9, 9, 15 );
// rh.renderInventoryBox( renderer );
@@ -392,17 +392,17 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
{
Tessellator var12 = Tessellator.instance;
x -= centerX;
y -= centerY;
z -= centerZ;
x -= this.centerX;
y -= this.centerY;
z -= this.centerZ;
if ( side == ForgeDirection.DOWN )
if ( this.side == ForgeDirection.DOWN )
{
y = -y;
z = -z;
}
if ( side == ForgeDirection.EAST )
if ( this.side == ForgeDirection.EAST )
{
double m = x;
x = y;
@@ -410,14 +410,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
y = -y;
}
if ( side == ForgeDirection.WEST )
if ( this.side == ForgeDirection.WEST )
{
double m = x;
x = -y;
y = m;
}
if ( side == ForgeDirection.SOUTH )
if ( this.side == ForgeDirection.SOUTH )
{
double m = z;
z = y;
@@ -425,16 +425,16 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
y = -y;
}
if ( side == ForgeDirection.NORTH )
if ( this.side == ForgeDirection.NORTH )
{
double m = z;
z = -y;
y = m;
}
x += centerX;// + orientation.offsetX * 0.4;
y += centerY;// + orientation.offsetY * 0.4;
z += centerZ;// + orientation.offsetZ * 0.4;
x += this.centerX;// + orientation.offsetX * 0.4;
y += this.centerY;// + orientation.offsetY * 0.4;
z += this.centerZ;// + orientation.offsetZ * 0.4;
var12.addVertexWithUV( x, y, z, u, v );
}
@@ -442,9 +442,9 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random r)
{
if ( isLevelEmitterOn() )
if ( this.isLevelEmitterOn() )
{
ForgeDirection d = side;
ForgeDirection d = this.side;
double d0 = d.offsetX * 0.45F + (r.nextFloat() - 0.5F) * 0.2D;
double d1 = d.offsetY * 0.45F + (r.nextFloat() - 0.5F) * 0.2D;
@@ -456,13 +456,13 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
public void renderTorchAtAngle(double baseX, double baseY, double baseZ)
{
boolean isOn = isLevelEmitterOn();
IIcon offTexture = is.getIconIndex();
boolean isOn = this.isLevelEmitterOn();
IIcon offTexture = this.is.getIconIndex();
IIcon IIcon = (isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture);
//
centerX = baseX + 0.5;
centerY = baseY + 0.5;
centerZ = baseZ + 0.5;
this.centerX = baseX + 0.5;
this.centerY = baseY + 0.5;
this.centerZ = baseZ + 0.5;
baseY += 7.0 / 16.0;
@@ -567,31 +567,31 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
private boolean isLevelEmitterOn()
{
if ( Platform.isClient() )
return (clientFlags & FLAG_ON) == FLAG_ON;
return (this.clientFlags & this.FLAG_ON) == this.FLAG_ON;
if ( getInstalledUpgrades( Upgrades.CRAFTING ) > 0 )
if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 )
{
try
{
return proxy.getCrafting().isRequesting( config.getAEStackInSlot( 0 ) );
return this.proxy.getCrafting().isRequesting( this.config.getAEStackInSlot( 0 ) );
}
catch (GridAccessException e)
{
// :P
}
return prevState;
return this.prevState;
}
boolean flipState = getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL;
return flipState ? reportingValue >= lastReportedValue + 1 : reportingValue < lastReportedValue + 1;
boolean flipState = this.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL;
return flipState ? this.reportingValue >= this.lastReportedValue + 1 : this.reportingValue < this.lastReportedValue + 1;
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( is.getIconIndex() );
rh.setTexture( this.is.getIconIndex() );
// rh.setTexture( CableBusTextures.ItemPartLevelEmitterOn.getIcon() );
// rh.setBounds( 2, 2, 14, 14, 14, 16 );
@@ -606,12 +606,12 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
tess.setBrightness( rh.getBlock().getMixedBrightnessForBlock( this.getHost().getTile().getWorldObj(), x, y, z ) );
tess.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
renderTorchAtAngle( x, y, z );
this.renderTorchAtAngle( x, y, z );
renderer.renderAllFaces = false;
rh.setBounds( 7, 7, 11, 9, 9, 12 );
renderLights( x, y, z, rh, renderer );
this.renderLights( x, y, z, rh, renderer );
// super.renderWorldBlock( world, x, y, z, block, modelId, renderer );
}
@@ -619,7 +619,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override
public IIcon getBreakingTexture()
{
return is.getIconIndex();
return this.is.getIconIndex();
}
@Override
@@ -649,20 +649,20 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override
public int isProvidingStrongPower()
{
return prevState ? 15 : 0;
return this.prevState ? 15 : 0;
}
@Override
public int isProvidingWeakPower()
{
return prevState ? 15 : 0;
return this.prevState ? 15 : 0;
}
@Override
public IInventory getInventoryByName(String name)
{
if ( name.equals( "config" ) )
return config;
return this.config;
return super.getInventoryByName( name );
}
@@ -672,7 +672,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
{
try
{
updateReportingValue( proxy.getStorage().getItemInventory() );
this.updateReportingValue( this.proxy.getStorage().getItemInventory() );
}
catch (GridAccessException e)
{
@@ -695,11 +695,11 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override
public void provideCrafting(ICraftingProviderHelper craftingTracker)
{
if ( getInstalledUpgrades( Upgrades.CRAFTING ) > 0 )
if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 )
{
if ( settings.getSetting( Settings.CRAFT_VIA_REDSTONE ) == YesNo.YES )
if ( this.settings.getSetting( Settings.CRAFT_VIA_REDSTONE ) == YesNo.YES )
{
IAEItemStack what = config.getAEStackInSlot( 0 );
IAEItemStack what = this.config.getAEStackInSlot( 0 );
if ( what != null )
craftingTracker.setEmitable( what );
}
@@ -53,26 +53,26 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
@Override
public void upgradesChanged()
{
updateState();
this.updateState();
}
protected int availableSlots()
{
return Math.min( 1 + getInstalledUpgrades( Upgrades.CAPACITY ) * 4, config.getSizeInventory() );
return Math.min( 1 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 4, this.config.getSizeInventory() );
}
@Override
public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra)
{
super.writeToNBT( extra );
config.writeToNBT( extra, "config" );
this.config.writeToNBT( extra, "config" );
}
@Override
public void readFromNBT(net.minecraft.nbt.NBTTagCompound extra)
{
super.readFromNBT( extra );
config.readFromNBT( extra, "config" );
this.config.readFromNBT( extra, "config" );
}
final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 9 );
@@ -82,18 +82,18 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
InventoryAdaptor getHandler()
{
TileEntity self = getHost().getTile();
TileEntity target = getTileEntity( self, self.xCoord + side.offsetX, self.yCoord + side.offsetY, self.zCoord + side.offsetZ );
TileEntity self = this.getHost().getTile();
TileEntity target = this.getTileEntity( self, self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ );
int newAdaptorHash = Platform.generateTileHash( target );
if ( adaptorHash == newAdaptorHash && newAdaptorHash != 0 )
return adaptor;
if ( this.adaptorHash == newAdaptorHash && newAdaptorHash != 0 )
return this.adaptor;
adaptorHash = newAdaptorHash;
adaptor = InventoryAdaptor.getAdaptor( target, side.getOpposite() );
this.adaptorHash = newAdaptorHash;
this.adaptor = InventoryAdaptor.getAdaptor( target, this.side.getOpposite() );
return adaptor;
return this.adaptor;
}
boolean lastRedstone = false;
@@ -103,12 +103,12 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
@Override
public void onNeighborChanged()
{
updateState();
if ( lastRedstone != host.hasRedstone( side ) )
this.updateState();
if ( this.lastRedstone != this.host.hasRedstone( this.side ) )
{
lastRedstone = !lastRedstone;
if ( lastRedstone && getRSMode() == RedstoneMode.SIGNAL_PULSE )
doBusWork();
this.lastRedstone = !this.lastRedstone;
if ( this.lastRedstone && this.getRSMode() == RedstoneMode.SIGNAL_PULSE )
this.doBusWork();
}
}
@@ -116,10 +116,10 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
{
try
{
if ( !isSleeping() )
proxy.getTick().wakeDevice( proxy.getNode() );
if ( !this.isSleeping() )
this.proxy.getTick().wakeDevice( this.proxy.getNode() );
else
proxy.getTick().sleepDevice( proxy.getNode() );
this.proxy.getTick().sleepDevice( this.proxy.getNode() );
}
catch (GridAccessException e)
{
@@ -131,7 +131,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
public IInventory getInventoryByName(String name)
{
if ( name.equals( "config" ) )
return config;
return this.config;
return super.getInventoryByName( name );
}
@@ -35,18 +35,18 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor
{
final IConfigManager settings = new ConfigManager( this );
private final UpgradeInventory upgrades = new UpgradeInventory( is, this, getUpgradeSlots() );
private final UpgradeInventory upgrades = new UpgradeInventory( this.is, this, this.getUpgradeSlots() );
@Override
public int getInstalledUpgrades(Upgrades u)
{
return upgrades.getInstalledUpgrades( u );
return this.upgrades.getInstalledUpgrades( u );
}
@Override
public boolean canConnectRedstone()
{
return upgrades.getMaxInstalled( Upgrades.REDSTONE ) > 0;
return this.upgrades.getMaxInstalled( Upgrades.REDSTONE ) > 0;
}
protected int getUpgradeSlots()
@@ -57,7 +57,7 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor
@Override
public void getDrops(List<ItemStack> drops, boolean wrenched)
{
for (ItemStack is : upgrades)
for (ItemStack is : this.upgrades)
if ( is != null )
drops.add( is );
}
@@ -66,34 +66,34 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor
public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra)
{
super.writeToNBT( extra );
settings.writeToNBT( extra );
upgrades.writeToNBT( extra, "upgrades" );
this.settings.writeToNBT( extra );
this.upgrades.writeToNBT( extra, "upgrades" );
}
@Override
public void readFromNBT(net.minecraft.nbt.NBTTagCompound extra)
{
super.readFromNBT( extra );
settings.readFromNBT( extra );
upgrades.readFromNBT( extra, "upgrades" );
this.settings.readFromNBT( extra );
this.upgrades.readFromNBT( extra, "upgrades" );
}
public PartUpgradeable(Class c, ItemStack is) {
super( c, is );
upgrades.setMaxStackSize( 1 );
this.upgrades.setMaxStackSize( 1 );
}
@Override
public IConfigManager getConfigManager()
{
return settings;
return this.settings;
}
@Override
public IInventory getInventoryByName(String name)
{
if ( name.equals( "upgrades" ) )
return upgrades;
return this.upgrades;
return null;
}
@@ -112,9 +112,9 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
if ( inv == upgrades )
if ( inv == this.upgrades )
{
upgradesChanged();
this.upgradesChanged();
}
}
@@ -125,21 +125,21 @@ public class PartUpgradeable extends PartBasicState implements IAEAppEngInventor
protected boolean isSleeping()
{
if ( getInstalledUpgrades( Upgrades.REDSTONE ) > 0 )
if ( this.getInstalledUpgrades( Upgrades.REDSTONE ) > 0 )
{
switch (getRSMode())
switch (this.getRSMode())
{
case IGNORE:
return false;
case HIGH_SIGNAL:
if ( host.hasRedstone( side ) )
if ( this.host.hasRedstone( this.side ) )
return false;
break;
case LOW_SIGNAL:
if ( !host.hasRedstone( side ) )
if ( !this.host.hasRedstone( this.side ) )
return false;
break;
@@ -47,8 +47,8 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
public UpgradeInventory(Object itemOrBlock, IAEAppEngInventory _te, int s) {
super( null, s );
te = this;
parent = _te;
this.te = this;
this.parent = _te;
this.itemOrBlock = itemOrBlock;
}
@@ -69,7 +69,7 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
Upgrades u = ((IUpgradeModule) it).getType( itemstack );
if ( u != null )
{
return getInstalledUpgrades( u ) < getMaxInstalled( u );
return this.getInstalledUpgrades( u ) < this.getMaxInstalled( u );
}
}
return false;
@@ -80,17 +80,17 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
Integer max = null;
for (ItemStack is : u.getSupported().keySet())
{
if ( is.getItem() == itemOrBlock )
if ( is.getItem() == this.itemOrBlock )
{
max = u.getSupported().get( is );
break;
}
else if ( is.getItem() instanceof ItemBlock && Block.getBlockFromItem( is.getItem() ) == itemOrBlock )
else if ( is.getItem() instanceof ItemBlock && Block.getBlockFromItem( is.getItem() ) == this.itemOrBlock )
{
max = u.getSupported().get( is );
break;
}
else if ( itemOrBlock instanceof ItemStack && Platform.isSameItem( (ItemStack) itemOrBlock, is ) )
else if ( this.itemOrBlock instanceof ItemStack && Platform.isSameItem( (ItemStack) this.itemOrBlock, is ) )
{
max = u.getSupported().get( is );
break;
@@ -110,8 +110,8 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
private void updateUpgradeInfo()
{
cached = true;
InverterUpgrades = CapacityUpgrades = RedstoneUpgrades = SpeedUpgrades = FuzzyUpgrades = CraftingUpgrades = 0;
this.cached = true;
this.InverterUpgrades = this.CapacityUpgrades = this.RedstoneUpgrades = this.SpeedUpgrades = this.FuzzyUpgrades = this.CraftingUpgrades = 0;
for (ItemStack is : this)
{
@@ -122,55 +122,55 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
switch (myUpgrade)
{
case CAPACITY:
CapacityUpgrades++;
this.CapacityUpgrades++;
break;
case FUZZY:
FuzzyUpgrades++;
this.FuzzyUpgrades++;
break;
case REDSTONE:
RedstoneUpgrades++;
this.RedstoneUpgrades++;
break;
case SPEED:
SpeedUpgrades++;
this.SpeedUpgrades++;
break;
case INVERTER:
InverterUpgrades++;
this.InverterUpgrades++;
break;
case CRAFTING:
CraftingUpgrades++;
this.CraftingUpgrades++;
break;
default:
break;
}
}
CapacityUpgrades = Math.min( CapacityUpgrades, getMaxInstalled( Upgrades.CAPACITY ) );
FuzzyUpgrades = Math.min( FuzzyUpgrades, getMaxInstalled( Upgrades.FUZZY ) );
RedstoneUpgrades = Math.min( RedstoneUpgrades, getMaxInstalled( Upgrades.REDSTONE ) );
SpeedUpgrades = Math.min( SpeedUpgrades, getMaxInstalled( Upgrades.SPEED ) );
InverterUpgrades = Math.min( InverterUpgrades, getMaxInstalled( Upgrades.INVERTER ) );
CraftingUpgrades = Math.min( CraftingUpgrades, getMaxInstalled( Upgrades.CRAFTING ) );
this.CapacityUpgrades = Math.min( this.CapacityUpgrades, this.getMaxInstalled( Upgrades.CAPACITY ) );
this.FuzzyUpgrades = Math.min( this.FuzzyUpgrades, this.getMaxInstalled( Upgrades.FUZZY ) );
this.RedstoneUpgrades = Math.min( this.RedstoneUpgrades, this.getMaxInstalled( Upgrades.REDSTONE ) );
this.SpeedUpgrades = Math.min( this.SpeedUpgrades, this.getMaxInstalled( Upgrades.SPEED ) );
this.InverterUpgrades = Math.min( this.InverterUpgrades, this.getMaxInstalled( Upgrades.INVERTER ) );
this.CraftingUpgrades = Math.min( this.CraftingUpgrades, this.getMaxInstalled( Upgrades.CRAFTING ) );
}
public int getInstalledUpgrades(Upgrades u)
{
if ( !cached )
updateUpgradeInfo();
if ( !this.cached )
this.updateUpgradeInfo();
switch (u)
{
case CAPACITY:
return CapacityUpgrades;
return this.CapacityUpgrades;
case FUZZY:
return FuzzyUpgrades;
return this.FuzzyUpgrades;
case REDSTONE:
return RedstoneUpgrades;
return this.RedstoneUpgrades;
case SPEED:
return SpeedUpgrades;
return this.SpeedUpgrades;
case INVERTER:
return InverterUpgrades;
return this.InverterUpgrades;
case CRAFTING:
return CraftingUpgrades;
return this.CraftingUpgrades;
default:
return 0;
}
@@ -180,21 +180,21 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
public void readFromNBT(NBTTagCompound target)
{
super.readFromNBT( target );
updateUpgradeInfo();
this.updateUpgradeInfo();
}
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
cached = false;
if ( parent != null && Platform.isServer() )
parent.onChangeInventory( inv, slot, mc, removedStack, newStack );
this.cached = false;
if ( this.parent != null && Platform.isServer() )
this.parent.onChangeInventory( inv, slot, mc, removedStack, newStack );
}
@Override
public void saveChanges()
{
parent.saveChanges();
this.parent.saveChanges();
}
}
@@ -36,9 +36,9 @@ public class InvLayerData
final private List<InvSot> slots;
public InvLayerData(int a[][], List<ISidedInventory> b, List<InvSot> c) {
sides = a;
inventories = b;
slots = c;
this.sides = a;
this.inventories = b;
this.slots = c;
}
/**
@@ -49,77 +49,77 @@ public class InvLayerData
*/
boolean isSlotValid(int slot)
{
return slots != null && slot >= 0 && slot < slots.size();
return this.slots != null && slot >= 0 && slot < this.slots.size();
}
public ItemStack decreaseStackSize(int slot, int amount)
{
if ( isSlotValid( slot ) )
return slots.get( slot ).decreaseStackSize( amount );
if ( this.isSlotValid( slot ) )
return this.slots.get( slot ).decreaseStackSize( amount );
return null;
}
public int getSizeInventory()
{
if ( slots == null )
if ( this.slots == null )
return 0;
return slots.size();
return this.slots.size();
}
public ItemStack getStackInSlot(int slot)
{
if ( isSlotValid( slot ) )
return slots.get( slot ).getStackInSlot();
if ( this.isSlotValid( slot ) )
return this.slots.get( slot ).getStackInSlot();
return null;
}
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
{
if ( isSlotValid( slot ) )
return slots.get( slot ).isItemValidForSlot( itemstack );
if ( this.isSlotValid( slot ) )
return this.slots.get( slot ).isItemValidForSlot( itemstack );
return false;
}
public void setInventorySlotContents(int slot, ItemStack itemstack)
{
if ( isSlotValid( slot ) )
slots.get( slot ).setInventorySlotContents( itemstack );
if ( this.isSlotValid( slot ) )
this.slots.get( slot ).setInventorySlotContents( itemstack );
}
public boolean canExtractItem(int slot, ItemStack itemstack, int side)
{
if ( isSlotValid( slot ) )
return slots.get( slot ).canExtractItem( itemstack, side );
if ( this.isSlotValid( slot ) )
return this.slots.get( slot ).canExtractItem( itemstack, side );
return false;
}
public boolean canInsertItem(int slot, ItemStack itemstack, int side)
{
if ( isSlotValid( slot ) )
return slots.get( slot ).canInsertItem( itemstack, side );
if ( this.isSlotValid( slot ) )
return this.slots.get( slot ).canInsertItem( itemstack, side );
return false;
}
public void markDirty()
{
if ( inventories != null )
if ( this.inventories != null )
{
for (IInventory inv : inventories)
for (IInventory inv : this.inventories)
inv.markDirty();
}
}
public int[] getAccessibleSlotsFromSide(int side)
{
if ( sides == null || side < 0 || side > 5 )
if ( this.sides == null || side < 0 || side > 5 )
return nullSides;
return sides[side];
return this.sides[side];
}
}
@@ -28,38 +28,38 @@ public class InvSot
final public int index;
public InvSot(ISidedInventory part, int slot) {
partInv = part;
index = slot;
this.partInv = part;
this.index = slot;
}
public ItemStack decreaseStackSize(int j)
{
return partInv.decrStackSize( index, j );
return this.partInv.decrStackSize( this.index, j );
}
public ItemStack getStackInSlot()
{
return partInv.getStackInSlot( index );
return this.partInv.getStackInSlot( this.index );
}
public boolean isItemValidForSlot(ItemStack itemstack)
{
return partInv.isItemValidForSlot( index, itemstack );
return this.partInv.isItemValidForSlot( this.index, itemstack );
}
public void setInventorySlotContents(ItemStack itemstack)
{
partInv.setInventorySlotContents( index, itemstack );
this.partInv.setInventorySlotContents( this.index, itemstack );
}
public boolean canExtractItem(ItemStack itemstack, int side)
{
return partInv.canExtractItem( index, itemstack, side );
return this.partInv.canExtractItem( this.index, itemstack, side );
}
public boolean canInsertItem(ItemStack itemstack, int side)
{
return partInv.canInsertItem( index, itemstack, side );
return this.partInv.canInsertItem( this.index, itemstack, side );
}
}
@@ -30,7 +30,7 @@ public class LayerIBatteryProvider extends LayerBase implements ISidedBatteryPro
@Override
public IBatteryObject getMjBattery(String kind, ForgeDirection direction)
{
IPart p = getPart( direction );
IPart p = this.getPart( direction );
if ( p instanceof ISidedBatteryProvider )
return ((ISidedBatteryProvider) p).getMjBattery( kind, direction );
@@ -35,7 +35,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink
private boolean isInIC2()
{
return getLayerFlags().contains( LayerFlags.IC2_ENET );
return this.getLayerFlags().contains( LayerFlags.IC2_ENET );
}
private TileEntity getEnergySinkTile()
@@ -46,15 +46,15 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink
private World getEnergySinkWorld()
{
if ( getEnergySinkTile() == null )
if ( this.getEnergySinkTile() == null )
return null;
return getEnergySinkTile().getWorldObj();
return this.getEnergySinkTile().getWorldObj();
}
private boolean isTileValid()
{
TileEntity te = getEnergySinkTile();
TileEntity te = this.getEnergySinkTile();
if ( te == null )
return false;
@@ -64,28 +64,28 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink
private void addToENet()
{
if ( getEnergySinkWorld() == null )
if ( this.getEnergySinkWorld() == null )
return;
// re-add
removeFromENet();
this.removeFromENet();
if ( !isInIC2() && Platform.isServer() && isTileValid() )
if ( !this.isInIC2() && Platform.isServer() && this.isTileValid() )
{
getLayerFlags().add( LayerFlags.IC2_ENET );
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergySink) getEnergySinkTile() ) );
this.getLayerFlags().add( LayerFlags.IC2_ENET );
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergySink) this.getEnergySinkTile() ) );
}
}
private void removeFromENet()
{
if ( getEnergySinkWorld() == null )
if ( this.getEnergySinkWorld() == null )
return;
if ( isInIC2() && Platform.isServer() )
if ( this.isInIC2() && Platform.isServer() )
{
getLayerFlags().remove( LayerFlags.IC2_ENET );
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergySink) getEnergySinkTile() ) );
this.getLayerFlags().remove( LayerFlags.IC2_ENET );
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergySink) this.getEnergySinkTile() ) );
}
}
@@ -97,7 +97,7 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink
int interested = 0;
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
IPart part = getPart( dir );
IPart part = this.getPart( dir );
if ( part instanceof IEnergyTile )
{
interested++;
@@ -111,19 +111,19 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink
{
super.partChanged();
if ( interestedInIC2() )
addToENet();
if ( this.interestedInIC2() )
this.addToENet();
else
removeFromENet();
this.removeFromENet();
}
@Override
public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
{
if ( !isInIC2() )
if ( !this.isInIC2() )
return false;
IPart part = getPart( direction );
IPart part = this.getPart( direction );
if ( part instanceof IEnergySink )
return ((IEnergySink) part).acceptsEnergyFrom( emitter, direction );
return false;
@@ -132,14 +132,14 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink
@Override
public double getDemandedEnergy()
{
if ( !isInIC2() )
if ( !this.isInIC2() )
return 0;
// this is a flawed implementation, that requires a change to the IC2 API.
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
IPart part = getPart( dir );
IPart part = this.getPart( dir );
if ( part instanceof IEnergySink )
{
// use lower number cause ic2 deletes power it sends that isn't received.
@@ -153,12 +153,12 @@ public class LayerIEnergySink extends LayerBase implements IEnergySink
@Override
public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage)
{
if ( !isInIC2() )
if ( !this.isInIC2() )
return amount;
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
IPart part = getPart( dir );
IPart part = this.getPart( dir );
if ( part instanceof IEnergySink )
{
return ((IEnergySink) part).injectEnergy( directionFrom, amount, voltage );
@@ -37,7 +37,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource
private boolean isInIC2()
{
return getLayerFlags().contains( LayerFlags.IC2_ENET );
return this.getLayerFlags().contains( LayerFlags.IC2_ENET );
}
private TileEntity getEnergySourceTile()
@@ -48,14 +48,14 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource
private World getEnergySourceWorld()
{
if ( getEnergySourceTile() == null )
if ( this.getEnergySourceTile() == null )
return null;
return getEnergySourceTile().getWorldObj();
return this.getEnergySourceTile().getWorldObj();
}
private boolean isTileValid()
{
TileEntity te = getEnergySourceTile();
TileEntity te = this.getEnergySourceTile();
if ( te == null )
return false;
return !te.isInvalid();
@@ -63,28 +63,28 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource
private void addToENet()
{
if ( getEnergySourceWorld() == null )
if ( this.getEnergySourceWorld() == null )
return;
// re-add
removeFromENet();
this.removeFromENet();
if ( !isInIC2() && Platform.isServer() && isTileValid() )
if ( !this.isInIC2() && Platform.isServer() && this.isTileValid() )
{
getLayerFlags().add( LayerFlags.IC2_ENET );
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergySink) getEnergySourceTile() ) );
this.getLayerFlags().add( LayerFlags.IC2_ENET );
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergySink) this.getEnergySourceTile() ) );
}
}
private void removeFromENet()
{
if ( getEnergySourceWorld() == null )
if ( this.getEnergySourceWorld() == null )
return;
if ( isInIC2() && Platform.isServer() )
if ( this.isInIC2() && Platform.isServer() )
{
getLayerFlags().remove( LayerFlags.IC2_ENET );
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergySink) getEnergySourceTile() ) );
this.getLayerFlags().remove( LayerFlags.IC2_ENET );
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergySink) this.getEnergySourceTile() ) );
}
}
@@ -96,7 +96,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource
int interested = 0;
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
IPart part = getPart( dir );
IPart part = this.getPart( dir );
if ( part instanceof IEnergyTile )
{
interested++;
@@ -110,19 +110,19 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource
{
super.partChanged();
if ( interestedInIC2() )
addToENet();
if ( this.interestedInIC2() )
this.addToENet();
else
removeFromENet();
this.removeFromENet();
}
@Override
public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction)
{
if ( !isInIC2() )
if ( !this.isInIC2() )
return false;
IPart part = getPart( direction );
IPart part = this.getPart( direction );
if ( part instanceof IEnergySink )
return ((IEnergyEmitter) part).emitsEnergyTo( receiver, direction );
return false;
@@ -131,14 +131,14 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource
@Override
public double getOfferedEnergy()
{
if ( !isInIC2() )
if ( !this.isInIC2() )
return 0;
// this is a flawed implementation, that requires a change to the IC2 API.
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
IPart part = getPart( dir );
IPart part = this.getPart( dir );
if ( part instanceof IEnergySource )
{
// use lower number cause ic2 deletes power it sends that isn't received.
@@ -156,7 +156,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
IPart part = getPart( dir );
IPart part = this.getPart( dir );
if ( part instanceof IEnergySource )
{
((IEnergySource) part).drawEnergy( amount );
@@ -172,7 +172,7 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
IPart part = getPart( dir );
IPart part = this.getPart( dir );
if ( part instanceof IEnergySource )
{
return ((IEnergySource) part).getSourceTier();
@@ -33,7 +33,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
{
IPart part = getPart( from );
IPart part = this.getPart( from );
if ( part instanceof IFluidHandler )
return ((IFluidHandler) part).fill( from, resource, doFill );
return 0;
@@ -42,7 +42,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler
@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
{
IPart part = getPart( from );
IPart part = this.getPart( from );
if ( part instanceof IFluidHandler )
return ((IFluidHandler) part).drain( from, resource, doDrain );
return null;
@@ -51,7 +51,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler
@Override
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
{
IPart part = getPart( from );
IPart part = this.getPart( from );
if ( part instanceof IFluidHandler )
return ((IFluidHandler) part).drain( from, maxDrain, doDrain );
return null;
@@ -60,7 +60,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler
@Override
public boolean canFill(ForgeDirection from, net.minecraftforge.fluids.Fluid fluid)
{
IPart part = getPart( from );
IPart part = this.getPart( from );
if ( part instanceof IFluidHandler )
return ((IFluidHandler) part).canFill( from, fluid );
return false;
@@ -69,7 +69,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler
@Override
public boolean canDrain(ForgeDirection from, net.minecraftforge.fluids.Fluid fluid)
{
IPart part = getPart( from );
IPart part = this.getPart( from );
if ( part instanceof IFluidHandler )
return ((IFluidHandler) part).canDrain( from, fluid );
return false;
@@ -78,7 +78,7 @@ public class LayerIFluidHandler extends LayerBase implements IFluidHandler
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection from)
{
IPart part = getPart( from );
IPart part = this.getPart( from );
if ( part instanceof IFluidHandler )
return ((IFluidHandler) part).getTankInfo( from );
return emptyList;
@@ -30,7 +30,7 @@ public class LayerIPipeConnection extends LayerBase implements IPipeConnection
@Override
public ConnectOverride overridePipeConnection(PipeType type, ForgeDirection with)
{
IPart part = getPart( with );
IPart part = this.getPart( with );
if ( part instanceof IPipeConnection )
return ((IPipeConnection) part).overridePipeConnection( type, with );
return ConnectOverride.DEFAULT;
@@ -29,7 +29,7 @@ public class LayerIPowerEmitter extends LayerBase implements IPowerEmitter
@Override
public boolean canEmitPowerFrom(ForgeDirection side)
{
IPart part = getPart( side );
IPart part = this.getPart( side );
if ( part instanceof IPowerEmitter )
return ((IPowerEmitter) part).canEmitPowerFrom( side );
return false;
@@ -33,7 +33,7 @@ public class LayerIPowerReceptor extends LayerBase implements IPowerReceptor
@Override
public PowerReceiver getPowerReceiver(ForgeDirection side)
{
IPart part = getPart( side );
IPart part = this.getPart( side );
if ( part instanceof IPowerReceptor )
return ((IPowerReceptor) part).getPowerReceiver( side );
return null;
@@ -65,7 +65,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{
IPart bp = getPart( side );
IPart bp = this.getPart( side );
if ( bp instanceof ISidedInventory )
{
ISidedInventory part = (ISidedInventory) bp;
@@ -92,7 +92,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
ForgeDirection currentSide = ForgeDirection.UNKNOWN;
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
if ( getPart( side ) == sides )
if ( this.getPart( side ) == sides )
{
currentSide = side;
break;
@@ -108,9 +108,9 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
if ( sideData == null || slots == null )
invLayer = null;
this.invLayer = null;
else
invLayer = new InvLayerData( sideData, inventories, slots );
this.invLayer = new InvLayerData( sideData, inventories, slots );
// make sure inventory is updated before we call FMP.
super.notifyNeighbors();
@@ -119,71 +119,71 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
@Override
public ItemStack decrStackSize(int slot, int amount)
{
if ( invLayer == null )
if ( this.invLayer == null )
return null;
return invLayer.decreaseStackSize( slot, amount );
return this.invLayer.decreaseStackSize( slot, amount );
}
@Override
public int getSizeInventory()
{
if ( invLayer == null )
if ( this.invLayer == null )
return 0;
return invLayer.getSizeInventory();
return this.invLayer.getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int slot)
{
if ( invLayer == null )
if ( this.invLayer == null )
return null;
return invLayer.getStackInSlot( slot );
return this.invLayer.getStackInSlot( slot );
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
{
if ( invLayer == null )
if ( this.invLayer == null )
return false;
return invLayer.isItemValidForSlot( slot, itemstack );
return this.invLayer.isItemValidForSlot( slot, itemstack );
}
@Override
public void setInventorySlotContents(int slot, ItemStack itemstack)
{
if ( invLayer == null )
if ( this.invLayer == null )
return;
invLayer.setInventorySlotContents( slot, itemstack );
this.invLayer.setInventorySlotContents( slot, itemstack );
}
@Override
public boolean canExtractItem(int slot, ItemStack itemstack, int side)
{
if ( invLayer == null )
if ( this.invLayer == null )
return false;
return invLayer.canExtractItem( slot, itemstack, side );
return this.invLayer.canExtractItem( slot, itemstack, side );
}
@Override
public boolean canInsertItem(int slot, ItemStack itemstack, int side)
{
if ( invLayer == null )
if ( this.invLayer == null )
return false;
return invLayer.canInsertItem( slot, itemstack, side );
return this.invLayer.canInsertItem( slot, itemstack, side );
}
@Override
public void markDirty()
{
if ( invLayer != null )
invLayer.markDirty();
if ( this.invLayer != null )
this.invLayer.markDirty();
super.markForSave();
}
@@ -191,8 +191,8 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side)
{
if ( invLayer != null )
return invLayer.getAccessibleSlotsFromSide( side );
if ( this.invLayer != null )
return this.invLayer.getAccessibleSlotsFromSide( side );
return nullSides;
}
@@ -31,7 +31,7 @@ public class LayerITileStorageMonitorable extends LayerBase implements ITileStor
@Override
public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src)
{
IPart part = getPart( side );
IPart part = this.getPart( side );
if ( part instanceof ITileStorageMonitorable )
return ((ITileStorageMonitorable) part).getMonitorable( side, src );
return null;
@@ -62,10 +62,10 @@ public class PartCableAnchor implements IPart
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
IIcon myIcon = is.getIconIndex();
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
IIcon myIcon = this.is.getIconIndex();
rh.setTexture( myIcon );
if ( host != null && host.getFacadeContainer().getFacade( mySide ) != null )
if ( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null )
rh.setBounds( 7, 7, 10, 9, 9, 14 );
else
rh.setBounds( 7, 7, 10, 9, 9, 16 );
@@ -84,7 +84,7 @@ public class PartCableAnchor implements IPart
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper instance, RenderBlocks renderer)
{
instance.setTexture( is.getIconIndex() );
instance.setTexture( this.is.getIconIndex() );
instance.setBounds( 7, 7, 4, 9, 9, 14 );
instance.renderInventoryBox( renderer );
instance.setTexture( null );
@@ -93,7 +93,7 @@ public class PartCableAnchor implements IPart
@Override
public void getBoxes(IPartCollisionHelper bch)
{
if ( host != null && host.getFacadeContainer().getFacade( mySide ) != null )
if ( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null )
bch.addBox( 7, 7, 10, 9, 9, 14 );
else
bch.addBox( 7, 7, 10, 9, 9, 16 );
@@ -102,7 +102,7 @@ public class PartCableAnchor implements IPart
@Override
public ItemStack getItemStack(PartItemStack wrenched)
{
return is;
return this.is;
}
@Override
@@ -212,7 +212,7 @@ public class PartCableAnchor implements IPart
public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile)
{
this.host = host;
mySide = side;
this.mySide = side;
}
@Override
@@ -236,7 +236,7 @@ public class PartCableAnchor implements IPart
@Override
public boolean isLadder(EntityLivingBase entity)
{
return mySide.offsetY == 0 && ( entity.isCollidedHorizontally || ! entity.onGround );
return this.mySide.offsetY == 0 && ( entity.isCollidedHorizontally || ! entity.onGround );
}
@Override
@@ -73,7 +73,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
ISidedInventory, IAEAppEngInventory, ITileStorageMonitorable, IPriorityHost
{
final DualityInterface duality = new DualityInterface( proxy, this );
final DualityInterface duality = new DualityInterface( this.proxy, this );
public PartInterface(ItemStack is) {
super( PartInterface.class, is );
@@ -83,45 +83,45 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
public void addToWorld()
{
super.addToWorld();
duality.initialize();
this.duality.initialize();
}
@MENetworkEventSubscribe
public void stateChange(MENetworkChannelsChanged c)
{
duality.notifyNeighbors();
this.duality.notifyNeighbors();
}
@MENetworkEventSubscribe
public void stateChange(MENetworkPowerStatusChange c)
{
duality.notifyNeighbors();
this.duality.notifyNeighbors();
}
@Override
public void gridChanged()
{
duality.gridChanged();
this.duality.gridChanged();
}
@Override
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
duality.writeToNBT( data );
this.duality.writeToNBT( data );
}
@Override
public void readFromNBT(NBTTagCompound data)
{
super.readFromNBT( data );
duality.readFromNBT( data );
this.duality.readFromNBT( data );
}
@Override
public void getDrops(List<ItemStack> drops, boolean wrenched)
{
duality.addDrops( drops );
this.duality.addDrops( drops );
}
@Override
@@ -129,7 +129,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 3, 3, 15, 13, 13, 16 );
rh.renderInventoryBox( renderer );
@@ -145,33 +145,33 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 5, 5, 12, 11, 11, 13 );
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorSidesStatus.getIcon() );
rh.setBounds( 5, 5, 13, 11, 11, 14 );
rh.renderBlock( x, y, z, renderer );
renderLights( x, y, z, rh, renderer );
this.renderLights( x, y, z, rh, renderer );
}
@Override
public IIcon getBreakingTexture()
{
return is.getIconIndex();
return this.is.getIconIndex();
}
@Override
@@ -196,127 +196,127 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
@Override
public boolean canInsert(ItemStack stack)
{
return duality.canInsert( stack );
return this.duality.canInsert( stack );
}
@Override
public IMEMonitor<IAEItemStack> getItemInventory()
{
return duality.getItemInventory();
return this.duality.getItemInventory();
}
@Override
public IMEMonitor<IAEFluidStack> getFluidInventory()
{
return duality.getFluidInventory();
return this.duality.getFluidInventory();
}
@Override
public TickingRequest getTickingRequest(IGridNode node)
{
return duality.getTickingRequest( node );
return this.duality.getTickingRequest( node );
}
@Override
public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
{
return duality.tickingRequest( node, TicksSinceLastCall );
return this.duality.tickingRequest( node, TicksSinceLastCall );
}
@Override
public int getSizeInventory()
{
return duality.getStorage().getSizeInventory();
return this.duality.getStorage().getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int i)
{
return duality.getStorage().getStackInSlot( i );
return this.duality.getStorage().getStackInSlot( i );
}
@Override
public ItemStack decrStackSize(int i, int j)
{
return duality.getStorage().decrStackSize( i, j );
return this.duality.getStorage().decrStackSize( i, j );
}
@Override
public ItemStack getStackInSlotOnClosing(int i)
{
return duality.getStorage().getStackInSlotOnClosing( i );
return this.duality.getStorage().getStackInSlotOnClosing( i );
}
@Override
public void setInventorySlotContents(int i, ItemStack itemstack)
{
duality.getStorage().setInventorySlotContents( i, itemstack );
this.duality.getStorage().setInventorySlotContents( i, itemstack );
}
@Override
public String getInventoryName()
{
return duality.getStorage().getInventoryName();
return this.duality.getStorage().getInventoryName();
}
@Override
public boolean hasCustomInventoryName()
{
return duality.getStorage().hasCustomInventoryName();
return this.duality.getStorage().hasCustomInventoryName();
}
@Override
public int getInventoryStackLimit()
{
return duality.getStorage().getInventoryStackLimit();
return this.duality.getStorage().getInventoryStackLimit();
}
@Override
public IConfigManager getConfigManager()
{
return duality.getConfigManager();
return this.duality.getConfigManager();
}
@Override
public IInventory getInventoryByName(String name)
{
return duality.getInventoryByName( name );
return this.duality.getInventoryByName( name );
}
@Override
public void markDirty()
{
duality.getStorage().markDirty();
this.duality.getStorage().markDirty();
}
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer)
{
return duality.getStorage().isUseableByPlayer( entityplayer );
return this.duality.getStorage().isUseableByPlayer( entityplayer );
}
@Override
public void openInventory()
{
duality.getStorage().openInventory();
this.duality.getStorage().openInventory();
}
@Override
public void closeInventory()
{
duality.getStorage().closeInventory();
this.duality.getStorage().closeInventory();
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack)
{
return duality.getStorage().isItemValidForSlot( i, itemstack );
return this.duality.getStorage().isItemValidForSlot( i, itemstack );
}
@Override
public int[] getAccessibleSlotsFromSide(int s)
{
return duality.getAccessibleSlotsFromSide( s );
return this.duality.getAccessibleSlotsFromSide( s );
}
@Override
@@ -334,13 +334,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
duality.onChangeInventory( inv, slot, mc, removedStack, newStack );
this.duality.onChangeInventory( inv, slot, mc, removedStack, newStack );
}
@Override
public DualityInterface getInterfaceDuality()
{
return duality;
return this.duality;
}
@Override
@@ -350,7 +350,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
return false;
if ( Platform.isServer() )
Platform.openGUI( p, getTileEntity(), side, GuiBridge.GUI_INTERFACE );
Platform.openGUI( p, this.getTileEntity(), this.side, GuiBridge.GUI_INTERFACE );
return true;
}
@@ -358,67 +358,67 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
@Override
public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src)
{
return duality.getMonitorable( side, src, this );
return this.duality.getMonitorable( side, src, this );
}
@Override
public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table)
{
return duality.pushPattern( patternDetails, table );
return this.duality.pushPattern( patternDetails, table );
}
@Override
public void provideCrafting(ICraftingProviderHelper craftingTracker)
{
duality.provideCrafting( craftingTracker );
this.duality.provideCrafting( craftingTracker );
}
@Override
public EnumSet<ForgeDirection> getTargets()
{
return EnumSet.of( side );
return EnumSet.of( this.side );
}
@Override
public boolean isBusy()
{
return duality.isBusy();
return this.duality.isBusy();
}
@Override
public int getInstalledUpgrades(Upgrades u)
{
return duality.getInstalledUpgrades( u );
return this.duality.getInstalledUpgrades( u );
}
@Override
public ImmutableSet<ICraftingLink> getRequestedJobs()
{
return duality.getRequestedJobs();
return this.duality.getRequestedJobs();
}
@Override
public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, Actionable mode)
{
return duality.injectCraftedItems( link, items, mode );
return this.duality.injectCraftedItems( link, items, mode );
}
@Override
public void jobStateChange(ICraftingLink link)
{
duality.jobStateChange( link );
this.duality.jobStateChange( link );
}
@Override
public int getPriority()
{
return duality.getPriority();
return this.duality.getPriority();
}
@Override
public void setPriority(int newValue)
{
duality.setPriority( newValue );
this.duality.setPriority( newValue );
}
}
@@ -25,10 +25,10 @@ public class PartInvertedToggleBus extends PartToggleBus
public PartInvertedToggleBus(ItemStack is) {
super( PartInvertedToggleBus.class, is );
proxy.setIdlePowerUsage( 0.0 );
outerProxy.setIdlePowerUsage( 0.0 );
proxy.setFlags();
outerProxy.setFlags();
this.proxy.setIdlePowerUsage( 0.0 );
this.outerProxy.setIdlePowerUsage( 0.0 );
this.proxy.setFlags();
this.outerProxy.setFlags();
}
@Override
@@ -102,10 +102,10 @@ public class PartStorageBus
public PartStorageBus( ItemStack is )
{
super( PartStorageBus.class, is );
getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE );
getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
getConfigManager().registerSetting( Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY );
mySrc = new MachineSource( this );
this.getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE );
this.getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
this.getConfigManager().registerSetting( Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY );
this.mySrc = new MachineSource( this );
}
boolean cached = false;
@@ -119,25 +119,25 @@ public class PartStorageBus
@MENetworkEventSubscribe
public void powerRender( MENetworkPowerStatusChange c )
{
updateStatus();
this.updateStatus();
}
@MENetworkEventSubscribe
public void updateChannels( MENetworkChannelsChanged changedChannels )
{
updateStatus();
this.updateStatus();
}
private void updateStatus()
{
boolean currentActive = proxy.isActive();
if ( wasActive != currentActive )
boolean currentActive = this.proxy.isActive();
if ( this.wasActive != currentActive )
{
wasActive = currentActive;
this.wasActive = currentActive;
try
{
proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
host.markForUpdate();
this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
this.host.markForUpdate();
}
catch ( GridAccessException e )
{
@@ -154,7 +154,7 @@ public class PartStorageBus
if ( Platform.isClient() )
return true;
Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_STORAGEBUS );
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_STORAGEBUS );
return true;
}
@@ -170,14 +170,14 @@ public class PartStorageBus
@Override
public boolean isValid( Object verificationToken )
{
return handler == verificationToken;
return this.handler == verificationToken;
}
@Override
public IInventory getInventoryByName( String name )
{
if ( name.equals( "config" ) )
return Config;
return this.Config;
return super.getInventoryByName( name );
}
@@ -186,17 +186,17 @@ public class PartStorageBus
private void resetCache( boolean fullReset )
{
if ( host == null || host.getTile() == null || host.getTile().getWorldObj() == null || host.getTile().getWorldObj().isRemote )
if ( this.host == null || this.host.getTile() == null || this.host.getTile().getWorldObj() == null || this.host.getTile().getWorldObj().isRemote )
return;
if ( fullReset )
resetCacheLogic = 2;
this.resetCacheLogic = 2;
else
resetCacheLogic = 1;
this.resetCacheLogic = 1;
try
{
proxy.getTick().alertDevice( proxy.getNode() );
this.proxy.getTick().alertDevice( this.proxy.getNode() );
}
catch ( GridAccessException e )
{
@@ -206,34 +206,34 @@ public class PartStorageBus
private void resetCache()
{
boolean fullReset = resetCacheLogic == 2;
resetCacheLogic = 0;
boolean fullReset = this.resetCacheLogic == 2;
this.resetCacheLogic = 0;
IMEInventory<IAEItemStack> in = getInternalHandler();
IMEInventory<IAEItemStack> in = this.getInternalHandler();
IItemList<IAEItemStack> before = AEApi.instance().storage().createItemList();
if ( in != null )
before = in.getAvailableItems( before );
cached = false;
this.cached = false;
if ( fullReset )
handlerHash = 0;
this.handlerHash = 0;
IMEInventory<IAEItemStack> out = getInternalHandler();
IMEInventory<IAEItemStack> out = this.getInternalHandler();
if ( monitor != null )
monitor.onTick();
if ( this.monitor != null )
this.monitor.onTick();
IItemList<IAEItemStack> after = AEApi.instance().storage().createItemList();
if ( out != null )
after = out.getAvailableItems( after );
Platform.postListChanges( before, after, this, mySrc );
Platform.postListChanges( before, after, this, this.mySrc );
}
@Override
public void onNeighborChanged()
{
resetCache( false );
this.resetCache( false );
}
@Override
@@ -241,119 +241,119 @@ public class PartStorageBus
{
super.onChangeInventory( inv, slot, mc, removedStack, newStack );
if ( inv == Config )
resetCache( true );
if ( inv == this.Config )
this.resetCache( true );
}
@Override
public void upgradesChanged()
{
super.upgradesChanged();
resetCache( true );
this.resetCache( true );
}
@Override
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
{
resetCache( true );
host.markForSave();
this.resetCache( true );
this.host.markForSave();
}
@Override
public void setPriority( int newValue )
{
priority = newValue;
host.markForSave();
resetCache( true );
this.priority = newValue;
this.host.markForSave();
this.resetCache( true );
}
public MEInventoryHandler getInternalHandler()
{
if ( cached )
return handler;
if ( this.cached )
return this.handler;
boolean wasSleeping = monitor == null;
boolean wasSleeping = this.monitor == null;
cached = true;
TileEntity self = getHost().getTile();
TileEntity target = self.getWorldObj().getTileEntity( self.xCoord + side.offsetX, self.yCoord + side.offsetY, self.zCoord + side.offsetZ );
this.cached = true;
TileEntity self = this.getHost().getTile();
TileEntity target = self.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ );
int newHandlerHash = Platform.generateTileHash( target );
if ( handlerHash == newHandlerHash && handlerHash != 0 )
return handler;
if ( this.handlerHash == newHandlerHash && this.handlerHash != 0 )
return this.handler;
try
{
// force grid to update handlers...
proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
}
catch ( GridAccessException e )
{
// :3
}
handlerHash = newHandlerHash;
handler = null;
monitor = null;
this.handlerHash = newHandlerHash;
this.handler = null;
this.monitor = null;
if ( target != null )
{
IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, side.getOpposite(), StorageChannel.ITEMS, mySrc );
IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc );
if ( esh != null )
{
IMEInventory inv = esh.getInventory( target, side.getOpposite(), StorageChannel.ITEMS, mySrc );
IMEInventory inv = esh.getInventory( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc );
if ( inv instanceof MEMonitorIInventory )
{
MEMonitorIInventory h = ( MEMonitorIInventory ) inv;
h.mode = ( StorageFilter ) getConfigManager().getSetting( Settings.STORAGE_FILTER );
h.mode = ( StorageFilter ) this.getConfigManager().getSetting( Settings.STORAGE_FILTER );
h.mySource = new MachineSource( this );
}
if ( inv instanceof MEMonitorIInventory )
monitor = ( MEMonitorIInventory ) inv;
this.monitor = ( MEMonitorIInventory ) inv;
if ( inv != null )
{
checkInterfaceVsStorageBus( target, side.getOpposite() );
this.checkInterfaceVsStorageBus( target, this.side.getOpposite() );
handler = new MEInventoryHandler( inv, StorageChannel.ITEMS );
this.handler = new MEInventoryHandler( inv, StorageChannel.ITEMS );
handler.myAccess = ( AccessRestriction ) this.getConfigManager().getSetting( Settings.ACCESS );
handler.myWhitelist = getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST;
handler.myPriority = priority;
this.handler.myAccess = ( AccessRestriction ) this.getConfigManager().getSetting( Settings.ACCESS );
this.handler.myWhitelist = this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST;
this.handler.myPriority = this.priority;
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
int slotsToUse = 18 + getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
for ( int x = 0; x < Config.getSizeInventory() && x < slotsToUse; x++ )
int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
for ( int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++ )
{
IAEItemStack is = Config.getAEStackInSlot( x );
IAEItemStack is = this.Config.getAEStackInSlot( x );
if ( is != null )
priorityList.add( is );
}
if ( getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
handler.myPartitionList = new FuzzyPriorityList( priorityList, ( FuzzyMode ) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) );
if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
this.handler.myPartitionList = new FuzzyPriorityList( priorityList, ( FuzzyMode ) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) );
else
handler.myPartitionList = new PrecisePriorityList( priorityList );
this.handler.myPartitionList = new PrecisePriorityList( priorityList );
if ( inv instanceof IMEMonitor )
( ( IMEMonitor ) inv ).addListener( this, handler );
( ( IMEMonitor ) inv ).addListener( this, this.handler );
}
}
}
// update sleep state...
if ( wasSleeping != ( monitor == null ) )
if ( wasSleeping != ( this.monitor == null ) )
{
try
{
ITickManager tm = proxy.getTick();
if ( monitor == null )
tm.sleepDevice( proxy.getNode() );
ITickManager tm = this.proxy.getTick();
if ( this.monitor == null )
tm.sleepDevice( this.proxy.getNode() );
else
tm.wakeDevice( proxy.getNode() );
tm.wakeDevice( this.proxy.getNode() );
}
catch ( GridAccessException e )
{
@@ -361,7 +361,7 @@ public class PartStorageBus
}
}
return handler;
return this.handler;
}
private void checkInterfaceVsStorageBus( TileEntity target, ForgeDirection side )
@@ -390,7 +390,7 @@ public class PartStorageBus
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer )
{
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
rh.setBounds( 3, 3, 15, 13, 13, 16 );
rh.renderInventoryBox( renderer );
@@ -406,8 +406,8 @@ public class PartStorageBus
@SideOnly( Side.CLIENT )
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
rh.setBounds( 3, 3, 15, 13, 13, 16 );
rh.renderBlock( x, y, z, renderer );
@@ -416,19 +416,19 @@ public class PartStorageBus
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
rh.setBounds( 5, 5, 12, 11, 11, 13 );
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorSidesStatus.getIcon() );
rh.setBounds( 5, 5, 13, 11, 11, 14 );
rh.renderBlock( x, y, z, renderer );
renderLights( x, y, z, rh, renderer );
this.renderLights( x, y, z, rh, renderer );
}
@Override
@@ -448,17 +448,17 @@ public class PartStorageBus
@Override
public TickingRequest getTickingRequest( IGridNode node )
{
return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, monitor == null, true );
return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, this.monitor == null, true );
}
@Override
public TickRateModulation tickingRequest( IGridNode node, int TicksSinceLastCall )
{
if ( resetCacheLogic != 0 )
resetCache();
if ( this.resetCacheLogic != 0 )
this.resetCache();
if ( monitor != null )
return monitor.onTick();
if ( this.monitor != null )
return this.monitor.onTick();
return TickRateModulation.SLEEP;
}
@@ -467,16 +467,16 @@ public class PartStorageBus
public void writeToNBT( NBTTagCompound data )
{
super.writeToNBT( data );
Config.writeToNBT( data, "config" );
data.setInteger( "priority", priority );
this.Config.writeToNBT( data, "config" );
data.setInteger( "priority", this.priority );
}
@Override
public void readFromNBT( NBTTagCompound data )
{
super.readFromNBT( data );
Config.readFromNBT( data, "config" );
priority = data.getInteger( "priority" );
this.Config.readFromNBT( data, "config" );
this.priority = data.getInteger( "priority" );
}
@Override
@@ -484,7 +484,7 @@ public class PartStorageBus
{
if ( channel == StorageChannel.ITEMS )
{
IMEInventoryHandler out = proxy.isActive() ? getInternalHandler() : null;
IMEInventoryHandler out = this.proxy.isActive() ? this.getInternalHandler() : null;
if ( out != null )
return Collections.singletonList( out );
}
@@ -494,7 +494,7 @@ public class PartStorageBus
@Override
public int getPriority()
{
return priority;
return this.priority;
}
@Override
@@ -506,8 +506,8 @@ public class PartStorageBus
{
try
{
if ( proxy.isActive() )
proxy.getStorage().postAlterationOfStoredItems( StorageChannel.ITEMS, change, mySrc );
if ( this.proxy.isActive() )
this.proxy.getStorage().postAlterationOfStoredItems( StorageChannel.ITEMS, change, this.mySrc );
}
catch ( GridAccessException e )
{
@@ -519,7 +519,7 @@ public class PartStorageBus
@Method( iname = "BC" )
public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
{
return type == PipeType.ITEM && with == side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT;
return type == PipeType.ITEM && with == this.side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT;
}
@Override
@@ -61,34 +61,34 @@ public class PartToggleBus extends PartBasicState
public void onPlacement(EntityPlayer player, ItemStack held, ForgeDirection side)
{
super.onPlacement( player, held, side );
outerProxy.setOwner( player );
this.outerProxy.setOwner( player );
}
@Override
protected int populateFlags(int cf)
{
return cf | (getIntention() ? REDSTONE_FLAG : 0);
return cf | (this.getIntention() ? this.REDSTONE_FLAG : 0);
}
@Override
public void onNeighborChanged()
{
boolean oldHasRedstone = hasRedstone;
hasRedstone = getHost().hasRedstone( side );
boolean oldHasRedstone = this.hasRedstone;
this.hasRedstone = this.getHost().hasRedstone( this.side );
if ( hasRedstone != oldHasRedstone )
if ( this.hasRedstone != oldHasRedstone )
{
updateInternalState();
getHost().markForUpdate();
this.updateInternalState();
this.getHost().markForUpdate();
}
}
public PartToggleBus(ItemStack is) {
this( PartToggleBus.class, is );
proxy.setIdlePowerUsage( 0.0 );
outerProxy.setIdlePowerUsage( 0.0 );
proxy.setFlags();
outerProxy.setFlags();
this.proxy.setIdlePowerUsage( 0.0 );
this.outerProxy.setIdlePowerUsage( 0.0 );
this.proxy.setFlags();
this.outerProxy.setFlags();
}
public PartToggleBus(Class cls, ItemStack is) {
@@ -99,44 +99,44 @@ public class PartToggleBus extends PartBasicState
public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile)
{
super.setPartHostInfo( side, host, tile );
outerProxy.setValidSides( EnumSet.of( side ) );
this.outerProxy.setValidSides( EnumSet.of( side ) );
}
@Override
public void readFromNBT(NBTTagCompound extra)
{
super.readFromNBT( extra );
outerProxy.readFromNBT( extra );
this.outerProxy.readFromNBT( extra );
}
@Override
public void writeToNBT(NBTTagCompound extra)
{
super.writeToNBT( extra );
outerProxy.writeToNBT( extra );
this.outerProxy.writeToNBT( extra );
}
@Override
public void addToWorld()
{
super.addToWorld();
outerProxy.onReady();
hasRedstone = getHost().hasRedstone( side );
updateInternalState();
this.outerProxy.onReady();
this.hasRedstone = this.getHost().hasRedstone( this.side );
this.updateInternalState();
}
private void updateInternalState()
{
boolean intention = getIntention();
if ( intention == ( connection == null ) )
boolean intention = this.getIntention();
if ( intention == ( this.connection == null ) )
{
if ( proxy.getNode() != null && outerProxy.getNode() != null )
if ( this.proxy.getNode() != null && this.outerProxy.getNode() != null )
{
if ( intention )
{
try
{
connection = AEApi.instance().createGridConnection( proxy.getNode(), outerProxy.getNode() );
this.connection = AEApi.instance().createGridConnection( this.proxy.getNode(), this.outerProxy.getNode() );
}
catch (FailedConnection e)
{
@@ -145,8 +145,8 @@ public class PartToggleBus extends PartBasicState
}
else
{
connection.destroy();
connection = null;
this.connection.destroy();
this.connection = null;
}
}
}
@@ -154,20 +154,20 @@ public class PartToggleBus extends PartBasicState
protected boolean getIntention()
{
return getHost().hasRedstone( side );
return this.getHost().hasRedstone( this.side );
}
@Override
public void removeFromWorld()
{
super.removeFromWorld();
outerProxy.invalidate();
this.outerProxy.invalidate();
}
@Override
public IGridNode getExternalFacingNode()
{
return outerProxy.getNode();
return this.outerProxy.getNode();
}
@Override
@@ -179,16 +179,16 @@ public class PartToggleBus extends PartBasicState
@Override
public void setColors(boolean hasChan, boolean hasPower)
{
hasRedstone = (clientFlags & REDSTONE_FLAG) == REDSTONE_FLAG;
super.setColors( hasChan && hasRedstone, hasPower && hasRedstone );
this.hasRedstone = (this.clientFlags & this.REDSTONE_FLAG) == this.REDSTONE_FLAG;
super.setColors( hasChan && this.hasRedstone, hasPower && this.hasRedstone );
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
rh.setTexture( is.getIconIndex() );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( this.is.getIconIndex() );
rh.setBounds( 6, 6, 14, 10, 10, 16 );
rh.renderBlock( x, y, z, renderer );
@@ -197,19 +197,19 @@ public class PartToggleBus extends PartBasicState
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorSidesStatus.getIcon() );
rh.setBounds( 6, 6, 13, 10, 10, 14 );
rh.renderBlock( x, y, z, renderer );
renderLights( x, y, z, rh, renderer );
this.renderLights( x, y, z, rh, renderer );
}
@Override
public IIcon getBreakingTexture()
{
return is.getIconIndex();
return this.is.getIconIndex();
}
@Override
@@ -224,7 +224,7 @@ public class PartToggleBus extends PartBasicState
{
GL11.glTranslated( -0.2, -0.3, 0.0 );
rh.setTexture( is.getIconIndex() );
rh.setTexture( this.is.getIconIndex() );
rh.setBounds( 6, 6, 14 - 4, 10, 10, 16 - 4 );
rh.renderInventoryBox( renderer );
@@ -252,13 +252,13 @@ public class PartToggleBus extends PartBasicState
@Override
public void securityBreak()
{
if ( is.stackSize > 0 )
if ( this.is.stackSize > 0 )
{
List<ItemStack> items = new ArrayList<ItemStack>();
items.add( is.copy() );
host.removePart( side, false );
Platform.spawnDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, items );
is.stackSize = 0;
items.add( this.is.copy() );
this.host.removePart( this.side, false );
Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items );
this.is.stackSize = 0;
}
}
}
@@ -71,15 +71,15 @@ public class PartCable extends AEBasePart implements IPartCable
public PartCable(Class c, ItemStack is) {
super( c, is );
proxy.setFlags( GridFlags.PREFERRED );
proxy.setIdlePowerUsage( 0.0 );
proxy.myColor = AEColor.values()[((ItemMultiPart) is.getItem()).variantOf( is.getItemDamage() )];
this.proxy.setFlags( GridFlags.PREFERRED );
this.proxy.setIdlePowerUsage( 0.0 );
this.proxy.myColor = AEColor.values()[((ItemMultiPart) is.getItem()).variantOf( is.getItemDamage() )];
}
@Override
public boolean isConnected(ForgeDirection side)
{
return connections.contains( side );
return this.connections.contains( side );
}
@Override
@@ -132,7 +132,7 @@ public class PartCable extends AEBasePart implements IPartCable
public IIcon getTexture(AEColor c)
{
return getGlassTexture( c );
return this.getGlassTexture( c );
}
public IIcon getCoveredTexture(AEColor c)
@@ -222,7 +222,7 @@ public class PartCable extends AEBasePart implements IPartCable
@Override
public AEColor getCableColor()
{
return proxy.myColor;
return this.proxy.myColor;
}
@Override
@@ -234,12 +234,12 @@ public class PartCable extends AEBasePart implements IPartCable
@Override
public AENetworkProxy getProxy()
{
return proxy;
return this.proxy;
}
public void markForUpdate()
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
@Override
@@ -249,7 +249,7 @@ public class PartCable extends AEBasePart implements IPartCable
if ( Platform.isServer() )
{
IGridNode node = getGridNode();
IGridNode node = this.getGridNode();
int howMany = 0;
if ( node != null )
@@ -269,12 +269,12 @@ public class PartCable extends AEBasePart implements IPartCable
int cs = 0;
int sideOut = 0;
IGridNode n = getGridNode();
IGridNode n = this.getGridNode();
if ( n != null )
{
for (ForgeDirection thisSide : ForgeDirection.VALID_DIRECTIONS)
{
IPart part = getHost().getPart( thisSide );
IPart part = this.getHost().getPart( thisSide );
if ( part != null )
{
if ( part.getGridNode() != null )
@@ -282,7 +282,7 @@ public class PartCable extends AEBasePart implements IPartCable
IReadOnlyCollection<IGridConnection> set = part.getGridNode().getConnections();
for (IGridConnection gc : set)
{
if ( proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) )
if ( this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) )
sideOut |= (gc.getUsedChannels() / 4) << (4 * thisSide.ordinal());
else
sideOut |= (gc.getUsedChannels()) << (4 * thisSide.ordinal());
@@ -296,8 +296,8 @@ public class PartCable extends AEBasePart implements IPartCable
ForgeDirection side = gc.getDirection( n );
if ( side != ForgeDirection.UNKNOWN )
{
boolean isTier2a = proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY );
boolean isTier2b = gc.getOtherSide( proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );
boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY );
boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );
if ( isTier2a && isTier2b )
sideOut |= (gc.getUsedChannels() / 4) << (4 * side.ordinal());
@@ -310,7 +310,7 @@ public class PartCable extends AEBasePart implements IPartCable
try
{
if ( proxy.getEnergy().isNetworkPowered() )
if ( this.proxy.getEnergy().isNetworkPowered() )
cs |= (1 << ForgeDirection.UNKNOWN.ordinal());
}
catch (GridAccessException e)
@@ -328,9 +328,9 @@ public class PartCable extends AEBasePart implements IPartCable
int cs = data.readByte();
int sideOut = data.readInt();
EnumSet<ForgeDirection> myC = connections.clone();
boolean wasPowered = powered;
powered = false;
EnumSet<ForgeDirection> myC = this.connections.clone();
boolean wasPowered = this.powered;
this.powered = false;
boolean channelsChanged = false;
for (ForgeDirection d : ForgeDirection.values())
@@ -338,10 +338,10 @@ public class PartCable extends AEBasePart implements IPartCable
if ( d != ForgeDirection.UNKNOWN )
{
int ch = (sideOut >> (d.ordinal() * 4)) & 0xF;
if ( ch != channelsOnSide[d.ordinal()] )
if ( ch != this.channelsOnSide[d.ordinal()] )
{
channelsChanged = true;
channelsOnSide[d.ordinal()] = ch;
this.channelsOnSide[d.ordinal()] = ch;
}
}
@@ -349,19 +349,19 @@ public class PartCable extends AEBasePart implements IPartCable
{
int id = 1 << d.ordinal();
if ( id == (cs & id) )
powered = true;
this.powered = true;
}
else
{
int id = 1 << d.ordinal();
if ( id == (cs & id) )
connections.add( d );
this.connections.add( d );
else
connections.remove( d );
this.connections.remove( d );
}
}
return !myC.equals( connections ) || wasPowered != powered || channelsChanged;
return !myC.equals( this.connections ) || wasPowered != this.powered || channelsChanged;
}
@Override
@@ -371,14 +371,14 @@ public class PartCable extends AEBasePart implements IPartCable
if ( Platform.isServer() )
{
IGridNode n = getGridNode();
IGridNode n = this.getGridNode();
if ( n != null )
connections = n.getConnectedSides();
this.connections = n.getConnectedSides();
else
connections.clear();
this.connections.clear();
}
IPartHost ph = getHost();
IPartHost ph = this.getHost();
if ( ph != null )
{
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
@@ -417,7 +417,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
}
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
switch (of)
{
@@ -450,7 +450,7 @@ public class PartCable extends AEBasePart implements IPartCable
{
GL11.glTranslated( -0.0, -0.0, 0.3 );
rh.setTexture( getTexture( getCableColor() ) );
rh.setTexture( this.getTexture( this.getCableColor() ) );
rh.setBounds( 6.0f, 6.0f, 2.0f, 10.0f, 10.0f, 14.0f );
rh.renderInventoryBox( renderer );
rh.setTexture( null );
@@ -460,7 +460,7 @@ public class PartCable extends AEBasePart implements IPartCable
@SideOnly(Side.CLIENT)
public IIcon getBreakingTexture()
{
return getTexture( getCableColor() );
return this.getTexture( this.getCableColor() );
}
@SideOnly(Side.CLIENT)
@@ -474,10 +474,10 @@ public class PartCable extends AEBasePart implements IPartCable
if ( gh != null && partHost != null && gh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getColor() != AEColor.Transparent
&& partHost.getPart( of.getOpposite() ) == null )
rh.setTexture( getTexture( partHost.getColor() ) );
rh.setTexture( this.getTexture( partHost.getColor() ) );
else if ( partHost == null && gh != null && gh.getCableConnectionType( of ) != AECableType.GLASS )
{
rh.setTexture( getCoveredTexture( getCableColor() ) );
rh.setTexture( this.getCoveredTexture( this.getCableColor() ) );
switch (of)
{
case DOWN:
@@ -503,10 +503,10 @@ public class PartCable extends AEBasePart implements IPartCable
}
rh.renderBlock( x, y, z, renderer );
rh.setTexture( getTexture( getCableColor() ) );
rh.setTexture( this.getTexture( this.getCableColor() ) );
}
else
rh.setTexture( getTexture( getCableColor() ) );
rh.setTexture( this.getTexture( this.getCableColor() ) );
switch (of)
{
@@ -538,7 +538,7 @@ public class PartCable extends AEBasePart implements IPartCable
protected CableBusTextures getChannelTex(int i, boolean b)
{
if ( !powered )
if ( !this.powered )
i = 0;
if ( b )
@@ -586,10 +586,10 @@ public class PartCable extends AEBasePart implements IPartCable
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) );
if ( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null
&& partHost.getColor() != AEColor.Transparent )
rh.setTexture( getGlassTexture( partHost.getColor() ) );
rh.setTexture( this.getGlassTexture( partHost.getColor() ) );
else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS )
{
rh.setTexture( getCoveredTexture( getCableColor() ) );
rh.setTexture( this.getCoveredTexture( this.getCableColor() ) );
switch (of)
{
case DOWN:
@@ -616,18 +616,18 @@ public class PartCable extends AEBasePart implements IPartCable
rh.renderBlock( x, y, z, renderer );
rh.setTexture( getTexture( getCableColor() ) );
rh.setTexture( this.getTexture( this.getCableColor() ) );
}
else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.COVERED && partHost.getColor() != AEColor.Transparent
&& partHost.getPart( of.getOpposite() ) == null )
rh.setTexture( getCoveredTexture( partHost.getColor() ) );
rh.setTexture( this.getCoveredTexture( partHost.getColor() ) );
else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.SMART && partHost.getPart( of.getOpposite() ) == null )
{
isSmart = true;
rh.setTexture( getSmartTexture( getCableColor() ) );
rh.setTexture( this.getSmartTexture( this.getCableColor() ) );
}
else
rh.setTexture( getCoveredTexture( getCableColor() ) );
rh.setTexture( this.getCoveredTexture( this.getCableColor() ) );
switch (of)
{
@@ -658,9 +658,9 @@ public class PartCable extends AEBasePart implements IPartCable
if ( isSmart )
{
setSmartConnectionRotations( of, renderer );
IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
this.setSmartConnectionRotations( of, renderer );
IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST )
{
@@ -670,13 +670,13 @@ public class PartCable extends AEBasePart implements IPartCable
}
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
}
@@ -691,7 +691,7 @@ public class PartCable extends AEBasePart implements IPartCable
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
boolean isGlass = false;
AEColor myColor = getCableColor();
AEColor myColor = this.getCableColor();
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) );
@@ -699,11 +699,11 @@ public class PartCable extends AEBasePart implements IPartCable
&& partHost.getColor() != AEColor.Transparent )
{
isGlass = true;
rh.setTexture( getGlassTexture( myColor = partHost.getColor() ) );
rh.setTexture( this.getGlassTexture( myColor = partHost.getColor() ) );
}
else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of.getOpposite() ) != AECableType.GLASS )
{
rh.setTexture( getSmartTexture( myColor ) );
rh.setTexture( this.getSmartTexture( myColor ) );
switch (of)
{
case DOWN:
@@ -729,9 +729,9 @@ public class PartCable extends AEBasePart implements IPartCable
}
rh.renderBlock( x, y, z, renderer );
setSmartConnectionRotations( of, renderer );
IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
this.setSmartConnectionRotations( of, renderer );
IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST )
{
@@ -743,22 +743,22 @@ public class PartCable extends AEBasePart implements IPartCable
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_I( myColor.blackVariant );
rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( myColor.whiteVariant );
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
rh.setTexture( getTexture( getCableColor() ) );
rh.setTexture( this.getTexture( this.getCableColor() ) );
}
else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent
&& partHost.getPart( of.getOpposite() ) == null )
rh.setTexture( getSmartTexture( myColor = partHost.getColor() ) );
rh.setTexture( this.getSmartTexture( myColor = partHost.getColor() ) );
else
rh.setTexture( getSmartTexture( getCableColor() ) );
rh.setTexture( this.getSmartTexture( this.getCableColor() ) );
switch (of)
{
@@ -789,19 +789,19 @@ public class PartCable extends AEBasePart implements IPartCable
if ( !isGlass )
{
setSmartConnectionRotations( of, renderer );
this.setSmartConnectionRotations( of, renderer );
IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_I( myColor.blackVariant );
rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( myColor.whiteVariant );
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
}
@@ -861,13 +861,13 @@ public class PartCable extends AEBasePart implements IPartCable
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
boolean useCovered = false;
boolean requireDetailed = false;
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
IPart p = getHost().getPart( dir );
IPart p = this.getHost().getPart( dir );
if ( p != null && p instanceof IGridHost )
{
IGridHost igh = (IGridHost) p;
@@ -878,7 +878,7 @@ public class PartCable extends AEBasePart implements IPartCable
break;
}
}
else if ( connections.contains( dir ) )
else if ( this.connections.contains( dir ) )
{
TileEntity te = this.tile.getWorldObj().getTileEntity( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ );
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
@@ -890,15 +890,15 @@ public class PartCable extends AEBasePart implements IPartCable
if ( useCovered )
{
rh.setTexture( getCoveredTexture( getCableColor() ) );
rh.setTexture( this.getCoveredTexture( this.getCableColor() ) );
}
else
{
rh.setTexture( getTexture( getCableColor() ) );
rh.setTexture( this.getTexture( this.getCableColor() ) );
}
IPartHost ph = getHost();
for (ForgeDirection of : EnumSet.complementOf( connections ))
IPartHost ph = this.getHost();
for (ForgeDirection of : EnumSet.complementOf( this.connections ))
{
IPart bp = ph.getPart( of );
if ( bp instanceof IGridHost )
@@ -934,7 +934,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
}
if ( connections.size() != 2 || !nonLinear( connections ) || useCovered || requireDetailed )
if ( this.connections.size() != 2 || !this.nonLinear( this.connections ) || useCovered || requireDetailed )
{
if ( useCovered )
{
@@ -947,17 +947,17 @@ public class PartCable extends AEBasePart implements IPartCable
rh.renderBlock( x, y, z, renderer );
}
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
renderGlassConnection( x, y, z, rh, renderer, of );
this.renderGlassConnection( x, y, z, rh, renderer, of );
}
}
else
{
IIcon def = getTexture( getCableColor() );
IIcon def = this.getTexture( this.getCableColor() );
rh.setTexture( def );
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of, of.getOpposite() ) ) );
switch (of)
@@ -991,24 +991,24 @@ public class PartCable extends AEBasePart implements IPartCable
@Override
public boolean changeColor(AEColor newColor, EntityPlayer who)
{
if ( getCableColor() != newColor )
if ( this.getCableColor() != newColor )
{
ItemStack newPart = null;
if ( getCableConnectionType() == AECableType.GLASS )
if ( this.getCableConnectionType() == AECableType.GLASS )
newPart = AEApi.instance().parts().partCableGlass.stack( newColor, 1 );
else if ( getCableConnectionType() == AECableType.COVERED )
else if ( this.getCableConnectionType() == AECableType.COVERED )
newPart = AEApi.instance().parts().partCableCovered.stack( newColor, 1 );
else if ( getCableConnectionType() == AECableType.SMART )
else if ( this.getCableConnectionType() == AECableType.SMART )
newPart = AEApi.instance().parts().partCableSmart.stack( newColor, 1 );
else if ( getCableConnectionType() == AECableType.DENSE )
else if ( this.getCableConnectionType() == AECableType.DENSE )
newPart = AEApi.instance().parts().partCableDense.stack( newColor, 1 );
boolean hasPermission = true;
try
{
hasPermission = proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD );
hasPermission = this.proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD );
}
catch (GridAccessException e)
{
@@ -1020,8 +1020,8 @@ public class PartCable extends AEBasePart implements IPartCable
if ( Platform.isClient() )
return true;
getHost().removePart( ForgeDirection.UNKNOWN, true );
getHost().addPart( newPart, ForgeDirection.UNKNOWN, who );
this.getHost().removePart( ForgeDirection.UNKNOWN, true );
this.getHost().addPart( newPart, ForgeDirection.UNKNOWN, who );
return true;
}
}
@@ -1031,7 +1031,7 @@ public class PartCable extends AEBasePart implements IPartCable
@Override
public void setValidSides(EnumSet<ForgeDirection> sides)
{
proxy.setValidSides( sides );
this.proxy.setValidSides( sides );
}
protected boolean nonLinear(EnumSet<ForgeDirection> sides)
@@ -49,13 +49,13 @@ public class PartCableCovered extends PartCable
@MENetworkEventSubscribe
public void channelUpdated(MENetworkChannelsChanged c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
@MENetworkEventSubscribe
public void powerRender(MENetworkPowerStatusChange c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
public PartCableCovered(Class c, ItemStack is) {
@@ -69,7 +69,7 @@ public class PartCableCovered extends PartCable
@Override
public IIcon getTexture(AEColor c)
{
return getCoveredTexture( c );
return this.getCoveredTexture( c );
}
@Override
@@ -85,14 +85,14 @@ public class PartCableCovered extends PartCable
if ( Platform.isServer() )
{
IGridNode n = getGridNode();
IGridNode n = this.getGridNode();
if ( n != null )
connections = n.getConnectedSides();
this.connections = n.getConnectedSides();
else
connections.clear();
this.connections.clear();
}
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
switch (of)
{
@@ -129,7 +129,7 @@ public class PartCableCovered extends PartCable
float offU = 0;
float offV = 9;
OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offU, offV );
OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ))
{
@@ -138,14 +138,14 @@ public class PartCableCovered extends PartCable
offU = 9;
offV = 0;
main = new OffsetIcon( getTexture( getCableColor() ), offU, offV );
main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ))
{
rh.renderInventoryFace( main, side, renderer );
}
main = new OffsetIcon( getTexture( getCableColor() ), 0, 0 );
main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 );
for (ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ))
{
@@ -159,14 +159,14 @@ public class PartCableCovered extends PartCable
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
rh.setTexture( getTexture( getCableColor() ) );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( this.getTexture( this.getCableColor() ) );
EnumSet<ForgeDirection> sides = connections.clone();
EnumSet<ForgeDirection> sides = this.connections.clone();
boolean hasBuses = false;
IPartHost ph = getHost();
for (ForgeDirection of : EnumSet.complementOf( connections ))
IPartHost ph = this.getHost();
for (ForgeDirection of : EnumSet.complementOf( this.connections ))
{
IPart bp = ph.getPart( of );
if ( bp instanceof IGridHost )
@@ -208,22 +208,22 @@ public class PartCableCovered extends PartCable
}
}
if ( sides.size() != 2 || !nonLinear( sides ) || hasBuses )
if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
{
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
renderCoveredConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of );
this.renderCoveredConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
}
rh.setTexture( getTexture( getCableColor() ) );
rh.setTexture( this.getTexture( this.getCableColor() ) );
rh.setBounds( 5, 5, 5, 11, 11, 11 );
rh.renderBlock( x, y, z, renderer );
}
else
{
IIcon def = getTexture( getCableColor() );
IIcon def = this.getTexture( this.getCableColor() );
IIcon off = new OffsetIcon( def, 0, -12 );
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
switch (of)
{
@@ -53,13 +53,13 @@ public class PartCableSmart extends PartCable
@MENetworkEventSubscribe
public void channelUpdated(MENetworkChannelsChanged c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
@MENetworkEventSubscribe
public void powerRender(MENetworkPowerStatusChange c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
public PartCableSmart(Class c, ItemStack is) {
@@ -79,7 +79,7 @@ public class PartCableSmart extends PartCable
@Override
public IIcon getTexture(AEColor c)
{
return getSmartTexture( c );
return this.getSmartTexture( c );
}
@Override
@@ -91,9 +91,9 @@ public class PartCableSmart extends PartCable
float offU = 0;
float offV = 9;
OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offU, offV );
OffsetIcon ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV );
OffsetIcon ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV );
OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ))
{
@@ -105,9 +105,9 @@ public class PartCableSmart extends PartCable
offU = 9;
offV = 0;
main = new OffsetIcon( getTexture( getCableColor() ), offU, offV );
ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV );
ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV );
main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ))
{
@@ -117,9 +117,9 @@ public class PartCableSmart extends PartCable
rh.renderInventoryFace( ch2, side, renderer );
}
main = new OffsetIcon( getTexture( getCableColor() ), 0, 0 );
ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), 0, 0 );
ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), 0, 0 );
main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 );
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 );
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 );
for (ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ))
{
@@ -139,14 +139,14 @@ public class PartCableSmart extends PartCable
if ( Platform.isServer() )
{
IGridNode n = getGridNode();
IGridNode n = this.getGridNode();
if ( n != null )
connections = n.getConnectedSides();
this.connections = n.getConnectedSides();
else
connections.clear();
this.connections.clear();
}
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
switch (of)
{
@@ -177,14 +177,14 @@ public class PartCableSmart extends PartCable
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
rh.setTexture( getTexture( getCableColor() ) );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( this.getTexture( this.getCableColor() ) );
EnumSet<ForgeDirection> sides = connections.clone();
EnumSet<ForgeDirection> sides = this.connections.clone();
boolean hasBuses = false;
IPartHost ph = getHost();
for (ForgeDirection of : EnumSet.complementOf( connections ))
IPartHost ph = this.getHost();
for (ForgeDirection of : EnumSet.complementOf( this.connections ))
{
IPart bp = ph.getPart( of );
if ( bp instanceof IGridHost )
@@ -223,9 +223,9 @@ public class PartCableSmart extends PartCable
}
rh.renderBlock( x, y, z, renderer );
setSmartConnectionRotations( of, renderer );
IIcon firstIcon = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f );
this.setSmartConnectionRotations( of, renderer );
IIcon firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f );
if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST )
{
@@ -235,29 +235,29 @@ public class PartCableSmart extends PartCable
}
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
rh.setTexture( getTexture( getCableColor() ) );
rh.setTexture( this.getTexture( this.getCableColor() ) );
}
}
}
if ( sides.size() != 2 || !nonLinear( sides ) || hasBuses )
if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
{
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
renderSmartConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of );
this.renderSmartConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
}
rh.setTexture( getCoveredTexture( getCableColor() ) );
rh.setTexture( this.getCoveredTexture( this.getCableColor() ) );
rh.setBounds( 5, 5, 5, 11, 11, 11 );
rh.renderBlock( x, y, z, renderer );
}
@@ -265,20 +265,20 @@ public class PartCableSmart extends PartCable
{
ForgeDirection selectedSide = ForgeDirection.UNKNOWN;
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
selectedSide = of;
break;
}
int channels = channelsOnSide[selectedSide.ordinal()];
IIcon def = getTexture( getCableColor() );
int channels = this.channelsOnSide[selectedSide.ordinal()];
IIcon def = this.getTexture( this.getCableColor() );
IIcon off = new OffsetIcon( def, 0, -12 );
IIcon firstTaughtIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 );
IIcon secondTaughtIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 );
switch (selectedSide)
@@ -296,13 +296,13 @@ public class PartCableSmart extends PartCable
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
rh.setTexture( firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
rh.setTexture( secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
break;
case EAST:
case WEST:
@@ -332,13 +332,13 @@ public class PartCableSmart extends PartCable
fpA.setFlip( true, false );
fpB.setFlip( true, false );
Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, fpA );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, fpB );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
break;
case NORTH:
case SOUTH:
@@ -353,13 +353,13 @@ public class PartCableSmart extends PartCable
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
rh.setTexture( firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, firstTaughtIcon, firstOffsetIcon, firstOffsetIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
rh.setTexture( secondOffsetIcon, secondOffsetIcon, secondTaughtIcon, secondTaughtIcon, secondOffsetIcon, secondOffsetIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
break;
default:
break;
@@ -63,18 +63,18 @@ public class PartDenseCable extends PartCable
@MENetworkEventSubscribe
public void channelUpdated(MENetworkChannelsChanged c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
@MENetworkEventSubscribe
public void powerRender(MENetworkPowerStatusChange c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
public PartDenseCable(Class c, ItemStack is) {
super( c, is );
proxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.PREFERRED );
this.proxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.PREFERRED );
}
public PartDenseCable(ItemStack is) {
@@ -93,7 +93,7 @@ public class PartDenseCable extends PartCable
if ( c == AEColor.Transparent )
return AEApi.instance().parts().partCableSmart.stack( AEColor.Transparent, 1 ).getIconIndex();
return getSmartTexture( c );
return this.getSmartTexture( c );
}
@Override
@@ -106,9 +106,9 @@ public class PartDenseCable extends PartCable
float offU = 0;
float offV = 9;
OffsetIcon main = new OffsetIcon( getTexture( getCableColor() ), offU, offV );
OffsetIcon ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV );
OffsetIcon ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV );
OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
for (ForgeDirection side : EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ))
{
@@ -119,9 +119,9 @@ public class PartDenseCable extends PartCable
offU = 9;
offV = 0;
main = new OffsetIcon( getTexture( getCableColor() ), offU, offV );
ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), offU, offV );
ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), offU, offV );
main = new OffsetIcon( this.getTexture( this.getCableColor() ), offU, offV );
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
for (ForgeDirection side : EnumSet.of( ForgeDirection.EAST, ForgeDirection.WEST ))
{
@@ -130,9 +130,9 @@ public class PartDenseCable extends PartCable
rh.renderInventoryFace( ch2, side, renderer );
}
main = new OffsetIcon( getTexture( getCableColor() ), 0, 0 );
ch1 = new OffsetIcon( getChannelTex( 4, false ).getIcon(), 0, 0 );
ch2 = new OffsetIcon( getChannelTex( 4, true ).getIcon(), 0, 0 );
main = new OffsetIcon( this.getTexture( this.getCableColor() ), 0, 0 );
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 );
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 );
for (ForgeDirection side : EnumSet.of( ForgeDirection.SOUTH, ForgeDirection.NORTH ))
{
@@ -155,16 +155,16 @@ public class PartDenseCable extends PartCable
if ( Platform.isServer() )
{
IGridNode n = getGridNode();
IGridNode n = this.getGridNode();
if ( n != null )
connections = n.getConnectedSides();
this.connections = n.getConnectedSides();
else
connections.clear();
this.connections.clear();
}
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
if ( isDense( of ) )
if ( this.isDense( of ) )
{
switch (of)
{
@@ -219,7 +219,7 @@ public class PartDenseCable extends PartCable
private boolean isDense(ForgeDirection of)
{
TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + of.offsetX, tile.yCoord + of.offsetY, tile.zCoord + of.offsetZ );
TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ );
if ( te instanceof IGridHost )
{
AECableType t = ((IGridHost) te).getCableConnectionType( of.getOpposite() );
@@ -230,7 +230,7 @@ public class PartDenseCable extends PartCable
private boolean isSmart(ForgeDirection of)
{
TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + of.offsetX, tile.yCoord + of.offsetY, tile.zCoord + of.offsetZ );
TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + of.offsetX, this.tile.yCoord + of.offsetY, this.tile.zCoord + of.offsetZ );
if ( te instanceof IGridHost )
{
AECableType t = ((IGridHost) te).getCableConnectionType( of.getOpposite() );
@@ -246,7 +246,7 @@ public class PartDenseCable extends PartCable
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
boolean isGlass = false;
AEColor myColor = getCableColor();
AEColor myColor = this.getCableColor();
/*
* ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getPart(
* of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = partHost.getColor() ) );
@@ -281,9 +281,9 @@ public class PartDenseCable extends PartCable
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of, of.getOpposite() ) ) );
if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent
&& partHost.getPart( of.getOpposite() ) == null )
rh.setTexture( getTexture( myColor = partHost.getColor() ) );
rh.setTexture( this.getTexture( myColor = partHost.getColor() ) );
else
rh.setTexture( getTexture( getCableColor() ) );
rh.setTexture( this.getTexture( this.getCableColor() ) );
switch (of)
{
@@ -314,19 +314,19 @@ public class PartDenseCable extends PartCable
rh.setFacesToRender( EnumSet.allOf( ForgeDirection.class ) );
if ( !isGlass )
{
setSmartConnectionRotations( of, renderer );
this.setSmartConnectionRotations( of, renderer );
IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_I( myColor.blackVariant );
rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( myColor.whiteVariant );
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
}
@@ -336,31 +336,31 @@ public class PartDenseCable extends PartCable
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
rh.setTexture( getTexture( getCableColor() ) );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( this.getTexture( this.getCableColor() ) );
EnumSet<ForgeDirection> sides = connections.clone();
EnumSet<ForgeDirection> sides = this.connections.clone();
boolean hasBuses = false;
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
if ( !isDense( of ) )
if ( !this.isDense( of ) )
hasBuses = true;
}
if ( sides.size() != 2 || !nonLinear( sides ) || hasBuses )
if ( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
{
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
if ( isDense( of ) )
renderDenseConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of );
else if ( isSmart( of ) )
renderSmartConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of );
if ( this.isDense( of ) )
this.renderDenseConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
else if ( this.isSmart( of ) )
this.renderSmartConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
else
renderCoveredConnection( x, y, z, rh, renderer, channelsOnSide[of.ordinal()], of );
this.renderCoveredConnection( x, y, z, rh, renderer, this.channelsOnSide[of.ordinal()], of );
}
rh.setTexture( getDenseTexture( getCableColor() ) );
rh.setTexture( this.getDenseTexture( this.getCableColor() ) );
rh.setBounds( 3, 3, 3, 13, 13, 13 );
rh.renderBlock( x, y, z, renderer );
}
@@ -368,20 +368,20 @@ public class PartDenseCable extends PartCable
{
ForgeDirection selectedSide = ForgeDirection.UNKNOWN;
for (ForgeDirection of : connections)
for (ForgeDirection of : this.connections)
{
selectedSide = of;
break;
}
int channels = channelsOnSide[selectedSide.ordinal()];
IIcon def = getTexture( getCableColor() );
int channels = this.channelsOnSide[selectedSide.ordinal()];
IIcon def = this.getTexture( this.getCableColor() );
IIcon off = new OffsetIcon( def, 0, -12 );
IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon firstOffset = new OffsetIcon( firstIcon, 0, -12 );
IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon secondOffset = new OffsetIcon( secondIcon, 0, -12 );
switch (selectedSide)
@@ -399,13 +399,13 @@ public class PartDenseCable extends PartCable
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
rh.setTexture( firstIcon, firstIcon, firstOffset, firstOffset, firstOffset, firstOffset );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
rh.setTexture( secondIcon, secondIcon, secondOffset, secondOffset, secondOffset, secondOffset );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
break;
case EAST:
case WEST:
@@ -432,13 +432,13 @@ public class PartDenseCable extends PartCable
fpA.setFlip( true, false );
fpB.setFlip( true, false );
Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
rh.setTexture( firstOffset, firstOffset, firstOffset, firstOffset, firstIcon, fpA );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
rh.setTexture( secondOffset, secondOffset, secondOffset, secondOffset, secondIcon, fpB );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
break;
case NORTH:
case SOUTH:
@@ -453,13 +453,13 @@ public class PartDenseCable extends PartCable
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
Tessellator.instance.setColorOpaque_I( getCableColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().blackVariant );
rh.setTexture( firstOffset, firstOffset, firstIcon, firstIcon, firstOffset, firstOffset );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
Tessellator.instance.setColorOpaque_I( getCableColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getCableColor().whiteVariant );
rh.setTexture( secondOffset, secondOffset, secondIcon, secondIcon, secondOffset, secondOffset );
renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );
break;
default:
break;
@@ -509,6 +509,6 @@ public class PartDenseCable extends PartCable
default:
}
return is.getIconIndex();
return this.is.getIconIndex();
}
}
@@ -49,62 +49,62 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
{
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", proxy.getMachineRepresentation(), true );
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.proxy.getMachineRepresentation(), true );
public PartQuartzFiber(ItemStack is) {
super( PartQuartzFiber.class, is );
proxy.setIdlePowerUsage( 0 );
proxy.setFlags( GridFlags.CANNOT_CARRY );
outerProxy.setIdlePowerUsage( 0 );
outerProxy.setFlags( GridFlags.CANNOT_CARRY );
this.proxy.setIdlePowerUsage( 0 );
this.proxy.setFlags( GridFlags.CANNOT_CARRY );
this.outerProxy.setIdlePowerUsage( 0 );
this.outerProxy.setFlags( GridFlags.CANNOT_CARRY );
}
@Override
public void onPlacement(EntityPlayer player, ItemStack held, ForgeDirection side)
{
super.onPlacement( player, held, side );
outerProxy.setOwner( player );
this.outerProxy.setOwner( player );
}
@Override
public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile)
{
super.setPartHostInfo( side, host, tile );
outerProxy.setValidSides( EnumSet.of( side ) );
this.outerProxy.setValidSides( EnumSet.of( side ) );
}
@Override
public void readFromNBT(NBTTagCompound extra)
{
super.readFromNBT( extra );
outerProxy.readFromNBT( extra );
this.outerProxy.readFromNBT( extra );
}
@Override
public void writeToNBT(NBTTagCompound extra)
{
super.writeToNBT( extra );
outerProxy.writeToNBT( extra );
this.outerProxy.writeToNBT( extra );
}
@Override
public void addToWorld()
{
super.addToWorld();
outerProxy.onReady();
this.outerProxy.onReady();
}
@Override
public void removeFromWorld()
{
super.removeFromWorld();
outerProxy.invalidate();
this.outerProxy.invalidate();
}
@Override
public IGridNode getExternalFacingNode()
{
return outerProxy.getNode();
return this.outerProxy.getNode();
}
@Override
@@ -117,7 +117,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
IIcon myIcon = is.getIconIndex();
IIcon myIcon = this.is.getIconIndex();
rh.setTexture( myIcon );
rh.setBounds( 6, 6, 10, 10, 10, 16 );
rh.renderBlock( x, y, z, renderer );
@@ -136,7 +136,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
{
GL11.glTranslated( -0.2, -0.3, 0.0 );
rh.setTexture( is.getIconIndex() );
rh.setTexture( this.is.getIconIndex() );
rh.setBounds( 6.0f, 6.0f, 5.0f, 10.0f, 10.0f, 11.0f );
rh.renderInventoryBox( renderer );
rh.setTexture( null );
@@ -149,7 +149,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
try
{
IEnergyGrid eg = proxy.getEnergy();
IEnergyGrid eg = this.proxy.getEnergy();
acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen );
}
catch (GridAccessException e)
@@ -159,7 +159,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
try
{
IEnergyGrid eg = outerProxy.getEnergy();
IEnergyGrid eg = this.outerProxy.getEnergy();
acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen );
}
catch (GridAccessException e)
@@ -176,7 +176,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
try
{
IEnergyGrid eg = proxy.getEnergy();
IEnergyGrid eg = this.proxy.getEnergy();
if ( !seen.contains( eg ) )
return eg.injectAEPower( amt, mode, seen );
}
@@ -187,7 +187,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
try
{
IEnergyGrid eg = outerProxy.getEnergy();
IEnergyGrid eg = this.outerProxy.getEnergy();
if ( !seen.contains( eg ) )
return eg.injectAEPower( amt, mode, seen );
}
@@ -212,7 +212,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
try
{
IEnergyGrid eg = proxy.getEnergy();
IEnergyGrid eg = this.proxy.getEnergy();
demand += eg.getEnergyDemand( amt - demand, seen );
}
catch (GridAccessException e)
@@ -222,7 +222,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
try
{
IEnergyGrid eg = outerProxy.getEnergy();
IEnergyGrid eg = this.outerProxy.getEnergy();
demand += eg.getEnergyDemand( amt - demand, seen );
}
catch (GridAccessException e)
@@ -78,9 +78,9 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.MJ5 ) )
{
pp = (BaseMJPerdition) ((IMJ5) AppEng.instance.getIntegration( IntegrationType.MJ5 )).createPerdition( this );
if ( pp != null )
pp.configure( 1, 380, 1.0f / 5.0f, 1000 );
this.pp = (BaseMJPerdition) ((IMJ5) AppEng.instance.getIntegration( IntegrationType.MJ5 )).createPerdition( this );
if ( this.pp != null )
this.pp.configure( 1, 380, 1.0f / 5.0f, 1000 );
}
}
@@ -95,14 +95,14 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
@Method(iname = "MJ5")
public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
{
if ( !output && proxy.isActive() )
if ( !this.output && this.proxy.isActive() )
{
float totalRequiredPower = 0.0f;
TunnelCollection<PartP2PBCPower> tunnels;
try
{
tunnels = getOutputs();
tunnels = this.getOutputs();
}
catch (GridAccessException e)
{
@@ -114,7 +114,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
IPowerReceptor target = o.getPowerTarget();
if ( target != null )
{
PowerReceiver tp = target.getPowerReceiver( side.getOpposite() );
PowerReceiver tp = target.getPowerReceiver( this.side.getOpposite() );
if ( tp != null )
{
double request = tp.powerRequest();
@@ -133,7 +133,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
if ( totalRequiredPower < 0.1 )
return TickRateModulation.SLOWER;
double currentTotal = pp.getPowerReceiver().getEnergyStored();
double currentTotal = this.pp.getPowerReceiver().getEnergyStored();
if ( currentTotal < 0.01 )
return TickRateModulation.SLOWER;
@@ -142,7 +142,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
IPowerReceptor target = o.getPowerTarget();
if ( target != null )
{
PowerReceiver tp = target.getPowerReceiver( side.getOpposite() );
PowerReceiver tp = target.getPowerReceiver( this.side.getOpposite() );
if ( tp != null )
{
double request = tp.powerRequest();
@@ -153,8 +153,8 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
if ( request > 0.01 && request > tp.getMinEnergyReceived() )
{
double toPull = currentTotal * (request / totalRequiredPower);
double pulled = pp.useEnergy( 0, toPull, true );
QueueTunnelDrain( PowerUnits.MJ, pulled );
double pulled = this.pp.useEnergy( 0, toPull, true );
this.QueueTunnelDrain( PowerUnits.MJ, pulled );
tp.receiveEnergy( Type.PIPE, pulled, o.side.getOpposite() );
}
@@ -176,14 +176,14 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
@Method(iname = "MJ6")
private IBatteryObject getTargetBattery()
{
TileEntity te = getWorld().getTileEntity( tile.xCoord + side.offsetX, tile.yCoord + side.offsetY, tile.zCoord + side.offsetZ );
TileEntity te = this.getWorld().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ );
if ( te != null )
{
IBatteryObject bo = MjAPI.getMjBattery( te, MjAPI.DEFAULT_POWER_FRAMEWORK, side.getOpposite() );
IBatteryObject bo = MjAPI.getMjBattery( te, MjAPI.DEFAULT_POWER_FRAMEWORK, this.side.getOpposite() );
if ( bo != null )
return bo;
return ((IMJ6) AppEng.instance.getIntegration( IntegrationType.MJ6 )).provider( te, side.getOpposite() );
return ((IMJ6) AppEng.instance.getIntegration( IntegrationType.MJ6 )).provider( te, this.side.getOpposite() );
}
return null;
}
@@ -191,7 +191,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
@Method(iname = "MJ5")
private IPowerReceptor getPowerTarget()
{
TileEntity te = getWorld().getTileEntity( tile.xCoord + side.offsetX, tile.yCoord + side.offsetY, tile.zCoord + side.offsetZ );
TileEntity te = this.getWorld().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ );
if ( te != null )
{
if ( te instanceof IPowerReceptor )
@@ -204,16 +204,16 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT( tag );
if ( pp != null )
pp.writeToNBT( tag );
if ( this.pp != null )
this.pp.writeToNBT( tag );
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
super.readFromNBT( tag );
if ( pp != null )
pp.readFromNBT( tag );
if ( this.pp != null )
this.pp.readFromNBT( tag );
}
@Override
@@ -227,7 +227,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
@Method(iname = "MJ5")
public PowerReceiver getPowerReceiver(ForgeDirection side)
{
return pp.getPowerReceiver();
return this.pp.getPowerReceiver();
}
@Override
@@ -240,7 +240,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
@Override
public World getWorld()
{
return tile.getWorldObj();
return this.tile.getWorldObj();
}
@Override
@@ -258,7 +258,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
{
double totalRequiredPower = 0.0f;
for (PartP2PBCPower g : getOutputs())
for (PartP2PBCPower g : this.getOutputs())
{
IBatteryObject o = g.getTargetBattery();
if ( o != null )
@@ -277,27 +277,27 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
@Method(iname = "MJ6")
public double addEnergy(double mj)
{
return addEnergyInternal( mj, false, false );
return this.addEnergyInternal( mj, false, false );
}
@Override
@Method(iname = "MJ6")
public double addEnergy(double mj, boolean ignoreCycleLimit)
{
return addEnergyInternal( mj, true, ignoreCycleLimit );
return this.addEnergyInternal( mj, true, ignoreCycleLimit );
}
@Method(iname = "MJ6")
private double addEnergyInternal(double mj, boolean cycleLimitMode, boolean ignoreCycleLimit)
{
if ( output || !proxy.isActive() )
if ( this.output || !this.proxy.isActive() )
return 0;
double originalInput = mj;
try
{
TunnelCollection<PartP2PBCPower> outs = getOutputs();
TunnelCollection<PartP2PBCPower> outs = this.getOutputs();
double outputs = 0;
for (PartP2PBCPower g : outs)
@@ -357,7 +357,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
{
double totalRequiredPower = 0.0f;
for (PartP2PBCPower g : getOutputs())
for (PartP2PBCPower g : this.getOutputs())
{
IBatteryObject o = g.getTargetBattery();
if ( o != null )
@@ -386,7 +386,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
{
double totalRequiredPower = 0.0f;
for (PartP2PBCPower g : getOutputs())
for (PartP2PBCPower g : this.getOutputs())
{
IBatteryObject o = g.getTargetBattery();
if ( o != null )
@@ -409,7 +409,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
{
double totalRequiredPower = 1000000000000.0;
for (PartP2PBCPower g : getOutputs())
for (PartP2PBCPower g : this.getOutputs())
{
IBatteryObject o = g.getTargetBattery();
if ( o != null )
@@ -432,7 +432,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
{
double totalRequiredPower = 1000000.0;
for (PartP2PBCPower g : getOutputs())
for (PartP2PBCPower g : this.getOutputs())
{
IBatteryObject o = g.getTargetBattery();
if ( o != null )
@@ -68,20 +68,20 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT( tag );
tag.setDouble( "OutputPacket", OutputEnergyA );
tag.setDouble( "OutputPacket2", OutputEnergyB );
tag.setDouble( "OutputVoltageA", OutputVoltageA );
tag.setDouble( "OutputVoltageB", OutputVoltageB );
tag.setDouble( "OutputPacket", this.OutputEnergyA );
tag.setDouble( "OutputPacket2", this.OutputEnergyB );
tag.setDouble( "OutputVoltageA", this.OutputVoltageA );
tag.setDouble( "OutputVoltageB", this.OutputVoltageB );
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
super.readFromNBT( tag );
OutputEnergyA = tag.getDouble( "OutputPacket" );
OutputEnergyB = tag.getDouble( "OutputPacket2" );
OutputVoltageA = tag.getDouble( "OutputVoltageA" );
OutputVoltageB = tag.getDouble( "OutputVoltageB" );
this.OutputEnergyA = tag.getDouble( "OutputPacket" );
this.OutputEnergyB = tag.getDouble( "OutputPacket2" );
this.OutputVoltageA = tag.getDouble( "OutputVoltageA" );
this.OutputVoltageB = tag.getDouble( "OutputVoltageB" );
}
@Override
@@ -94,28 +94,28 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
@Override
public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
{
if ( !output )
return direction.equals( side );
if ( !this.output )
return direction.equals( this.side );
return false;
}
@Override
public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction)
{
if ( output )
return direction.equals( side );
if ( this.output )
return direction.equals( this.side );
return false;
}
@Override
public double getDemandedEnergy()
{
if ( output )
if ( this.output )
return 0;
try
{
for (PartP2PIC2Power t : getOutputs())
for (PartP2PIC2Power t : this.getOutputs())
{
if ( t.OutputEnergyA <= 0.0001 || t.OutputEnergyB <= 0.0001 )
{
@@ -134,13 +134,13 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
@Override
public void onTunnelNetworkChange()
{
getHost().notifyNeighbors();
this.getHost().notifyNeighbors();
}
@Override
public void onTunnelConfigChange()
{
getHost().partChanged();
this.getHost().partChanged();
}
public float getPowerDrainPerTick()
@@ -154,7 +154,7 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
TunnelCollection<PartP2PIC2Power> outs;
try
{
outs = getOutputs();
outs = this.getOutputs();
}
catch (GridAccessException e)
{
@@ -191,7 +191,7 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
if ( x != null && x.OutputEnergyA <= 0.001 )
{
QueueTunnelDrain( PowerUnits.EU, amount );
this.QueueTunnelDrain( PowerUnits.EU, amount );
x.OutputEnergyA = amount;
x.OutputVoltageA = voltage;
return 0;
@@ -199,7 +199,7 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
if ( x != null && x.OutputEnergyB <= 0.001 )
{
QueueTunnelDrain( PowerUnits.EU, amount );
this.QueueTunnelDrain( PowerUnits.EU, amount );
x.OutputEnergyB = amount;
x.OutputVoltageB = voltage;
return 0;
@@ -217,30 +217,30 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements i
@Override
public double getOfferedEnergy()
{
if ( output )
return OutputEnergyA;
if ( this.output )
return this.OutputEnergyA;
return 0;
}
@Override
public void drawEnergy(double amount)
{
OutputEnergyA -= amount;
if ( OutputEnergyA < 0.001 )
this.OutputEnergyA -= amount;
if ( this.OutputEnergyA < 0.001 )
{
OutputEnergyA = OutputEnergyB;
OutputEnergyB = 0;
this.OutputEnergyA = this.OutputEnergyB;
this.OutputEnergyB = 0;
OutputVoltageA = OutputVoltageB;
OutputVoltageB = 0;
this.OutputVoltageA = this.OutputVoltageB;
this.OutputVoltageB = 0;
}
}
@Override
public int getSourceTier()
{
if ( output )
return calculateTierFromVoltage( OutputVoltageA );
if ( this.output )
return this.calculateTierFromVoltage( this.OutputVoltageA );
return 4;
}
@@ -81,25 +81,25 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
{
IInventory output = null;
if ( proxy.isActive() )
if ( this.proxy.isActive() )
{
TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + side.offsetX, tile.yCoord + side.offsetY, tile.zCoord + side.offsetZ );
TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ );
if ( which.contains( this ) )
if ( this.which.contains( this ) )
return null;
which.add( this );
this.which.add( this );
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) )
{
IBC buildcraft = (IBC) AppEng.instance.getIntegration( IntegrationType.BC );
if ( buildcraft != null )
{
if ( buildcraft.isPipe( te, side.getOpposite() ) )
if ( buildcraft.isPipe( te, this.side.getOpposite() ) )
{
try
{
output = new WrapperBCPipe( te, side.getOpposite() );
output = new WrapperBCPipe( te, this.side.getOpposite() );
}
catch (Throwable ignore)
{
@@ -122,7 +122,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
}
else if ( te instanceof ISidedInventory )
{
output = new WrapperMCISidedInventory( (ISidedInventory) te, side.getOpposite() );
output = new WrapperMCISidedInventory( (ISidedInventory) te, this.side.getOpposite() );
}
else if ( te instanceof IInventory )
{
@@ -130,7 +130,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
}
}
which.pop();
this.which.pop();
}
return output;
@@ -139,9 +139,9 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@Override
public void onNeighborChanged()
{
cachedInv = null;
PartP2PItems input = getInput();
if ( input != null && output )
this.cachedInv = null;
PartP2PItems input = this.getInput();
if ( input != null && this.output )
input.onTunnelNetworkChange();
}
@@ -154,28 +154,28 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@Override
public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
{
boolean wasReq = requested;
boolean wasReq = this.requested;
if ( requested && cachedInv != null )
((WrapperChainedInventory) cachedInv).cycleOrder();
if ( this.requested && this.cachedInv != null )
((WrapperChainedInventory) this.cachedInv).cycleOrder();
requested = false;
this.requested = false;
return wasReq ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
}
IInventory getDestination()
{
requested = true;
this.requested = true;
if ( cachedInv != null )
return cachedInv;
if ( this.cachedInv != null )
return this.cachedInv;
List<IInventory> outs = new LinkedList<IInventory>();
TunnelCollection<PartP2PItems> itemTunnels;
try
{
itemTunnels = getOutputs();
itemTunnels = this.getOutputs();
}
catch (GridAccessException e)
{
@@ -194,20 +194,20 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
}
}
return cachedInv = new WrapperChainedInventory( outs );
return this.cachedInv = new WrapperChainedInventory( outs );
}
@MENetworkEventSubscribe
public void changeStateA(MENetworkBootingStatusChange bs)
{
if ( !output )
if ( !this.output )
{
cachedInv = null;
int olderSize = oldSize;
oldSize = getDestination().getSizeInventory();
if ( olderSize != oldSize )
this.cachedInv = null;
int olderSize = this.oldSize;
this.oldSize = this.getDestination().getSizeInventory();
if ( olderSize != this.oldSize )
{
getHost().notifyNeighbors();
this.getHost().notifyNeighbors();
}
}
}
@@ -215,14 +215,14 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@MENetworkEventSubscribe
public void changeStateB(MENetworkChannelsChanged bs)
{
if ( !output )
if ( !this.output )
{
cachedInv = null;
int olderSize = oldSize;
oldSize = getDestination().getSizeInventory();
if ( olderSize != oldSize )
this.cachedInv = null;
int olderSize = this.oldSize;
this.oldSize = this.getDestination().getSizeInventory();
if ( olderSize != this.oldSize )
{
getHost().notifyNeighbors();
this.getHost().notifyNeighbors();
}
}
}
@@ -230,14 +230,14 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@MENetworkEventSubscribe
public void changeStateC(MENetworkPowerStatusChange bs)
{
if ( !output )
if ( !this.output )
{
cachedInv = null;
int olderSize = oldSize;
oldSize = getDestination().getSizeInventory();
if ( olderSize != oldSize )
this.cachedInv = null;
int olderSize = this.oldSize;
this.oldSize = this.getDestination().getSizeInventory();
if ( olderSize != this.oldSize )
{
getHost().notifyNeighbors();
this.getHost().notifyNeighbors();
}
}
}
@@ -245,19 +245,19 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@Override
public void onTunnelNetworkChange()
{
if ( !output )
if ( !this.output )
{
cachedInv = null;
int olderSize = oldSize;
oldSize = getDestination().getSizeInventory();
if ( olderSize != oldSize )
this.cachedInv = null;
int olderSize = this.oldSize;
this.oldSize = this.getDestination().getSizeInventory();
if ( olderSize != this.oldSize )
{
getHost().notifyNeighbors();
this.getHost().notifyNeighbors();
}
}
else
{
PartP2PItems input = getInput();
PartP2PItems input = this.getInput();
if ( input != null )
input.getHost().notifyNeighbors();
}
@@ -273,19 +273,19 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@Override
public int getSizeInventory()
{
return getDestination().getSizeInventory();
return this.getDestination().getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int i)
{
return getDestination().getStackInSlot( i );
return this.getDestination().getStackInSlot( i );
}
@Override
public ItemStack decrStackSize(int i, int j)
{
return getDestination().decrStackSize( i, j );
return this.getDestination().decrStackSize( i, j );
}
@Override
@@ -297,7 +297,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@Override
public void setInventorySlotContents(int i, ItemStack itemstack)
{
getDestination().setInventorySlotContents( i, itemstack );
this.getDestination().setInventorySlotContents( i, itemstack );
}
@Override
@@ -315,7 +315,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@Override
public int getInventoryStackLimit()
{
return getDestination().getInventoryStackLimit();
return this.getDestination().getInventoryStackLimit();
}
@Override
@@ -331,14 +331,14 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@Override
public boolean isItemValidForSlot(int i, net.minecraft.item.ItemStack itemstack)
{
return getDestination().isItemValidForSlot( i, itemstack );
return this.getDestination().isItemValidForSlot( i, itemstack );
}
@Override
public int[] getAccessibleSlotsFromSide(int var1)
{
int[] slots = new int[getSizeInventory()];
for (int x = 0; x < getSizeInventory(); x++)
int[] slots = new int[this.getSizeInventory()];
for (int x = 0; x < this.getSizeInventory(); x++)
slots[x] = x;
return slots;
}
@@ -351,7 +351,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@Override
public boolean canInsertItem(int i, ItemStack itemstack, int j)
{
return getDestination().isItemValidForSlot( i, itemstack );
return this.getDestination().isItemValidForSlot( i, itemstack );
}
@Override
@@ -370,7 +370,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IPipeCo
@Method(iname = "BC")
public ConnectOverride overridePipeConnection(PipeType type, ForgeDirection with)
{
return side.equals( with ) && type == PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT;
return this.side.equals( with ) && type == PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT;
}
@Override
@@ -58,82 +58,82 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
public void setLightLevel(int out)
{
lastValue = out;
getHost().markForUpdate();
this.lastValue = out;
this.getHost().markForUpdate();
}
@Override
public int getLightLevel()
{
if ( output && isPowered() )
return blockLight( lastValue );
if ( this.output && this.isPowered() )
return this.blockLight( this.lastValue );
return 0;
}
private int blockLight(int emit)
{
if ( opacity < 0 )
if ( this.opacity < 0 )
{
TileEntity te = this.getTile();
opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ );
this.opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ );
}
return (int) (emit * (opacity / 255.0f));
return (int) (emit * (this.opacity / 255.0f));
}
@Override
public void chanRender(MENetworkChannelsChanged c)
{
onTunnelNetworkChange();
this.onTunnelNetworkChange();
super.chanRender( c );
}
@Override
public void powerRender(MENetworkPowerStatusChange c)
{
onTunnelNetworkChange();
this.onTunnelNetworkChange();
super.powerRender( c );
}
@Override
public void onTunnelNetworkChange()
{
if ( output )
if ( this.output )
{
PartP2PLight src = getInput();
PartP2PLight src = this.getInput();
if ( src != null && src.proxy.isActive() )
setLightLevel( src.lastValue );
this.setLightLevel( src.lastValue );
else
getHost().markForUpdate();
this.getHost().markForUpdate();
}
else
doWork();
this.doWork();
}
@Override
public void onTunnelConfigChange()
{
onTunnelNetworkChange();
this.onTunnelNetworkChange();
}
@Override
public void onNeighborChanged()
{
opacity = -1;
this.opacity = -1;
doWork();
this.doWork();
if ( output )
getHost().markForUpdate();
if ( this.output )
this.getHost().markForUpdate();
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT( tag );
tag.setFloat( "opacity", opacity );
tag.setInteger( "lastValue", lastValue );
tag.setFloat( "opacity", this.opacity );
tag.setInteger( "lastValue", this.lastValue );
}
@Override
@@ -141,16 +141,16 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
{
super.readFromNBT( tag );
if ( tag.hasKey( "opacity" ) )
opacity = tag.getFloat( "opacity" );
lastValue = tag.getInteger( "lastValue" );
this.opacity = tag.getFloat( "opacity" );
this.lastValue = tag.getInteger( "lastValue" );
}
@Override
public boolean readFromStream(ByteBuf data) throws IOException
{
super.readFromStream( data );
lastValue = data.readInt();
output = lastValue > 0;
this.lastValue = data.readInt();
this.output = this.lastValue > 0;
return false;
}
@@ -158,7 +158,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
public void writeToStream(ByteBuf data) throws IOException
{
super.writeToStream( data );
data.writeInt( output ? lastValue : 0 );
data.writeInt( this.output ? this.lastValue : 0 );
}
@Override
@@ -176,21 +176,21 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
private boolean doWork()
{
if ( output )
if ( this.output )
return false;
TileEntity te = getTile();
TileEntity te = this.getTile();
World w = te.getWorldObj();
int newLevel = w.getBlockLightValue( te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ );
int newLevel = w.getBlockLightValue( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ );
if ( lastValue != newLevel && proxy.isActive() )
if ( this.lastValue != newLevel && this.proxy.isActive() )
{
lastValue = newLevel;
this.lastValue = newLevel;
try
{
for (PartP2PLight out : getOutputs())
out.setLightLevel( lastValue );
for (PartP2PLight out : this.getOutputs())
out.setLightLevel( this.lastValue );
}
catch (GridAccessException e)
{
@@ -209,6 +209,6 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
@Override
public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
{
return doWork() ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
return this.doWork() ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
}
}
@@ -55,9 +55,9 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
private FluidTankInfo[] getTank()
{
if ( output )
if ( this.output )
{
PartP2PLiquids tun = getInput();
PartP2PLiquids tun = this.getInput();
if ( tun != null )
return activeTank;
}
@@ -65,7 +65,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
{
try
{
if ( !getOutputs().isEmpty() )
if ( !this.getOutputs().isEmpty() )
return activeTank;
}
catch (GridAccessException e)
@@ -98,7 +98,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
try
{
for (PartP2PLiquids l : getOutputs())
for (PartP2PLiquids l : this.getOutputs())
{
IFluidHandler handler = l.getTarget();
if ( handler != null )
@@ -119,10 +119,10 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
@Override
public void onNeighborChanged()
{
cachedTank = null;
if ( output )
this.cachedTank = null;
if ( this.output )
{
PartP2PLiquids in = getInput();
PartP2PLiquids in = this.getInput();
if ( in != null )
in.onTunnelNetworkChange();
}
@@ -131,20 +131,20 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
@Override
public void onTunnelNetworkChange()
{
cachedTank = null;
this.cachedTank = null;
}
IFluidHandler getTarget()
{
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return null;
if ( cachedTank != null )
return cachedTank;
if ( this.cachedTank != null )
return this.cachedTank;
TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + side.offsetX, tile.yCoord + side.offsetY, tile.zCoord + side.offsetZ );
TileEntity te = this.tile.getWorldObj().getTileEntity( this.tile.xCoord + this.side.offsetX, this.tile.yCoord + this.side.offsetY, this.tile.zCoord + this.side.offsetZ );
if ( te instanceof IFluidHandler )
return cachedTank = (IFluidHandler) te;
return this.cachedTank = (IFluidHandler) te;
return null;
}
@@ -164,7 +164,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
{
Stack<PartP2PLiquids> stack = getDepth();
Stack<PartP2PLiquids> stack = this.getDepth();
for (PartP2PLiquids t : stack)
if ( t == this )
@@ -172,7 +172,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
stack.push( this );
List<PartP2PLiquids> list = getOutputs( resource.getFluid() );
List<PartP2PLiquids> list = this.getOutputs( resource.getFluid() );
int requestTotal = 0;
Iterator<PartP2PLiquids> i = list.iterator();
@@ -239,7 +239,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
@Override
public boolean canFill(ForgeDirection from, Fluid fluid)
{
return !output && from.equals( side ) && !getOutputs( fluid ).isEmpty();
return !this.output && from.equals( this.side ) && !this.getOutputs( fluid ).isEmpty();
}
@Override
@@ -263,8 +263,8 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection from)
{
if ( from.equals( side ) )
return getTank();
if ( from.equals( this.side ) )
return this.getTank();
return new FluidTankInfo[0];
}
@@ -59,46 +59,46 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
@Override
public int isProvidingStrongPower()
{
return output ? power : 0;
return this.output ? this.power : 0;
}
@Override
public int isProvidingWeakPower()
{
return output ? power : 0;
return this.output ? this.power : 0;
}
@Override
public void onTunnelNetworkChange()
{
setNetworkReady();
this.setNetworkReady();
}
@MENetworkEventSubscribe
public void changeStateA(MENetworkBootingStatusChange bs)
{
setNetworkReady();
this.setNetworkReady();
}
@MENetworkEventSubscribe
public void changeStateB(MENetworkChannelsChanged bs)
{
setNetworkReady();
this.setNetworkReady();
}
@MENetworkEventSubscribe
public void changeStateC(MENetworkPowerStatusChange bs)
{
setNetworkReady();
this.setNetworkReady();
}
public void setNetworkReady()
{
if ( output )
if ( this.output )
{
PartP2PRedstone in = getInput();
PartP2PRedstone in = this.getInput();
if ( in != null )
putInput( in.power );
this.putInput( in.power );
}
}
@@ -106,30 +106,30 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
protected void putInput(Object o)
{
if ( recursive )
if ( this.recursive )
return;
recursive = true;
if ( output && proxy.isActive() )
this.recursive = true;
if ( this.output && this.proxy.isActive() )
{
int newPower = (Integer) o;
if ( power != newPower )
if ( this.power != newPower )
{
power = newPower;
notifyNeighbors();
this.power = newPower;
this.notifyNeighbors();
}
}
recursive = false;
this.recursive = false;
}
public void notifyNeighbors()
{
World worldObj = tile.getWorldObj();
World worldObj = this.tile.getWorldObj();
int xCoord = tile.xCoord;
int yCoord = tile.yCoord;
int zCoord = tile.zCoord;
int xCoord = this.tile.xCoord;
int yCoord = this.tile.yCoord;
int zCoord = this.tile.zCoord;
Platform.notifyBlocksOfNeighbors( worldObj, xCoord, yCoord, zCoord );
@@ -146,14 +146,14 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT( tag );
tag.setInteger( "power", power );
tag.setInteger( "power", this.power );
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
super.readFromNBT( tag );
power = tag.getInteger( "power" );
this.power = tag.getInteger( "power" );
}
@Override
@@ -171,24 +171,24 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
@Override
public void onNeighborChanged()
{
if ( !output )
if ( !this.output )
{
int x = tile.xCoord + side.offsetX;
int y = tile.yCoord + side.offsetY;
int z = tile.zCoord + side.offsetZ;
int x = this.tile.xCoord + this.side.offsetX;
int y = this.tile.yCoord + this.side.offsetY;
int z = this.tile.zCoord + this.side.offsetZ;
Block b = tile.getWorldObj().getBlock( x, y, z );
if ( b != null && !output )
Block b = this.tile.getWorldObj().getBlock( x, y, z );
if ( b != null && !this.output )
{
int srcSide = side.ordinal();
int srcSide = this.side.ordinal();
if ( b instanceof BlockRedstoneWire )
srcSide = 1;
power = b.isProvidingStrongPower( tile.getWorldObj(), x, y, z, srcSide );
power = Math.max( power, b.isProvidingWeakPower( tile.getWorldObj(), x, y, z, srcSide ) );
sendToOutput( power );
this.power = b.isProvidingStrongPower( this.tile.getWorldObj(), x, y, z, srcSide );
this.power = Math.max( this.power, b.isProvidingWeakPower( this.tile.getWorldObj(), x, y, z, srcSide ) );
this.sendToOutput( this.power );
}
else
sendToOutput( 0 );
this.sendToOutput( 0 );
}
}
@@ -196,7 +196,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
{
try
{
for (PartP2PRedstone rs : getOutputs())
for (PartP2PRedstone rs : this.getOutputs())
{
rs.putInput( power );
}
@@ -55,11 +55,11 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
public boolean output;
public long freq;
final TunnelCollection type = new TunnelCollection<T>( null, getClass() );
final TunnelCollection type = new TunnelCollection<T>( null, this.getClass() );
public PartP2PTunnel(ItemStack is) {
super( PartP2PTunnel.class, is );
if ( getClass() == PartP2PTunnel.class )
if ( this.getClass() == PartP2PTunnel.class )
throw new RuntimeException( "Don't construct the root tunnel!" );
}
@@ -72,15 +72,15 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
@Override
public void writeToNBT(NBTTagCompound data)
{
data.setBoolean( "output", output );
data.setLong( "freq", freq );
data.setBoolean( "output", this.output );
data.setLong( "freq", this.freq );
}
@Override
public void readFromNBT(NBTTagCompound data)
{
output = data.getBoolean( "output" );
freq = data.getLong( "freq" );
this.output = data.getBoolean( "output" );
this.freq = data.getLong( "freq" );
}
@Override
@@ -107,9 +107,9 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
IPart testPart = ((IPartItem) newType.getItem()).createPartFromItemStack( newType );
if ( testPart instanceof PartP2PTunnel )
{
getHost().removePart( side, true );
ForgeDirection dir = getHost().addPart( newType, side, player );
IPart newBus = getHost().getPart( dir );
this.getHost().removePart( this.side, true );
ForgeDirection dir = this.getHost().addPart( newType, this.side, player );
IPart newBus = this.getHost().getPart( dir );
if ( newBus instanceof PartP2PTunnel )
{
@@ -181,12 +181,12 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
if ( newType != null && !Platform.isSameItem( newType, this.is ) )
{
boolean oldOutput = output;
long myFreq = freq;
boolean oldOutput = this.output;
long myFreq = this.freq;
getHost().removePart( side, false );
ForgeDirection dir = getHost().addPart( newType, side, player );
IPart newBus = getHost().getPart( dir );
this.getHost().removePart( this.side, false );
ForgeDirection dir = this.getHost().addPart( newType, this.side, player );
IPart newBus = this.getHost().getPart( dir );
if ( newBus instanceof PartP2PTunnel )
{
@@ -205,7 +205,7 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
}
}
Platform.notifyBlocksOfNeighbors( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord );
Platform.notifyBlocksOfNeighbors( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord );
return true;
}
}
@@ -227,29 +227,29 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
IMemoryCard mc = (IMemoryCard) is.getItem();
NBTTagCompound data = new NBTTagCompound();
long newFreq = freq;
boolean wasOutput = output;
output = false;
long newFreq = this.freq;
boolean wasOutput = this.output;
this.output = false;
if ( wasOutput || freq == 0 )
if ( wasOutput || this.freq == 0 )
newFreq = System.currentTimeMillis();
try
{
proxy.getP2P().updateFreq( this, newFreq );
this.proxy.getP2P().updateFreq( this, newFreq );
}
catch (GridAccessException e)
{
// :P
}
onTunnelConfigChange();
this.onTunnelConfigChange();
ItemStack p2pItem = getItemStack( PartItemStack.Wrench );
ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench );
String type = p2pItem.getUnlocalizedName();
p2pItem.writeToNBT( data );
data.setLong( "freq", freq );
data.setLong( "freq", this.freq );
mc.setMemoryCardContents( is, type + ".name", data );
mc.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
@@ -273,10 +273,10 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
public TunnelCollection<T> getCollection(Collection<PartP2PTunnel> collection, Class<? extends PartP2PTunnel> c)
{
if ( type.matches( c ) )
if ( this.type.matches( c ) )
{
type.setSource( collection );
return type;
this.type.setSource( collection );
return this.type;
}
return null;
@@ -284,14 +284,14 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
public T getInput()
{
if ( freq == 0 )
if ( this.freq == 0 )
return null;
PartP2PTunnel tunnel;
try
{
tunnel = proxy.getP2P().getInput( freq );
if ( getClass().isInstance( tunnel ) )
tunnel = this.proxy.getP2P().getInput( this.freq );
if ( this.getClass().isInstance( tunnel ) )
return (T) tunnel;
}
catch (GridAccessException e)
@@ -303,9 +303,9 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
public TunnelCollection<T> getOutputs() throws GridAccessException
{
if ( proxy.isActive() )
return (TunnelCollection<T>) proxy.getP2P().getOutputs( freq, getClass() );
return new TunnelCollection( new ArrayList(), getClass() );
if ( this.proxy.isActive() )
return (TunnelCollection<T>) this.proxy.getP2P().getOutputs( this.freq, this.getClass() );
return new TunnelCollection( new ArrayList(), this.getClass() );
}
public void onTunnelNetworkChange()
@@ -317,13 +317,13 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( getTypeTexture() );
rh.setTexture( this.getTypeTexture() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderInventoryBox( renderer );
rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(),
is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderInventoryBox( renderer );
@@ -338,14 +338,14 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
rh.setTexture( getTypeTexture() );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( this.getTypeTexture() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(),
is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
@@ -361,7 +361,7 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
rh.setBounds( 5, 6, 12, 11, 10, 13 );
rh.renderBlock( x, y, z, renderer );
renderLights( x, y, z, rh, renderer );
this.renderLights( x, y, z, rh, renderer );
}
@Override
@@ -377,7 +377,7 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
try
{
proxy.getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE );
this.proxy.getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE );
}
catch (GridAccessException e)
{
@@ -59,49 +59,49 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
public PartP2PTunnelME(ItemStack is) {
super( is );
proxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL );
outerProxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.CANNOT_CARRY_COMPRESSED );
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL );
this.outerProxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.CANNOT_CARRY_COMPRESSED );
}
@Override
public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile)
{
super.setPartHostInfo( side, host, tile );
outerProxy.setValidSides( EnumSet.of( side ) );
this.outerProxy.setValidSides( EnumSet.of( side ) );
}
@Override
public void readFromNBT(NBTTagCompound extra)
{
super.readFromNBT( extra );
outerProxy.readFromNBT( extra );
this.outerProxy.readFromNBT( extra );
}
@Override
public void writeToNBT(NBTTagCompound extra)
{
super.writeToNBT( extra );
outerProxy.writeToNBT( extra );
this.outerProxy.writeToNBT( extra );
}
@Override
public void addToWorld()
{
super.addToWorld();
outerProxy.onReady();
this.outerProxy.onReady();
}
@Override
public void removeFromWorld()
{
super.removeFromWorld();
outerProxy.invalidate();
this.outerProxy.invalidate();
}
@Override
public IGridNode getExternalFacingNode()
{
return outerProxy.getNode();
return this.outerProxy.getNode();
}
@Override
@@ -114,11 +114,11 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
public void onTunnelNetworkChange()
{
super.onTunnelNetworkChange();
if ( !output )
if ( !this.output )
{
try
{
proxy.getTick().wakeDevice( proxy.getNode() );
this.proxy.getTick().wakeDevice( this.proxy.getNode() );
}
catch (GridAccessException e)
{
@@ -139,24 +139,24 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
// just move on...
try
{
if ( !proxy.getPath().isNetworkBooting() )
if ( !this.proxy.getPath().isNetworkBooting() )
{
if ( !proxy.getEnergy().isNetworkPowered() )
if ( !this.proxy.getEnergy().isNetworkPowered() )
{
connection.markDestroy();
TickHandler.instance.addCallable( tile.getWorldObj(), connection );
this.connection.markDestroy();
TickHandler.instance.addCallable( this.tile.getWorldObj(), this.connection );
}
else
{
if ( proxy.isActive() )
if ( this.proxy.isActive() )
{
connection.markCreate();
TickHandler.instance.addCallable( tile.getWorldObj(), connection );
this.connection.markCreate();
TickHandler.instance.addCallable( this.tile.getWorldObj(), this.connection );
}
else
{
connection.markDestroy();
TickHandler.instance.addCallable( tile.getWorldObj(), connection );
this.connection.markDestroy();
TickHandler.instance.addCallable( this.tile.getWorldObj(), this.connection );
}
}
@@ -175,28 +175,28 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
public void onPlacement(EntityPlayer player, ItemStack held, ForgeDirection side)
{
super.onPlacement( player, held, side );
outerProxy.setOwner( player );
this.outerProxy.setOwner( player );
}
public void updateConnections(Connections connections)
{
if ( connections.destroy )
{
for (TunnelConnection cw : connection.connections.values())
for (TunnelConnection cw : this.connection.connections.values())
cw.c.destroy();
connection.connections.clear();
this.connection.connections.clear();
}
else if ( connections.create )
{
Iterator<TunnelConnection> i = connection.connections.values().iterator();
Iterator<TunnelConnection> i = this.connection.connections.values().iterator();
while (i.hasNext())
{
TunnelConnection cw = i.next();
try
{
if ( cw.tunnel.proxy.getGrid() != proxy.getGrid() )
if ( cw.tunnel.proxy.getGrid() != this.proxy.getGrid() )
{
cw.c.destroy();
i.remove();
@@ -216,7 +216,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
LinkedList<PartP2PTunnelME> newSides = new LinkedList<PartP2PTunnelME>();
try
{
for (PartP2PTunnelME me : getOutputs())
for (PartP2PTunnelME me : this.getOutputs())
{
if ( me.proxy.isActive() && connections.connections.get( me.getGridNode() ) == null )
{
@@ -229,7 +229,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
try
{
connections.connections.put( me.getGridNode(),
new TunnelConnection( me, AEApi.instance().createGridConnection( outerProxy.getNode(), me.outerProxy.getNode() ) ) );
new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) );
}
catch (FailedConnection e)
{
@@ -43,9 +43,9 @@ public class PartConversionMonitor extends PartStorageMonitor
public PartConversionMonitor(ItemStack is) {
super( PartConversionMonitor.class, is );
frontBright = CableBusTextures.PartConversionMonitor_Bright;
frontColored = CableBusTextures.PartConversionMonitor_Colored;
frontDark = CableBusTextures.PartConversionMonitor_Dark;
this.frontBright = CableBusTextures.PartConversionMonitor_Bright;
this.frontColored = CableBusTextures.PartConversionMonitor_Colored;
this.frontDark = CableBusTextures.PartConversionMonitor_Dark;
// frontSolid = CableBusTextures.PartConversionMonitor_Solid;
}
@@ -55,30 +55,30 @@ public class PartConversionMonitor extends PartStorageMonitor
if ( Platform.isClient() )
return true;
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return false;
if ( !Platform.hasPermissions( getLocation(), player ) )
if ( !Platform.hasPermissions( this.getLocation(), player ) )
return false;
boolean ModeB = false;
ItemStack item = player.getCurrentEquippedItem();
if ( item == null && getDisplayed() != null )
if ( item == null && this.getDisplayed() != null )
{
ModeB = true;
item = ((IAEItemStack) getDisplayed()).getItemStack();
item = ((IAEItemStack) this.getDisplayed()).getItemStack();
}
if ( item != null )
{
try
{
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return false;
IEnergySource energy = proxy.getEnergy();
IMEMonitor<IAEItemStack> cell = proxy.getStorage().getItemInventory();
IEnergySource energy = this.proxy.getEnergy();
IMEMonitor<IAEItemStack> cell = this.proxy.getStorage().getItemInventory();
IAEItemStack input = AEItemStack.create( item );
if ( ModeB )
@@ -112,16 +112,16 @@ public class PartConversionMonitor extends PartStorageMonitor
@Override
protected void extractItem(EntityPlayer player)
{
IAEItemStack input = (IAEItemStack) getDisplayed();
IAEItemStack input = (IAEItemStack) this.getDisplayed();
if ( input != null )
{
try
{
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return;
IEnergySource energy = proxy.getEnergy();
IMEMonitor<IAEItemStack> cell = proxy.getStorage().getItemInventory();
IEnergySource energy = this.proxy.getEnergy();
IMEMonitor<IAEItemStack> cell = this.proxy.getStorage().getItemInventory();
ItemStack is = input.getItemStack();
input.setStackSize( is.getMaxStackSize() );
@@ -134,9 +134,9 @@ public class PartConversionMonitor extends PartStorageMonitor
newItems = adaptor.addItems( newItems );
if ( newItems != null )
{
TileEntity te = tile;
TileEntity te = this.tile;
List<ItemStack> list = Collections.singletonList( newItems );
Platform.spawnDrops( player.worldObj, te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ, list );
Platform.spawnDrops( player.worldObj, te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ, list );
}
if ( player.openContainer != null )
@@ -38,14 +38,14 @@ public class PartCraftingTerminal extends PartTerminal
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
craftingGrid.writeToNBT( data, "craftingGrid" );
this.craftingGrid.writeToNBT( data, "craftingGrid" );
}
@Override
public void readFromNBT(NBTTagCompound data)
{
super.readFromNBT( data );
craftingGrid.readFromNBT( data, "craftingGrid" );
this.craftingGrid.readFromNBT( data, "craftingGrid" );
}
@Override
@@ -53,16 +53,16 @@ public class PartCraftingTerminal extends PartTerminal
{
super.getDrops(drops, wrenched);
for (ItemStack is : craftingGrid)
for (ItemStack is : this.craftingGrid)
if ( is != null )
drops.add( is );
}
public PartCraftingTerminal(ItemStack is) {
super( PartCraftingTerminal.class, is );
frontBright = CableBusTextures.PartCraftingTerm_Bright;
frontColored = CableBusTextures.PartCraftingTerm_Colored;
frontDark = CableBusTextures.PartCraftingTerm_Dark;
this.frontBright = CableBusTextures.PartCraftingTerm_Bright;
this.frontColored = CableBusTextures.PartCraftingTerm_Colored;
this.frontDark = CableBusTextures.PartCraftingTerm_Dark;
// frontSolid = CableBusTextures.PartCraftingTerm_Solid;
}
@@ -70,14 +70,14 @@ public class PartCraftingTerminal extends PartTerminal
public GuiBridge getGui( EntityPlayer p )
{
int x = (int) p.posX, y = (int) p.posY, z = (int) p.posZ;
if ( getHost().getTile() != null )
if ( this.getHost().getTile() != null )
{
x = tile.xCoord;
y = tile.yCoord;
z = tile.zCoord;
x = this.tile.xCoord;
y = this.tile.yCoord;
z = this.tile.zCoord;
}
if( GuiBridge.GUI_CRAFTING_TERMINAL.hasPermissions( getHost().getTile(), x, y, z, side, p ) )
if( GuiBridge.GUI_CRAFTING_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.side, p ) )
return GuiBridge.GUI_CRAFTING_TERMINAL;
return GuiBridge.GUI_ME;
}
@@ -85,14 +85,14 @@ public class PartCraftingTerminal extends PartTerminal
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
host.markForSave();
this.host.markForSave();
}
@Override
public IInventory getInventoryByName(String name)
{
if ( name.equals( "crafting" ) )
return craftingGrid;
return this.craftingGrid;
return super.getInventoryByName( name );
}
@@ -32,7 +32,7 @@ public class PartDarkMonitor extends PartMonitor
public PartDarkMonitor(ItemStack is) {
super( PartDarkMonitor.class, is, false );
notLightSource = false;
this.notLightSource = false;
}
@Override
@@ -42,11 +42,11 @@ public class PartDarkMonitor extends PartMonitor
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.renderInventoryBox( renderer );
rh.setInvColor( getColor().mediumVariant );
rh.renderInventoryFace( frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( this.getColor().mediumVariant );
rh.renderInventoryFace( this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderInventoryBox( renderer );
@@ -57,19 +57,19 @@ public class PartDarkMonitor extends PartMonitor
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
if ( getLightLevel() > 0 )
if ( this.getLightLevel() > 0 )
{
int l = 13;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
}
Tessellator.instance.setColorOpaque_I( getColor().mediumVariant );
rh.renderFace( x, y, z, frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( this.getColor().mediumVariant );
rh.renderFace( x, y, z, this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderBlock( x, y, z, renderer );
@@ -30,9 +30,9 @@ public class PartInterfaceTerminal extends PartMonitor
public PartInterfaceTerminal(ItemStack is) {
super( PartInterfaceTerminal.class, is, true );
frontBright = CableBusTextures.PartInterfaceTerm_Bright;
frontColored = CableBusTextures.PartInterfaceTerm_Colored;
frontDark = CableBusTextures.PartInterfaceTerm_Dark;
this.frontBright = CableBusTextures.PartInterfaceTerm_Bright;
this.frontColored = CableBusTextures.PartInterfaceTerm_Colored;
this.frontDark = CableBusTextures.PartInterfaceTerm_Dark;
}
@Override
@@ -45,7 +45,7 @@ public class PartInterfaceTerminal extends PartMonitor
if ( Platform.isClient() )
return true;
Platform.openGUI( player, getHost().getTile(), side, GuiBridge.GUI_INTERFACE_TERMINAL );
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_INTERFACE_TERMINAL );
return true;
}
@@ -71,17 +71,17 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
byte rotation = (byte) (MathHelper.floor_double( (player.rotationYaw * 4F) / 360F + 2.5D ) & 3);
if ( side == ForgeDirection.UP )
spin = rotation;
this.spin = rotation;
else if ( side == ForgeDirection.DOWN )
spin = rotation;
this.spin = rotation;
}
@Override
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
data.setFloat( "opacity", opacity );
data.setByte( "spin", spin );
data.setFloat( "opacity", this.opacity );
data.setByte( "spin", this.spin );
}
@Override
@@ -89,35 +89,35 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
{
super.readFromNBT( data );
if ( data.hasKey( "opacity" ) )
opacity = data.getFloat( "opacity" );
spin = data.getByte( "spin" );
this.opacity = data.getFloat( "opacity" );
this.spin = data.getByte( "spin" );
}
@Override
public boolean onPartActivate(EntityPlayer player, Vec3 pos)
{
TileEntity te = getTile();
TileEntity te = this.getTile();
if ( !player.isSneaking() && Platform.isWrench( player, player.inventory.getCurrentItem(), te.xCoord, te.yCoord, te.zCoord ) )
{
if ( Platform.isServer() )
{
if ( spin > 3 )
spin = 0;
if ( this.spin > 3 )
this.spin = 0;
switch (spin)
switch (this.spin)
{
case 0:
spin = 1;
this.spin = 1;
break;
case 1:
spin = 3;
this.spin = 3;
break;
case 2:
spin = 0;
this.spin = 0;
break;
case 3:
spin = 2;
this.spin = 2;
break;
}
@@ -133,56 +133,56 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
@MENetworkEventSubscribe
public void bootingRender(MENetworkBootingStatusChange c)
{
if ( notLightSource )
getHost().markForUpdate();
if ( this.notLightSource )
this.getHost().markForUpdate();
}
@Override
public void onNeighborChanged()
{
opacity = -1;
getHost().markForUpdate();
this.opacity = -1;
this.getHost().markForUpdate();
}
@MENetworkEventSubscribe
public void powerRender(MENetworkPowerStatusChange c)
{
getHost().markForUpdate();
this.getHost().markForUpdate();
}
@Override
public void writeToStream(ByteBuf data) throws IOException
{
super.writeToStream( data );
clientFlags = spin & 3;
this.clientFlags = this.spin & 3;
try
{
if ( proxy.getEnergy().isNetworkPowered() )
clientFlags = clientFlags | POWERED_FLAG;
if ( this.proxy.getEnergy().isNetworkPowered() )
this.clientFlags = this.clientFlags | this.POWERED_FLAG;
if ( proxy.getPath().isNetworkBooting() )
clientFlags = clientFlags | BOOTING_FLAG;
if ( this.proxy.getPath().isNetworkBooting() )
this.clientFlags = this.clientFlags | this.BOOTING_FLAG;
if ( proxy.getNode().meetsChannelRequirements() )
clientFlags = clientFlags | CHANNEL_FLAG;
if ( this.proxy.getNode().meetsChannelRequirements() )
this.clientFlags = this.clientFlags | this.CHANNEL_FLAG;
}
catch (GridAccessException e)
{
// um.. nothing.
}
data.writeByte( (byte) clientFlags );
data.writeByte( (byte) this.clientFlags );
}
@Override
public boolean readFromStream(ByteBuf data) throws IOException
{
super.readFromStream( data );
int oldFlags = clientFlags;
clientFlags = data.readByte();
spin = (byte) (clientFlags & 3);
if ( clientFlags == oldFlags )
int oldFlags = this.clientFlags;
this.clientFlags = data.readByte();
this.spin = (byte) (this.clientFlags & 3);
if ( this.clientFlags == oldFlags )
return false;
return true;
}
@@ -190,18 +190,18 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
@Override
public int getLightLevel()
{
return blockLight( isPowered() ? (notLightSource ? 9 : 15) : 0 );
return this.blockLight( this.isPowered() ? (this.notLightSource ? 9 : 15) : 0 );
}
private int blockLight(int emit)
{
if ( opacity < 0 )
if ( this.opacity < 0 )
{
TileEntity te = this.getTile();
opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + side.offsetX, te.yCoord + side.offsetY, te.zCoord + side.offsetZ );
this.opacity = 255 - te.getWorldObj().getBlockLightOpacity( te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ );
}
return (int) (emit * (opacity / 255.0f));
return (int) (emit * (this.opacity / 255.0f));
}
@Override
@@ -210,9 +210,9 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
try
{
if ( Platform.isServer() )
return proxy.getEnergy().isNetworkPowered();
return this.proxy.getEnergy().isNetworkPowered();
else
return ((clientFlags & POWERED_FLAG) == POWERED_FLAG);
return ((this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG);
}
catch (GridAccessException e)
{
@@ -229,11 +229,11 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
if ( requireChannel )
{
proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
proxy.setIdlePowerUsage( 1.0 / 2.0 );
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
this.proxy.setIdlePowerUsage( 1.0 / 2.0 );
}
else
proxy.setIdlePowerUsage( 1.0 / 16.0 ); // lights drain a little bit.
this.proxy.setIdlePowerUsage( 1.0 / 16.0 ); // lights drain a little bit.
}
@@ -244,17 +244,17 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.renderInventoryBox( renderer );
rh.setInvColor( getColor().whiteVariant );
rh.renderInventoryFace( frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( this.getColor().whiteVariant );
rh.renderInventoryFace( this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( getColor().mediumVariant );
rh.renderInventoryFace( frontDark.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( this.getColor().mediumVariant );
rh.renderInventoryFace( this.frontDark.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( getColor().blackVariant );
rh.renderInventoryFace( frontColored.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setInvColor( this.getColor().blackVariant );
rh.renderInventoryFace( this.frontColored.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderInventoryBox( renderer );
@@ -264,15 +264,15 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimplifiedRendering( x, y, z, this, renderCache );
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
if ( getLightLevel() > 0 )
if ( this.getLightLevel() > 0 )
{
int l = 13;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
@@ -280,43 +280,43 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = this.spin;
Tessellator.instance.setColorOpaque_I( getColor().whiteVariant );
rh.renderFace( x, y, z, frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( this.getColor().whiteVariant );
rh.renderFace( x, y, z, this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( getColor().mediumVariant );
rh.renderFace( x, y, z, frontDark.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( this.getColor().mediumVariant );
rh.renderFace( x, y, z, this.frontDark.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( getColor().blackVariant );
rh.renderFace( x, y, z, frontColored.getIcon(), ForgeDirection.SOUTH, renderer );
Tessellator.instance.setColorOpaque_I( this.getColor().blackVariant );
rh.renderFace( x, y, z, this.frontColored.getIcon(), ForgeDirection.SOUTH, renderer );
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
if ( notLightSource )
if ( this.notLightSource )
{
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(),
CableBusTextures.PartMonitorSidesStatus.getIcon() );
}
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderBlock( x, y, z, renderer );
if ( notLightSource )
if ( this.notLightSource )
{
boolean hasChan = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG);
boolean hasPower = (clientFlags & POWERED_FLAG) == POWERED_FLAG;
boolean hasChan = (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG);
boolean hasPower = (this.clientFlags & this.POWERED_FLAG) == this.POWERED_FLAG;
if ( hasChan )
{
int l = 14;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
Tessellator.instance.setColorOpaque_I( getColor().blackVariant );
Tessellator.instance.setColorOpaque_I( this.getColor().blackVariant );
}
else if ( hasPower )
{
int l = 9;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
Tessellator.instance.setColorOpaque_I( getColor().whiteVariant );
Tessellator.instance.setColorOpaque_I( this.getColor().whiteVariant );
}
else
{
@@ -342,10 +342,10 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
@Override
public boolean isActive()
{
if ( notLightSource )
return ((clientFlags & (CHANNEL_FLAG | POWERED_FLAG)) == (CHANNEL_FLAG | POWERED_FLAG));
if ( this.notLightSource )
return ((this.clientFlags & (this.CHANNEL_FLAG | this.POWERED_FLAG)) == (this.CHANNEL_FLAG | this.POWERED_FLAG));
else
return isPowered();
return this.isPowered();
}
}
@@ -45,49 +45,49 @@ public class PartPatternTerminal extends PartTerminal
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
data.setBoolean( "craftingMode", isCraftingRecipe() );
pattern.writeToNBT( data, "pattern" );
output.writeToNBT( data, "outputList" );
crafting.writeToNBT( data, "craftingGrid" );
data.setBoolean( "craftingMode", this.isCraftingRecipe() );
this.pattern.writeToNBT( data, "pattern" );
this.output.writeToNBT( data, "outputList" );
this.crafting.writeToNBT( data, "craftingGrid" );
}
@Override
public void readFromNBT(NBTTagCompound data)
{
super.readFromNBT( data );
setCraftingRecipe( data.getBoolean( "craftingMode" ) );
pattern.readFromNBT( data, "pattern" );
output.readFromNBT( data, "outputList" );
crafting.readFromNBT( data, "craftingGrid" );
this.setCraftingRecipe( data.getBoolean( "craftingMode" ) );
this.pattern.readFromNBT( data, "pattern" );
this.output.readFromNBT( data, "outputList" );
this.crafting.readFromNBT( data, "craftingGrid" );
}
@Override
public void getDrops(List<ItemStack> drops, boolean wrenched)
{
for (ItemStack is : pattern)
for (ItemStack is : this.pattern)
if ( is != null )
drops.add( is );
}
public PartPatternTerminal(ItemStack is) {
super( PartPatternTerminal.class, is );
frontBright = CableBusTextures.PartPatternTerm_Bright;
frontColored = CableBusTextures.PartPatternTerm_Colored;
frontDark = CableBusTextures.PartPatternTerm_Dark;
this.frontBright = CableBusTextures.PartPatternTerm_Bright;
this.frontColored = CableBusTextures.PartPatternTerm_Colored;
this.frontDark = CableBusTextures.PartPatternTerm_Dark;
}
@Override
public GuiBridge getGui( EntityPlayer p )
{
int x = (int) p.posX, y = (int) p.posY, z = (int) p.posZ;
if ( getHost().getTile() != null )
if ( this.getHost().getTile() != null )
{
x = tile.xCoord;
y = tile.yCoord;
z = tile.zCoord;
x = this.tile.xCoord;
y = this.tile.yCoord;
z = this.tile.zCoord;
}
if( GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions( getHost().getTile(), x, y, z, side, p ) )
if( GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.side, p ) )
return GuiBridge.GUI_PATTERN_TERMINAL;
return GuiBridge.GUI_ME;
}
@@ -96,13 +96,13 @@ public class PartPatternTerminal extends PartTerminal
public IInventory getInventoryByName(String name)
{
if ( name.equals( "crafting" ) )
return crafting;
return this.crafting;
if ( name.equals( "output" ) )
return output;
return this.output;
if ( name.equals( "pattern" ) )
return pattern;
return this.pattern;
return super.getInventoryByName( name );
}
@@ -110,57 +110,57 @@ public class PartPatternTerminal extends PartTerminal
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
if ( inv == pattern && slot == 1 )
if ( inv == this.pattern && slot == 1 )
{
ItemStack is = pattern.getStackInSlot( 1 );
ItemStack is = this.pattern.getStackInSlot( 1 );
if ( is != null && is.getItem() instanceof ICraftingPatternItem )
{
ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
ICraftingPatternDetails details = pattern.getPatternForItem( is, this.getHost().getTile().getWorldObj() );
if ( details != null )
{
setCraftingRecipe( details.isCraftable() );
this.setCraftingRecipe( details.isCraftable() );
for (int x = 0; x < crafting.getSizeInventory() && x < details.getInputs().length; x++)
for (int x = 0; x < this.crafting.getSizeInventory() && x < details.getInputs().length; x++)
{
IAEItemStack item = details.getInputs()[x];
crafting.setInventorySlotContents( x, item == null ? null : item.getItemStack() );
this.crafting.setInventorySlotContents( x, item == null ? null : item.getItemStack() );
}
for (int x = 0; x < output.getSizeInventory() && x < details.getOutputs().length; x++)
for (int x = 0; x < this.output.getSizeInventory() && x < details.getOutputs().length; x++)
{
IAEItemStack item = details.getOutputs()[x];
output.setInventorySlotContents( x, item == null ? null : item.getItemStack() );
this.output.setInventorySlotContents( x, item == null ? null : item.getItemStack() );
}
}
}
}
else if ( inv == crafting )
else if ( inv == this.crafting )
{
fixCraftingRecipes();
this.fixCraftingRecipes();
}
host.markForSave();
this.host.markForSave();
}
public boolean isCraftingRecipe()
{
return craftingMode;
return this.craftingMode;
}
public void setCraftingRecipe(boolean craftingMode)
{
this.craftingMode = craftingMode;
fixCraftingRecipes();
this.fixCraftingRecipes();
}
private void fixCraftingRecipes()
{
if ( isCraftingRecipe() )
if ( this.isCraftingRecipe() )
{
for (int x = 0; x < crafting.getSizeInventory(); x++)
for (int x = 0; x < this.crafting.getSizeInventory(); x++)
{
ItemStack is = crafting.getStackInSlot( x );
ItemStack is = this.crafting.getStackInSlot( x );
if ( is != null )
is.stackSize = 1;
}
@@ -32,7 +32,7 @@ public class PartSemiDarkMonitor extends PartMonitor
public PartSemiDarkMonitor(ItemStack is) {
super( PartSemiDarkMonitor.class, is,false );
notLightSource = false;
this.notLightSource = false;
}
@Override
@@ -42,14 +42,14 @@ public class PartSemiDarkMonitor extends PartMonitor
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.renderInventoryBox( renderer );
int light = getColor().whiteVariant;
int dark = getColor().mediumVariant;
int light = this.getColor().whiteVariant;
int dark = this.getColor().mediumVariant;
rh.setInvColor( (((((light >> 16) & 0xff) + ((dark >> 16) & 0xff)) / 2) << 16) | (((((light >> 8) & 0xff) + ((dark >> 8) & 0xff)) / 2) << 8)
| ((((light) & 0xff) + ((dark) & 0xff)) / 2) );
rh.renderInventoryFace( frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.renderInventoryFace( this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderInventoryBox( renderer );
@@ -60,22 +60,22 @@ public class PartSemiDarkMonitor extends PartMonitor
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
if ( getLightLevel() > 0 )
if ( this.getLightLevel() > 0 )
{
int l = 13;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
}
int light = getColor().whiteVariant;
int dark = getColor().mediumVariant;
int light = this.getColor().whiteVariant;
int dark = this.getColor().mediumVariant;
Tessellator.instance.setColorOpaque( (((light >> 16) & 0xff) + ((dark >> 16) & 0xff)) / 2, (((light >> 8) & 0xff) + ((dark >> 8) & 0xff)) / 2,
(((light) & 0xff) + ((dark) & 0xff)) / 2 );
rh.renderFace( x, y, z, frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.renderFace( x, y, z, this.frontBright.getIcon(), ForgeDirection.SOUTH, renderer );
rh.setBounds( 4, 4, 13, 12, 12, 14 );
rh.renderBlock( x, y, z, renderer );
@@ -72,11 +72,11 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
{
super.writeToNBT( data );
data.setBoolean( "isLocked", isLocked );
data.setBoolean( "isLocked", this.isLocked );
NBTTagCompound myItem = new NBTTagCompound();
if ( configuredItem != null )
configuredItem.writeToNBT( myItem );
if ( this.configuredItem != null )
this.configuredItem.writeToNBT( myItem );
data.setTag( "configuredItem", myItem );
}
@@ -86,10 +86,10 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
{
super.readFromNBT( data );
isLocked = data.getBoolean( "isLocked" );
this.isLocked = data.getBoolean( "isLocked" );
NBTTagCompound myItem = data.getCompoundTag( "configuredItem" );
configuredItem = AEItemStack.loadItemStackFromNBT( myItem );
this.configuredItem = AEItemStack.loadItemStackFromNBT( myItem );
}
@Override
@@ -97,11 +97,11 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
{
super.writeToStream( data );
data.writeByte( spin );
data.writeBoolean( isLocked );
data.writeBoolean( configuredItem != null );
if ( configuredItem != null )
configuredItem.writeToPacket( data );
data.writeByte( this.spin );
data.writeBoolean( this.isLocked );
data.writeBoolean( this.configuredItem != null );
if ( this.configuredItem != null )
this.configuredItem.writeToPacket( data );
}
@Override
@@ -109,15 +109,15 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
{
boolean stuff = super.readFromStream( data );
spin = data.readByte();
isLocked = data.readBoolean();
this.spin = data.readByte();
this.isLocked = data.readBoolean();
boolean val = data.readBoolean();
if ( val )
configuredItem = AEItemStack.loadItemStackFromPacket( data );
this.configuredItem = AEItemStack.loadItemStackFromPacket( data );
else
configuredItem = null;
this.configuredItem = null;
updateList = true;
this.updateList = true;
return stuff;
}
@@ -128,28 +128,28 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
if ( Platform.isClient() )
return true;
if ( !proxy.isActive() )
if ( !this.proxy.isActive() )
return false;
if ( !Platform.hasPermissions( getLocation(), player ) )
if ( !Platform.hasPermissions( this.getLocation(), player ) )
return false;
TileEntity te = this.tile;
ItemStack eq = player.getCurrentEquippedItem();
if ( Platform.isWrench( player, eq, te.xCoord, te.yCoord, te.zCoord ) )
{
isLocked = !isLocked;
player.addChatMessage( (isLocked ? PlayerMessages.isNowLocked : PlayerMessages.isNowUnlocked).get() );
this.isLocked = !this.isLocked;
player.addChatMessage( (this.isLocked ? PlayerMessages.isNowLocked : PlayerMessages.isNowUnlocked).get() );
this.getHost().markForUpdate();
}
else if ( !isLocked )
else if ( !this.isLocked )
{
configuredItem = AEItemStack.create( eq );
configureWatchers();
this.configuredItem = AEItemStack.create( eq );
this.configureWatchers();
this.getHost().markForUpdate();
}
else
extractItem( player );
this.extractItem( player );
return true;
}
@@ -165,9 +165,9 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
public PartStorageMonitor(ItemStack is) {
super( PartStorageMonitor.class, is, true );
frontBright = CableBusTextures.PartStorageMonitor_Bright;
frontColored = CableBusTextures.PartStorageMonitor_Colored;
frontDark = CableBusTextures.PartStorageMonitor_Dark;
this.frontBright = CableBusTextures.PartStorageMonitor_Bright;
this.frontColored = CableBusTextures.PartStorageMonitor_Colored;
this.frontDark = CableBusTextures.PartStorageMonitor_Dark;
// frontSolid = CableBusTextures.PartStorageMonitor_Solid;
}
@@ -188,39 +188,39 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
protected void finalize() throws Throwable
{
super.finalize();
if ( dspList != null )
GLAllocation.deleteDisplayLists( dspList );
if ( this.dspList != null )
GLAllocation.deleteDisplayLists( this.dspList );
}
@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer)
{
if ( dspList == null )
dspList = GLAllocation.generateDisplayLists( 1 );
if ( this.dspList == null )
this.dspList = GLAllocation.generateDisplayLists( 1 );
Tessellator tess = Tessellator.instance;
if ( Platform.isDrawing( tess ) )
return;
if ( (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) != (POWERED_FLAG | CHANNEL_FLAG) )
if ( (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) != (this.POWERED_FLAG | this.CHANNEL_FLAG) )
return;
IAEItemStack ais = (IAEItemStack) getDisplayed();
IAEItemStack ais = (IAEItemStack) this.getDisplayed();
if ( ais != null )
{
GL11.glPushMatrix();
GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 );
if ( updateList )
if ( this.updateList )
{
updateList = false;
GL11.glNewList( dspList, GL11.GL_COMPILE_AND_EXECUTE );
tesrRenderScreen( tess, ais );
this.updateList = false;
GL11.glNewList( this.dspList, GL11.GL_COMPILE_AND_EXECUTE );
this.tesrRenderScreen( tess, ais );
GL11.glEndList();
}
else
GL11.glCallList( dspList );
GL11.glCallList( this.dspList );
GL11.glPopMatrix();
}
@@ -229,21 +229,21 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
private void tesrRenderScreen(Tessellator tess, IAEItemStack ais)
{
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
ForgeDirection d = side;
ForgeDirection d = this.side;
GL11.glTranslated( d.offsetX * 0.77, d.offsetY * 0.77, d.offsetZ * 0.77 );
if ( d == ForgeDirection.UP )
{
GL11.glScalef( 1.0f, -1.0f, 1.0f );
GL11.glRotatef( 90.0f, 1.0f, 0.0f, 0.0f );
GL11.glRotatef( spin * 90.0F, 0, 0, 1 );
GL11.glRotatef( this.spin * 90.0F, 0, 0, 1 );
}
if ( d == ForgeDirection.DOWN )
{
GL11.glScalef( 1.0f, -1.0f, 1.0f );
GL11.glRotatef( -90.0f, 1.0f, 0.0f, 0.0f );
GL11.glRotatef( spin * -90.0F, 0, 0, 1 );
GL11.glRotatef( this.spin * -90.0F, 0, 0, 1 );
}
if ( d == ForgeDirection.EAST )
@@ -323,13 +323,13 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
@Override
public IAEStack getDisplayed()
{
return configuredItem;
return this.configuredItem;
}
@Override
public boolean isLocked()
{
return isLocked;
return this.isLocked;
}
IStackWatcher myWatcher;
@@ -337,24 +337,24 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
@Override
public void updateWatcher(IStackWatcher newWatcher)
{
myWatcher = newWatcher;
configureWatchers();
this.myWatcher = newWatcher;
this.configureWatchers();
}
// update the system...
public void configureWatchers()
{
if ( myWatcher != null )
myWatcher.clear();
if ( this.myWatcher != null )
this.myWatcher.clear();
try
{
if ( configuredItem != null )
if ( this.configuredItem != null )
{
if ( myWatcher != null )
myWatcher.add( configuredItem );
if ( this.myWatcher != null )
this.myWatcher.add( this.configuredItem );
updateReportingValue( proxy.getStorage().getItemInventory() );
this.updateReportingValue( this.proxy.getStorage().getItemInventory() );
}
}
catch (GridAccessException e)
@@ -365,27 +365,27 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
private void updateReportingValue(IMEMonitor<IAEItemStack> itemInventory)
{
if ( configuredItem != null )
if ( this.configuredItem != null )
{
IAEItemStack result = itemInventory.getStorageList().findPrecise( configuredItem );
IAEItemStack result = itemInventory.getStorageList().findPrecise( this.configuredItem );
if ( result == null )
configuredItem.setStackSize( 0 );
this.configuredItem.setStackSize( 0 );
else
configuredItem.setStackSize( result.getStackSize() );
this.configuredItem.setStackSize( result.getStackSize() );
}
}
@Override
public void onStackChange(IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan)
{
if ( configuredItem != null )
if ( this.configuredItem != null )
{
if ( fullStack == null )
configuredItem.setStackSize( 0 );
this.configuredItem.setStackSize( 0 );
else
configuredItem.setStackSize( fullStack.getStackSize() );
this.configuredItem.setStackSize( fullStack.getStackSize() );
getHost().markForUpdate();
this.getHost().markForUpdate();
}
}
@@ -52,9 +52,9 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
public PartTerminal(Class clz, ItemStack is) {
super( clz, is, true );
cm.registerSetting( Settings.SORT_BY, SortOrder.NAME );
cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
this.cm.registerSetting( Settings.SORT_BY, SortOrder.NAME );
this.cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
this.cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
}
@Override
@@ -62,7 +62,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
{
super.getDrops( drops, wrenched );
for (ItemStack is : viewCell)
for (ItemStack is : this.viewCell)
if ( is != null )
drops.add( is );
}
@@ -71,28 +71,28 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
public void readFromNBT(NBTTagCompound data)
{
super.readFromNBT( data );
cm.readFromNBT( data );
viewCell.readFromNBT( data, "viewCell" );
this.cm.readFromNBT( data );
this.viewCell.readFromNBT( data, "viewCell" );
}
@Override
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT( data );
cm.writeToNBT( data );
viewCell.writeToNBT( data, "viewCell" );
this.cm.writeToNBT( data );
this.viewCell.writeToNBT( data, "viewCell" );
}
public PartTerminal(ItemStack is) {
super( PartTerminal.class, is, true );
frontBright = CableBusTextures.PartTerminal_Bright;
frontColored = CableBusTextures.PartTerminal_Colored;
frontDark = CableBusTextures.PartTerminal_Dark;
this.frontBright = CableBusTextures.PartTerminal_Bright;
this.frontColored = CableBusTextures.PartTerminal_Colored;
this.frontDark = CableBusTextures.PartTerminal_Dark;
// frontSolid = CableBusTextures.PartTerminal_Solid;
cm.registerSetting( Settings.SORT_BY, SortOrder.NAME );
cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
this.cm.registerSetting( Settings.SORT_BY, SortOrder.NAME );
this.cm.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
this.cm.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
}
public GuiBridge getGui( EntityPlayer player )
@@ -110,7 +110,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
if ( Platform.isClient() )
return true;
Platform.openGUI( player, getHost().getTile(), side, getGui( player ) );
Platform.openGUI( player, this.getHost().getTile(), this.side, this.getGui( player ) );
return true;
}
@@ -123,7 +123,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
{
try
{
return proxy.getStorage().getFluidInventory();
return this.proxy.getStorage().getFluidInventory();
}
catch (GridAccessException e)
{
@@ -137,7 +137,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
{
try
{
return proxy.getStorage().getItemInventory();
return this.proxy.getStorage().getItemInventory();
}
catch (GridAccessException e)
{
@@ -149,7 +149,7 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
@Override
public IConfigManager getConfigManager()
{
return cm;
return this.cm;
}
@Override
@@ -161,12 +161,12 @@ public class PartTerminal extends PartMonitor implements ITerminalHost, IConfigM
@Override
public IInventory getViewCellStorage()
{
return viewCell;
return this.viewCell;
}
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
{
host.markForSave();
this.host.markForSave();
}
}