From 1865eaa8cb8fe38209fcffc23d7ba0d968d2e11a Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 19 Apr 2020 22:04:39 +0200 Subject: [PATCH] fixed node caches not being invalidated correctly for small networks --- src/main/java/de/ellpeck/prettypipes/network/PipeNetwork.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/de/ellpeck/prettypipes/network/PipeNetwork.java b/src/main/java/de/ellpeck/prettypipes/network/PipeNetwork.java index feeaa50..3e349be 100644 --- a/src/main/java/de/ellpeck/prettypipes/network/PipeNetwork.java +++ b/src/main/java/de/ellpeck/prettypipes/network/PipeNetwork.java @@ -295,6 +295,10 @@ public class PipeNetwork implements ICapabilitySerializable, GraphL public void clearDestinationCache(BlockPos... nodes) { 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.endProfile(); }