diff --git a/src/main/java/com/gregtechceu/gtceu/utils/BreadthFirstBlockSearch.java b/src/main/java/com/gregtechceu/gtceu/utils/BreadthFirstBlockSearch.java index 9addc412d4..2c098b9c6a 100644 --- a/src/main/java/com/gregtechceu/gtceu/utils/BreadthFirstBlockSearch.java +++ b/src/main/java/com/gregtechceu/gtceu/utils/BreadthFirstBlockSearch.java @@ -18,7 +18,7 @@ public class BreadthFirstBlockSearch { public static Set search(Predicate value, BlockPos start, int limit) { Set alreadyVisited = new HashSet<>(); - Set valid = new HashSet<>(); + Set valid = new LinkedHashSet<>(); int iteration = 0; Queue queue = new ArrayDeque<>(); @@ -58,7 +58,7 @@ public static Set conditionalBlockEntitySearch(Class< var level = start.getLevel(); if (level == null) return Set.of(); - var passed = new HashSet(); + var passed = new LinkedHashSet(); var queue = new ObjectArrayFIFOQueue>(16); queue.enqueue(new ImmutableTriple<>(null, start, null)); @@ -87,7 +87,7 @@ public static Set conditionalBlockEntitySearch(Class< public static Set conditionalBlockPosSearch(BlockPos start, BiPredicate condition, int blockLimit, int iterationLimit) { - var passed = new HashSet(); + var passed = new LinkedHashSet(); var queue = new ObjectArrayFIFOQueue>(16); queue.enqueue(new Tuple<>(null, start));