From 802cd30dc8abe925b8728ce2ebe0b6e23681c028 Mon Sep 17 00:00:00 2001 From: Alex Cline Date: Thu, 30 Dec 2010 15:31:03 -0500 Subject: [PATCH 1/2] Added conditional to only add signs that are not blank to the POI list. --- chunk.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/chunk.py b/chunk.py index b3e702c..95d7a51 100644 --- a/chunk.py +++ b/chunk.py @@ -905,18 +905,18 @@ class ChunkRenderer(object): for entity in tileEntities: if entity['id'] == 'Sign': - - # 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']), - chunk= (self.chunkX, self.chunkY), - ) - self.queue.put(["newpoi", newPOI]) + if entity['Text1'] != '' and entity['Text2'] != '' and entity['Text3'] != '' and entity['Text3'] != '': + # 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']), + chunk= (self.chunkX, self.chunkY), + ) + self.queue.put(["newpoi", newPOI]) # check to see if there are any signs in the persistentData list that are from this chunk. From ee1e7c3aa9ba4ae485090cb31d6dc4920ed6c15b Mon Sep 17 00:00:00 2001 From: Alex Cline Date: Fri, 31 Dec 2010 20:45:02 -0500 Subject: [PATCH 2/2] Changed blank sign logic to use aheadley's suggestion. --- chunk.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chunk.py b/chunk.py index 95d7a51..754772a 100644 --- a/chunk.py +++ b/chunk.py @@ -905,7 +905,8 @@ class ChunkRenderer(object): for entity in tileEntities: if entity['id'] == 'Sign': - if entity['Text1'] != '' and entity['Text2'] != '' and entity['Text3'] != '' and entity['Text3'] != '': + msg=' \n'.join([entity['Text1'], entity['Text2'], entity['Text3'], entity['Text4']]) + if not msg.strip(): # convert the blockID coordinates from local chunk # coordinates to global world coordinates newPOI = dict(type="sign",