Compare commits

..
1 Commits
Author SHA1 Message Date
Pilzinsel64 a6d5d3890b imrpove canConnectToExternal() 2023-03-21 20:43:29 +01:00
2 changed files with 2 additions and 33 deletions

No files matched your search

@@ -84,18 +84,6 @@ 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()
*/
private boolean needUpdateConnections = false;
private boolean isUpdatingConnections = false;
protected AbstractConduit() {}
@Override
@@ -446,13 +434,10 @@ public abstract class AbstractConduit implements IConduit {
}
private void updateConnections() {
if (!connectionsDirty && !needUpdateConnections) {
if (!connectionsDirty) {
return;
}
isUpdatingConnections = true;
needUpdateConnections = false;
boolean externalConnectionsChanged = false;
List<ForgeDirection> copy = new ArrayList<ForgeDirection>(externalConnections);
// remove any no longer valid connections
@@ -477,21 +462,6 @@ public abstract class AbstractConduit implements IConduit {
}
connectionsDirty = false;
isUpdatingConnections = 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() {
if (isUpdatingConnections) {
needUpdateConnections = true;
}
}
@Override
@@ -175,8 +175,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
node = part.getGridNode();
}
if (node == null) {
// The GridNode has not been initialized yet, let's try on the next Tick.
needUpdateConnections();
return !isDenseUltra();
}
}
} else if (te instanceof IGridHost) {