From ac558236cecb8037aa482f907e187551660ed2cc Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Mon, 30 Nov 2015 21:49:20 -0800 Subject: [PATCH] Entirely omit converting any flowing water. We can let the water flow algorithms do this, much easier and better than creating tons of messy water or laval flow stuff. --- block.py | 10 ++++++++-- map_content.txt | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/block.py b/block.py index aaa342e..776030a 100644 --- a/block.py +++ b/block.py @@ -229,8 +229,14 @@ class MTBlock: def isdoor(b): return b == 64 or b == 71 or (b >= 193 and b <= 197) + # water + if (blocks[i] == 9 or blocks[i] == 11) and (data[i] == 0): + content[i], param2[i] = conversion_table[blocks[i]][data[i]] + elif blocks[i] >= 8 and blocks[i] <= 11: + # nop, exit case + pass # pressure plates - append mesecons node timer - if blocks[i] == 70 or blocks[i] == 72: + elif blocks[i] == 70 or blocks[i] == 72: self.timers.append(((i&0xf)|((i>>4)&0xf)<<8|((i>>8)&0xf)<<4, 100, 0)) # rotate lily pads randomly elif blocks[i] == 111: @@ -275,7 +281,7 @@ class MTBlock: if d_right == 1: self.metadata[(i & 0xf, (i>>8) & 0xf, (i>>4) & 0xf)] = ({ "right": "1" }, {}) - if content[i]==0 and param2[i]==0 and not (blocks[i]==0): + elif content[i]==0 and param2[i]==0 and not (blocks[i]==0): print('Unknown Minecraft Block:' + str(mcblockidentifier[i])) # This is the minecraft ID#/data as listed in map_content.txt for te in mcblock.tile_entities: diff --git a/map_content.txt b/map_content.txt index ad387e7..0157ff9 100644 --- a/map_content.txt +++ b/map_content.txt @@ -29,10 +29,11 @@ #endif 7 default:stone // Bedrock -8 default:water_flowing + +// blocks 8, 9, 10 and 11 (water and lava) are handled in code. 9 default:water_source -10 default:lava_flowing 11 default:lava_source + 12 0 default:sand 12 1 default:desert_sand 13 default:gravel