mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 09:34:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a1ee81780 | ||
|
|
1fd7ae7567 |
No files matched your search
@@ -84,6 +84,16 @@ public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
protected boolean connectionsDirty = true;
|
||||
|
||||
/**
|
||||
* This shows if the currently running connection update should not finish with settings connectionsDirty to false.
|
||||
* If this is true, it will trigger a reconnection on the next Tick.
|
||||
* <p>
|
||||
* Use the method needUpdateConnections() instead of setting this to true.
|
||||
*
|
||||
* @see needUpdateConnections()
|
||||
*/
|
||||
protected boolean needUpdateConnections = false;
|
||||
|
||||
protected AbstractConduit() {}
|
||||
|
||||
@Override
|
||||
@@ -461,7 +471,24 @@ public abstract class AbstractConduit implements IConduit {
|
||||
connectionsChanged();
|
||||
}
|
||||
|
||||
connectionsDirty = false;
|
||||
if (needUpdateConnections) {
|
||||
// Seems the update was not successfull, let's try on the next Tick.
|
||||
needUpdateConnections = false;
|
||||
} else {
|
||||
connectionsDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method prevents connection update from getting completed successfully by not settings connectionsDirty to
|
||||
* false. This will trigger an connection update at the next Tick.
|
||||
* <p>
|
||||
* Only use this while executing updateConnections().
|
||||
* <p>
|
||||
* See this PR for more info: https://github.com/GTNewHorizons/EnderIO/pull/111
|
||||
*/
|
||||
protected void needUpdateConnections() {
|
||||
needUpdateConnections = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -175,7 +175,8 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
node = part.getGridNode();
|
||||
}
|
||||
if (node == null) {
|
||||
return !isDenseUltra();
|
||||
// The GridNode has not been initialized yet, let's try on the next Tick.
|
||||
needUpdateConnections();
|
||||
}
|
||||
}
|
||||
} else if (te instanceof IGridHost) {
|
||||
|
||||
Reference in new issue
Block a user