pep8 compliance: W291 trailing whitespace
This commit is contained in:
parent
ed6a75a095
commit
eda7338c3d
@ -10,41 +10,40 @@ class MCLevelAdapter(object):
|
|||||||
if x < box.minx or x >= box.maxx: return False
|
if x < box.minx or x >= box.maxx: return False
|
||||||
if z < box.minz or z >= box.maxz: return False
|
if z < box.minz or z >= box.maxz: return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def check_box_3d(self, x, y, z):
|
def check_box_3d(self, x, y, z):
|
||||||
'''If the coordinates are within the box, return True, else return False'''
|
'''If the coordinates are within the box, return True, else return False'''
|
||||||
box = self.box
|
box = self.box
|
||||||
if not self.check_box_2d(x, z): return False
|
if not self.check_box_2d(x, z): return False
|
||||||
if y < box.miny or y >= box.maxy: return False
|
if y < box.miny or y >= box.maxy: return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def block(self, x, y, z):
|
def block(self, x, y, z):
|
||||||
if not self.check_box_3d(x, y, z): return None
|
if not self.check_box_3d(x, y, z): return None
|
||||||
d = {}
|
d = {}
|
||||||
d['B'] = self.level.blockAt(x,y,z)
|
d['B'] = self.level.blockAt(x,y,z)
|
||||||
d['D'] = self.level.blockDataAt(x,y,z)
|
d['D'] = self.level.blockDataAt(x,y,z)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def set_block(self, x, y, z, d):
|
def set_block(self, x, y, z, d):
|
||||||
if not self.check_box_3d(x, y, z): return None
|
if not self.check_box_3d(x, y, z): return None
|
||||||
if 'B' in d:
|
if 'B' in d:
|
||||||
self.level.setBlockAt(x,y,z,d['B'])
|
self.level.setBlockAt(x,y,z,d['B'])
|
||||||
if 'D' in d:
|
if 'D' in d:
|
||||||
self.level.setBlockDataAt(x,y,z,d['D'])
|
self.level.setBlockDataAt(x,y,z,d['D'])
|
||||||
|
|
||||||
def surface_block(self, x, z):
|
def surface_block(self, x, z):
|
||||||
if not self.check_box_2d(x, z): return None
|
if not self.check_box_2d(x, z): return None
|
||||||
y = self.level.heightMapAt(x,z)
|
y = self.level.heightMapAt(x,z)
|
||||||
y = max(0, y-1)
|
y = max(0, y-1)
|
||||||
|
|
||||||
d = self.block(x,y,z)
|
d = self.block(x,y,z)
|
||||||
if d:
|
if d:
|
||||||
d['y'] = y
|
d['y'] = y
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
SaveFile = MCLevelAdapter
|
SaveFile = MCLevelAdapter
|
||||||
|
|
||||||
#dict['L'] = self.level.blockLightAt(x,y,z)
|
#dict['L'] = self.level.blockLightAt(x,y,z)
|
||||||
#dict['S'] = self.level.skyLightAt(x,y,z)
|
#dict['S'] = self.level.skyLightAt(x,y,z)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user