0

world: add __lt__ to RegionSetWrapper for genPOI

genPOI needs this for groupby, and since we can now throw cropped
regionsets into genPOI we definitely need this too.

Probably also fixes rotated regionsets with multiple genPOI filters.
This commit is contained in:
Nicolas F
2019-07-12 16:32:07 +02:00
parent 033d75b08e
commit 4dc2c8a5b7

View File

@@ -1469,6 +1469,15 @@ class RegionSetWrapper(object):
def __init__(self, rsetobj):
self._r = rsetobj
def __lt__(self, other):
"""This garbage is only needed because genPOI wants to use
itertools.groupby, which needs sorted keys, and Python 2 somehow
just sorted objects like ???????? how????? why?????
"""
if isinstance(other, RegionSetWrapper):
other = other._r
return self._r.regiondir < other.regiondir
def get_type(self):
return self._r.get_type()
def get_biome_data(self, x, z):