mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-22 19:58:35 +01:00
fixed node caches not being invalidated correctly for small networks
This commit is contained in:
parent
34f037a8fd
commit
1865eaa8cb
1 changed files with 4 additions and 0 deletions
|
@ -295,6 +295,10 @@ public class PipeNetwork implements ICapabilitySerializable<CompoundNBT>, GraphL
|
||||||
|
|
||||||
public void clearDestinationCache(BlockPos... nodes) {
|
public void clearDestinationCache(BlockPos... nodes) {
|
||||||
this.startProfile("clear_node_cache");
|
this.startProfile("clear_node_cache");
|
||||||
|
// remove caches for the nodes
|
||||||
|
for(BlockPos node : nodes)
|
||||||
|
this.nodeToConnectedNodes.keySet().remove(node);
|
||||||
|
// remove caches that contain the node as a destination
|
||||||
this.nodeToConnectedNodes.values().removeIf(cached -> Arrays.stream(nodes).anyMatch(cached::contains));
|
this.nodeToConnectedNodes.values().removeIf(cached -> Arrays.stream(nodes).anyMatch(cached::contains));
|
||||||
this.endProfile();
|
this.endProfile();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue