From 54b93754c71907fe2a8b20278f5c18daa1beb086 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Tue, 6 Dec 2016 15:16:03 +0100 Subject: [PATCH] genPOI/docs: Handle new sign id values Minecraft now uses minecraft:sign as its id for signs, but also uses Sign for older versions or chunks that have not yet been updated. Change the genPOI sign wrangling code and the documentation to reflect this change. Fixes #1340. --- docs/signs.rst | 2 +- overviewer_core/aux_files/genPOI.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/signs.rst b/docs/signs.rst index 1c433da..f177791 100644 --- a/docs/signs.rst +++ b/docs/signs.rst @@ -25,7 +25,7 @@ The function should accept one argument (a dictionary, also know as an associati array), and return a string representing the text to be displayed. For example:: def signFilter(poi): - if poi['id'] == 'Sign': + if poi['id'] == 'Sign' or poi['id'] == 'minecraft:sign': return "\n".join([poi['Text1'], poi['Text2'], poi['Text3'], poi['Text4']]) If a POI doesn't match, the filter can return None (which is the default if a python diff --git a/overviewer_core/aux_files/genPOI.py b/overviewer_core/aux_files/genPOI.py index 07b0e1c..68a51ed 100755 --- a/overviewer_core/aux_files/genPOI.py +++ b/overviewer_core/aux_files/genPOI.py @@ -117,7 +117,7 @@ def parseBucketChunks((bucket, rset, filters)): try: data = rset.get_chunk(b[0],b[1]) for poi in itertools.chain(data['TileEntities'], data['Entities']): - if poi['id'] == 'Sign': + if poi['id'] == 'Sign' or poi['id'] == 'minecraft:sign': poi = signWrangler(poi) for name, filter_function in filters: ff = bucketChunkFuncs[filter_function] @@ -166,7 +166,7 @@ def handleEntities(rset, config, config_path, filters, markers): try: data = rset.get_chunk(x, z) for poi in itertools.chain(data['TileEntities'], data['Entities']): - if poi['id'] == 'Sign': # kill me + if poi['id'] == 'Sign' or poi['id'] == 'minecraft:sign': # kill me poi = signWrangler(poi) for name, __, filter_function, __, __, __ in filters: result = filter_function(poi)