fix: game crash when no container available
This commit is contained in:
parent
1ee1c7215d
commit
abb5646959
@ -36,7 +36,7 @@ class NearestVisibleContainer : Sensor<LivingEntity>() {
|
||||
.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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user