copyWater can now be turned off without turning off copyAir

This commit is contained in:
David Vierra 2010-09-25 21:51:29 -10:00
parent 8c5d5e7388
commit 7e46c941bf

View File

@ -806,11 +806,12 @@ class MCLevel:
def copyBlockArrayMasked(self, blocks, sourceBlocks, copyAir, copyWater): def copyBlockArrayMasked(self, blocks, sourceBlocks, copyAir, copyWater):
#assumes sourceBlocks has already been converted to my materials #assumes sourceBlocks has already been converted to my materials
mask = sourceBlocks == sourceBlocks
if not copyAir: if not copyAir:
mask=(sourceBlocks!=0) mask &=(sourceBlocks != self.materials.materialNamed("Air"))
if not copyWater: if not copyWater:
mask &=(sourceBlocks != self.materials.materialNamed("Water")) mask &=(sourceBlocks != self.materials.materialNamed("Water"))
mask &=(sourceBlocks != self.materials.materialNamed("Stationary water")) mask &=(sourceBlocks != self.materials.materialNamed("Stationary water"))
blocks[mask] = sourceBlocks[mask] blocks[mask] = sourceBlocks[mask]
return mask; return mask;