fix: container focus again
This commit is contained in:
parent
d45f8d2a57
commit
1ee1c7215d
@ -34,8 +34,9 @@ class NearestVisibleContainer : Sensor<LivingEntity>() {
|
|||||||
if (entity.tickCount and 0b11111 == 0) { // 32gt
|
if (entity.tickCount and 0b11111 == 0) { // 32gt
|
||||||
val pos = level.getChunksNearby(entity.blockPosition(), 1)
|
val pos = level.getChunksNearby(entity.blockPosition(), 1)
|
||||||
.flatMap { it.blockEntities.filterValues { be -> be is BaseContainerBlockEntity }.keys }
|
.flatMap { it.blockEntities.filterValues { be -> be is BaseContainerBlockEntity }.keys }
|
||||||
.shuffled(Random(entity.random.nextLong()))
|
.sortedBy { it.distManhattan(entity.blockPosition()) / 5 }
|
||||||
.minByOrNull { it.distManhattan(entity.blockPosition()) / 5 }
|
.shuffled(Random(System.currentTimeMillis() / 10000))
|
||||||
|
.first()
|
||||||
entity.brain.setMemory(memory.get(), pos)
|
entity.brain.setMemory(memory.get(), pos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user