Sort mobs by distance
This commit is contained in:
parent
3540e5580e
commit
2f77c7b990
|
@ -312,6 +312,7 @@ class World:
|
|||
if utils.phyp(center, pos) > distance:
|
||||
continue
|
||||
result.append(mob)
|
||||
result.sort(key=lambda mob: utils.phyp(center, (mob.x, mob.y, mob.z)))
|
||||
return result
|
||||
|
||||
def find_threats(self, center, distance):
|
||||
|
@ -324,6 +325,7 @@ class World:
|
|||
if not self.check_air_column(pos, distance):
|
||||
continue
|
||||
result.append(mob)
|
||||
result.sort(key=lambda mob: utils.phyp(center, (mob.x, mob.y, mob.z)))
|
||||
return result
|
||||
|
||||
def find_villagers(self, center, distance):
|
||||
|
@ -336,6 +338,7 @@ class World:
|
|||
if utils.phyp(center, pos) > distance:
|
||||
continue
|
||||
result.append(mob)
|
||||
result.sort(key=lambda mob: utils.phyp(center, (mob.x, mob.y, mob.z)))
|
||||
return result
|
||||
|
||||
def find_villager_openings(self, villager):
|
||||
|
|
Loading…
Reference in New Issue
Block a user