Sync up rv0 branch fixes into rv1

This commit is contained in:
AlgorithmX2
2014-07-08 19:36:20 -05:00
18 changed files with 124 additions and 51 deletions
+2 -2
View File
@@ -286,7 +286,7 @@ public class GridNode implements IGridNode, IPathItem
}
catch (FailedConnection e)
{
TickHandler.instance.addCallable( new Callable() {
TickHandler.instance.addCallable( node.getWorld(), new Callable() {
@Override
public Object call() throws Exception
@@ -321,7 +321,7 @@ public class GridNode implements IGridNode, IPathItem
}
catch (FailedConnection e)
{
TickHandler.instance.addCallable( new Callable() {
TickHandler.instance.addCallable( node.getWorld(), new Callable() {
@Override
public Object call() throws Exception
+6
View File
@@ -113,8 +113,14 @@ public class TickManagerCache implements ITickManager
sleeping.remove( node );
awake.put( node, tt );
// configure sort.
tt.lastTick = tt.lastTick - tt.request.maxTickRate;
tt.current_rate = tt.request.minTickRate;
// prevent dupes and tick build up.
upcomingTicks.remove( tt );
upcomingTicks.add( tt );
return true;
}
+18 -9
View File
@@ -25,6 +25,7 @@ public class StorageInterestManager {
private final SetMultimap<IAEStack, ItemWatcher> container;
private LinkedList<SavedTransactions> transactions = null;
private int transDepth=0;
public StorageInterestManager(SetMultimap<IAEStack, ItemWatcher> interests) {
container = interests;
@@ -32,20 +33,28 @@ public class StorageInterestManager {
public void enableTransactions()
{
transactions = new LinkedList();
if ( transDepth == 0 )
transactions = new LinkedList();
transDepth++;
}
public void disableTransactions()
{
LinkedList<SavedTransactions> myActions = transactions;
transactions = null;
for ( SavedTransactions t : myActions )
transDepth--;
if ( transDepth == 0 )
{
if ( t.put )
put( t.stack, t.iw );
else
remove( t.stack, t.iw );
LinkedList<SavedTransactions> myActions = transactions;
transactions = null;
for ( SavedTransactions t : myActions )
{
if ( t.put )
put( t.stack, t.iw );
else
remove( t.stack, t.iw );
}
}
}