diff --git a/common/src/main/kotlin/quaedam/projection/swarm/ai/NearestVisibleContainer.kt b/common/src/main/kotlin/quaedam/projection/swarm/ai/NearestVisibleContainer.kt index ceb5b45..b83718b 100644 --- a/common/src/main/kotlin/quaedam/projection/swarm/ai/NearestVisibleContainer.kt +++ b/common/src/main/kotlin/quaedam/projection/swarm/ai/NearestVisibleContainer.kt @@ -36,7 +36,7 @@ class NearestVisibleContainer : Sensor() { .flatMap { it.blockEntities.filterValues { be -> be is BaseContainerBlockEntity }.keys } .sortedBy { it.distManhattan(entity.blockPosition()) / 5 } .shuffled(Random(System.currentTimeMillis() / 10000)) - .first() + .firstOrNull() entity.brain.setMemory(memory.get(), pos) } }