Fixed empty sign handling, updated findSigns.py
This commit is contained in:
5
chunk.py
5
chunk.py
@@ -906,15 +906,14 @@ class ChunkRenderer(object):
|
||||
for entity in tileEntities:
|
||||
if entity['id'] == 'Sign':
|
||||
msg=' \n'.join([entity['Text1'], entity['Text2'], entity['Text3'], entity['Text4']])
|
||||
if not msg.strip():
|
||||
if msg.strip():
|
||||
# convert the blockID coordinates from local chunk
|
||||
# coordinates to global world coordinates
|
||||
newPOI = dict(type="sign",
|
||||
x= entity['x'],
|
||||
y= entity['y'],
|
||||
z= entity['z'],
|
||||
msg="%s \n%s \n%s \n%s" %
|
||||
(entity['Text1'], entity['Text2'], entity['Text3'], entity['Text4']),
|
||||
msg=msg,
|
||||
chunk= (self.chunkX, self.chunkY),
|
||||
)
|
||||
self.queue.put(["newpoi", newPOI])
|
||||
|
||||
@@ -45,12 +45,14 @@ for dirpath, dirnames, filenames in os.walk(worlddir):
|
||||
data = nbt.load(full)[1]['Level']['TileEntities']
|
||||
for entity in data:
|
||||
if entity['id'] == 'Sign':
|
||||
msg=' \n'.join([entity['Text1'], entity['Text2'], entity['Text3'], entity['Text4']])
|
||||
#print "checking -->%s<--" % msg.strip()
|
||||
if msg.strip():
|
||||
newPOI = dict(type="sign",
|
||||
x= entity['x'],
|
||||
y= entity['y'],
|
||||
z= entity['z'],
|
||||
msg="%s \n%s \n%s \n%s" %
|
||||
(entity['Text1'], entity['Text2'], entity['Text3'], entity['Text4']),
|
||||
msg=msg,
|
||||
chunk= (entity['x']/16, entity['z']/16),
|
||||
)
|
||||
POI.append(newPOI)
|
||||
|
||||
Reference in New Issue
Block a user