mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-20 12:19:55 +00:00
Fixed spamming of block updates when a conduits neighbor changes.
This commit is contained in:
1 parent
a8c59bf2f9
commit
0d8eb92a10
1 file changed
+24
-6
@@ -445,9 +445,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
@Override
|
||||
public boolean onNeighborBlockChange(Block block) {
|
||||
// Check for changes to external connections, connections to conduits are
|
||||
// handled by the bundle
|
||||
|
||||
|
||||
// NB: No need to check externals if the neighbour that changed was a
|
||||
// conduit bundle as this
|
||||
// can't effect external connections.
|
||||
@@ -455,9 +453,29 @@ public abstract class AbstractConduit implements IConduit {
|
||||
return false;
|
||||
}
|
||||
|
||||
connectionsDirty = true;
|
||||
|
||||
return true;
|
||||
// Check for changes to external connections, connections to conduits are
|
||||
// handled by the bundle
|
||||
Set<ForgeDirection> newCons = new HashSet<ForgeDirection>();
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if(!containsConduitConnection(dir) && canConnectToExternal(dir, false)) {
|
||||
newCons.add(dir);
|
||||
}
|
||||
}
|
||||
if(newCons.size() != externalConnections.size()) {
|
||||
connectionsDirty = true;
|
||||
return true;
|
||||
}
|
||||
for(ForgeDirection dir : externalConnections) {
|
||||
if(!newCons.remove(dir)) {
|
||||
connectionsDirty = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(!newCons.isEmpty()) {
|
||||
connectionsDirty = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user