0

Merge pull request #1755 from cliffmeyers

fix a bug where multiple renders of the same world led to repeat genPOI scans
This commit is contained in:
Nicolas F
2020-05-23 16:27:05 +02:00
committed by GitHub
2 changed files with 10 additions and 21 deletions

View File

@@ -142,7 +142,7 @@ def parseBucketChunks(task_tuple):
if i == 250: if i == 250:
i = 0 i = 0
cnt = 250 + cnt cnt = 250 + cnt
logging.info("Found %d markers in thread %d so far at %d chunks.", logging.debug("Found %d markers in thread %d so far at %d chunks.",
sum(len(v) for v in markers.values()), pid, cnt) sum(len(v) for v in markers.values()), pid, cnt)
return markers return markers
@@ -502,6 +502,8 @@ def main():
filters = set() filters = set()
marker_groups = defaultdict(list) marker_groups = defaultdict(list)
logging.info("Searching renders: %s", list(config['renders']))
# collect all filters and get regionsets # collect all filters and get regionsets
for rname, render in config['renders'].items(): for rname, render in config['renders'].items():
# Convert render['world'] to the world path, and store the original # Convert render['world'] to the world path, and store the original
@@ -559,14 +561,15 @@ def main():
markers = dict((name, dict(created=False, raw=[], name=filter_name)) markers = dict((name, dict(created=False, raw=[], name=filter_name))
for name, filter_name, __, __, __, __ in filters) for name, filter_name, __, __, __, __ in filters)
all_rsets = set(map(lambda f : f[3], filters))
logging.info("Will search %s region sets using %s filters", len(all_rsets), len(filters))
# apply filters to regionsets # apply filters to regionsets
if not args.skipscan: if not args.skipscan:
# group filters by rset for rset in all_rsets:
def keyfunc(x): rset_filters = list(filter(lambda f : f[3] == rset, filters))
return x[3] logging.info("Calling handleEntities for %s with %s filters", rset, len(rset_filters))
sfilters = sorted(filters, key=keyfunc) handleEntities(rset, config, args.config, rset_filters, markers)
for rset, rset_filters in itertools.groupby(sfilters, keyfunc):
handleEntities(rset, config, args.config, list(rset_filters), markers)
# apply filters to players # apply filters to players
if not args.skipplayers: if not args.skipplayers:

View File

@@ -882,13 +882,6 @@ class RegionSet(object):
def __repr__(self): def __repr__(self):
return "<RegionSet regiondir=%r>" % self.regiondir return "<RegionSet regiondir=%r>" % self.regiondir
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?????
"""
return self.regiondir < other.regiondir
def _get_block(self, palette_entry): def _get_block(self, palette_entry):
wood_slabs = ('minecraft:oak_slab','minecraft:spruce_slab','minecraft:birch_slab','minecraft:jungle_slab', wood_slabs = ('minecraft:oak_slab','minecraft:spruce_slab','minecraft:birch_slab','minecraft:jungle_slab',
'minecraft:acacia_slab','minecraft:dark_oak_slab','minecraft:petrified_oak_slab') 'minecraft:acacia_slab','minecraft:dark_oak_slab','minecraft:petrified_oak_slab')
@@ -1573,13 +1566,6 @@ class RegionSetWrapper(object):
def __init__(self, rsetobj): def __init__(self, rsetobj):
self._r = 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?????
"""
return self.regiondir < other.regiondir
@property @property
def regiondir(self): def regiondir(self):
""" """