Changed access to use this qualifier
This commit is contained in:
@@ -26,7 +26,7 @@ public class ConnectionWrapper
|
||||
public IGridConnection connection;
|
||||
|
||||
public ConnectionWrapper(IGridConnection gc) {
|
||||
connection = gc;
|
||||
this.connection = gc;
|
||||
}
|
||||
|
||||
}
|
||||
+6
-6
@@ -34,27 +34,27 @@ public class Connections implements Callable
|
||||
public boolean destroy = false;
|
||||
|
||||
public Connections(PartP2PTunnelME o) {
|
||||
me = o;
|
||||
this.me = o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call() throws Exception
|
||||
{
|
||||
me.updateConnections( this );
|
||||
this.me.updateConnections( this );
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void markDestroy()
|
||||
{
|
||||
create = false;
|
||||
destroy = true;
|
||||
this.create = false;
|
||||
this.destroy = true;
|
||||
}
|
||||
|
||||
public void markCreate()
|
||||
{
|
||||
create = true;
|
||||
destroy = false;
|
||||
this.create = true;
|
||||
this.destroy = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+21
-21
@@ -40,54 +40,54 @@ public class TickTracker implements Comparable<TickTracker>
|
||||
public int current_rate;
|
||||
|
||||
public TickTracker(TickingRequest req, IGridNode node, IGridTickable gt, long currentTick, TickManagerCache tickManagerCache) {
|
||||
request = req;
|
||||
this.request = req;
|
||||
this.gt = gt;
|
||||
this.node = node;
|
||||
current_rate = (req.minTickRate + req.maxTickRate) / 2;
|
||||
lastTick = currentTick;
|
||||
host = tickManagerCache;
|
||||
this.current_rate = (req.minTickRate + req.maxTickRate) / 2;
|
||||
this.lastTick = currentTick;
|
||||
this.host = tickManagerCache;
|
||||
}
|
||||
|
||||
public long getAvgNanos()
|
||||
{
|
||||
return (LastFiveTicksTime / 5);
|
||||
return (this.LastFiveTicksTime / 5);
|
||||
}
|
||||
|
||||
public void setRate(int rate)
|
||||
{
|
||||
current_rate = rate;
|
||||
this.current_rate = rate;
|
||||
|
||||
if ( current_rate < request.minTickRate )
|
||||
current_rate = request.minTickRate;
|
||||
if ( this.current_rate < this.request.minTickRate )
|
||||
this.current_rate = this.request.minTickRate;
|
||||
|
||||
if ( current_rate > request.maxTickRate )
|
||||
current_rate = request.maxTickRate;
|
||||
if ( this.current_rate > this.request.maxTickRate )
|
||||
this.current_rate = this.request.maxTickRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TickTracker t)
|
||||
{
|
||||
int nextTick = (int) ((lastTick - host.getCurrentTick()) + current_rate);
|
||||
int ts_nextTick = (int) ((t.lastTick - host.getCurrentTick()) + t.current_rate);
|
||||
int nextTick = (int) ((this.lastTick - this.host.getCurrentTick()) + this.current_rate);
|
||||
int ts_nextTick = (int) ((t.lastTick - this.host.getCurrentTick()) + t.current_rate);
|
||||
return nextTick - ts_nextTick;
|
||||
}
|
||||
|
||||
public void addEntityCrashInfo(CrashReportCategory crashreportcategory)
|
||||
{
|
||||
if ( gt instanceof AEBasePart )
|
||||
if ( this.gt instanceof AEBasePart )
|
||||
{
|
||||
AEBasePart part = (AEBasePart)gt;
|
||||
AEBasePart part = (AEBasePart)this.gt;
|
||||
part.addEntityCrashInfo( crashreportcategory );
|
||||
}
|
||||
|
||||
crashreportcategory.addCrashSection( "CurrentTickRate", current_rate );
|
||||
crashreportcategory.addCrashSection( "MinTickRate", request.minTickRate );
|
||||
crashreportcategory.addCrashSection( "MaxTickRate", request.maxTickRate );
|
||||
crashreportcategory.addCrashSection( "MachineType", gt.getClass().getName() );
|
||||
crashreportcategory.addCrashSection( "GridBlockType", node.getGridBlock().getClass().getName() );
|
||||
crashreportcategory.addCrashSection( "ConnectedSides", node.getConnectedSides() );
|
||||
crashreportcategory.addCrashSection( "CurrentTickRate", this.current_rate );
|
||||
crashreportcategory.addCrashSection( "MinTickRate", this.request.minTickRate );
|
||||
crashreportcategory.addCrashSection( "MaxTickRate", this.request.maxTickRate );
|
||||
crashreportcategory.addCrashSection( "MachineType", this.gt.getClass().getName() );
|
||||
crashreportcategory.addCrashSection( "GridBlockType", this.node.getGridBlock().getClass().getName() );
|
||||
crashreportcategory.addCrashSection( "ConnectedSides", this.node.getConnectedSides() );
|
||||
|
||||
DimensionalCoord dc = node.getGridBlock().getLocation();
|
||||
DimensionalCoord dc = this.node.getGridBlock().getLocation();
|
||||
if ( dc != null )
|
||||
crashreportcategory.addCrashSection( "Location", dc );
|
||||
}
|
||||
|
||||
@@ -31,35 +31,35 @@ public class TunnelCollection<T extends PartP2PTunnel> implements Iterable<T>
|
||||
Collection<T> tunnelSources;
|
||||
|
||||
public TunnelCollection(Collection<T> src, Class c) {
|
||||
tunnelSources = src;
|
||||
clz = c;
|
||||
this.tunnelSources = src;
|
||||
this.clz = c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<T> iterator()
|
||||
{
|
||||
if ( tunnelSources == null )
|
||||
if ( this.tunnelSources == null )
|
||||
return new NullIterator<T>();
|
||||
return new TunnelIterator<T>( tunnelSources, clz );
|
||||
return new TunnelIterator<T>( this.tunnelSources, this.clz );
|
||||
}
|
||||
|
||||
public void setSource(Collection<T> c)
|
||||
{
|
||||
tunnelSources = c;
|
||||
this.tunnelSources = c;
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return !iterator().hasNext();
|
||||
return !this.iterator().hasNext();
|
||||
}
|
||||
|
||||
public boolean matches(Class<? extends PartP2PTunnel> c)
|
||||
{
|
||||
return clz == c;
|
||||
return this.clz == c;
|
||||
}
|
||||
|
||||
public Class<? extends PartP2PTunnel> getClz()
|
||||
{
|
||||
return clz;
|
||||
return this.clz;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class TunnelConnection
|
||||
final public IGridConnection c;
|
||||
|
||||
public TunnelConnection(PartP2PTunnelME t, IGridConnection con) {
|
||||
tunnel = t;
|
||||
c = con;
|
||||
this.tunnel = t;
|
||||
this.c = con;
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -32,32 +32,32 @@ public class TunnelIterator<T extends PartP2PTunnel> implements Iterator<T>
|
||||
|
||||
private void findNext()
|
||||
{
|
||||
while (Next == null && wrapped.hasNext())
|
||||
while (this.Next == null && this.wrapped.hasNext())
|
||||
{
|
||||
Next = wrapped.next();
|
||||
if ( !targetType.isInstance( Next ) )
|
||||
Next = null;
|
||||
this.Next = this.wrapped.next();
|
||||
if ( !this.targetType.isInstance( this.Next ) )
|
||||
this.Next = null;
|
||||
}
|
||||
}
|
||||
|
||||
public TunnelIterator(Collection<T> tunnelSources, Class clz) {
|
||||
wrapped = tunnelSources.iterator();
|
||||
targetType = clz;
|
||||
findNext();
|
||||
this.wrapped = tunnelSources.iterator();
|
||||
this.targetType = clz;
|
||||
this.findNext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext()
|
||||
{
|
||||
findNext();
|
||||
return Next != null;
|
||||
this.findNext();
|
||||
return this.Next != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T next()
|
||||
{
|
||||
T tmp = Next;
|
||||
Next = null;
|
||||
T tmp = this.Next;
|
||||
this.Next = null;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user