0

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.
This commit is contained in:
Nicolas F
2016-12-06 15:16:03 +01:00
parent c7d86eca76
commit 54b93754c7
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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)