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:
@@ -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::
|
array), and return a string representing the text to be displayed. For example::
|
||||||
|
|
||||||
def signFilter(poi):
|
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']])
|
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
|
If a POI doesn't match, the filter can return None (which is the default if a python
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ def parseBucketChunks((bucket, rset, filters)):
|
|||||||
try:
|
try:
|
||||||
data = rset.get_chunk(b[0],b[1])
|
data = rset.get_chunk(b[0],b[1])
|
||||||
for poi in itertools.chain(data['TileEntities'], data['Entities']):
|
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)
|
poi = signWrangler(poi)
|
||||||
for name, filter_function in filters:
|
for name, filter_function in filters:
|
||||||
ff = bucketChunkFuncs[filter_function]
|
ff = bucketChunkFuncs[filter_function]
|
||||||
@@ -166,7 +166,7 @@ def handleEntities(rset, config, config_path, filters, markers):
|
|||||||
try:
|
try:
|
||||||
data = rset.get_chunk(x, z)
|
data = rset.get_chunk(x, z)
|
||||||
for poi in itertools.chain(data['TileEntities'], data['Entities']):
|
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)
|
poi = signWrangler(poi)
|
||||||
for name, __, filter_function, __, __, __ in filters:
|
for name, __, filter_function, __, __, __ in filters:
|
||||||
result = filter_function(poi)
|
result = filter_function(poi)
|
||||||
|
|||||||
Reference in New Issue
Block a user