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:
|
for entity in tileEntities:
|
||||||
if entity['id'] == 'Sign':
|
if entity['id'] == 'Sign':
|
||||||
msg=' \n'.join([entity['Text1'], entity['Text2'], entity['Text3'], entity['Text4']])
|
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
|
# convert the blockID coordinates from local chunk
|
||||||
# coordinates to global world coordinates
|
# coordinates to global world coordinates
|
||||||
newPOI = dict(type="sign",
|
newPOI = dict(type="sign",
|
||||||
x= entity['x'],
|
x= entity['x'],
|
||||||
y= entity['y'],
|
y= entity['y'],
|
||||||
z= entity['z'],
|
z= entity['z'],
|
||||||
msg="%s \n%s \n%s \n%s" %
|
msg=msg,
|
||||||
(entity['Text1'], entity['Text2'], entity['Text3'], entity['Text4']),
|
|
||||||
chunk= (self.chunkX, self.chunkY),
|
chunk= (self.chunkX, self.chunkY),
|
||||||
)
|
)
|
||||||
self.queue.put(["newpoi", newPOI])
|
self.queue.put(["newpoi", newPOI])
|
||||||
|
|||||||
@@ -45,16 +45,18 @@ for dirpath, dirnames, filenames in os.walk(worlddir):
|
|||||||
data = nbt.load(full)[1]['Level']['TileEntities']
|
data = nbt.load(full)[1]['Level']['TileEntities']
|
||||||
for entity in data:
|
for entity in data:
|
||||||
if entity['id'] == 'Sign':
|
if entity['id'] == 'Sign':
|
||||||
newPOI = dict(type="sign",
|
msg=' \n'.join([entity['Text1'], entity['Text2'], entity['Text3'], entity['Text4']])
|
||||||
x= entity['x'],
|
#print "checking -->%s<--" % msg.strip()
|
||||||
y= entity['y'],
|
if msg.strip():
|
||||||
z= entity['z'],
|
newPOI = dict(type="sign",
|
||||||
msg="%s \n%s \n%s \n%s" %
|
x= entity['x'],
|
||||||
(entity['Text1'], entity['Text2'], entity['Text3'], entity['Text4']),
|
y= entity['y'],
|
||||||
chunk= (entity['x']/16, entity['z']/16),
|
z= entity['z'],
|
||||||
)
|
msg=msg,
|
||||||
POI.append(newPOI)
|
chunk= (entity['x']/16, entity['z']/16),
|
||||||
print "Found sign at (%d, %d, %d): %r" % (newPOI['x'], newPOI['y'], newPOI['z'], newPOI['msg'])
|
)
|
||||||
|
POI.append(newPOI)
|
||||||
|
print "Found sign at (%d, %d, %d): %r" % (newPOI['x'], newPOI['y'], newPOI['z'], newPOI['msg'])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user