1717"""
1818
1919import array
20- from math import floor
2120
2221from spockbot .mcp .bbuff import BoundBuffer
2322
@@ -221,10 +220,9 @@ def get_block(self, pos_or_x, y=None, z=None):
221220 if None in (y , z ): # pos supplied
222221 pos_or_x , y , z = pos_or_x
223222
224- x , rx = divmod (floor (pos_or_x ), 16 )
225- y , ry = divmod (floor (y ), 16 )
226- z , rz = divmod (floor (z ), 16 )
227-
223+ x , rx = divmod (int (pos_or_x ), 16 )
224+ y , ry = divmod (int (y ), 16 )
225+ z , rz = divmod (int (z ), 16 )
228226 if (x , z ) not in self .columns or y > 0x0F :
229227 return 0 , 0
230228 chunk = self .columns [(x , z )].chunks [y ]
@@ -238,9 +236,9 @@ def set_block(self, pos_or_x, y=None, z=None,
238236 if None in (y , z ): # pos supplied
239237 pos_or_x , y , z = pos_or_x
240238
241- x , rx = divmod (floor (pos_or_x ), 16 )
242- y , ry = divmod (floor (y ), 16 )
243- z , rz = divmod (floor (z ), 16 )
239+ x , rx = divmod (int (pos_or_x ), 16 )
240+ y , ry = divmod (int (y ), 16 )
241+ z , rz = divmod (int (z ), 16 )
244242
245243 if y > 0x0F :
246244 return
@@ -271,7 +269,7 @@ def get_block_entity_data(self, pos_or_x, y=None, z=None):
271269 """
272270 if None not in (y , z ): # x y z supplied
273271 pos_or_x = pos_or_x , y , z
274- coord_tuple = tuple (floor (c ) for c in pos_or_x )
272+ coord_tuple = tuple (int (c ) for c in pos_or_x )
275273 return self .block_entities .get (coord_tuple , None )
276274
277275 def set_block_entity_data (self , pos_or_x , y = None , z = None , data = None ):
@@ -284,7 +282,7 @@ def set_block_entity_data(self, pos_or_x, y=None, z=None, data=None):
284282 """
285283 if None not in (y , z ): # x y z supplied
286284 pos_or_x = pos_or_x , y , z
287- coord_tuple = tuple (floor (c ) for c in pos_or_x )
285+ coord_tuple = tuple (int (c ) for c in pos_or_x )
288286 old_data = self .block_entities .get (coord_tuple , None )
289287 self .block_entities [coord_tuple ] = data
290288 return old_data
@@ -293,9 +291,9 @@ def get_light(self, pos_or_x, y=None, z=None):
293291 if None in (y , z ): # pos supplied
294292 pos_or_x , y , z = pos_or_x
295293
296- x , rx = divmod (floor (pos_or_x ), 16 )
297- y , ry = divmod (floor (y ), 16 )
298- z , rz = divmod (floor (z ), 16 )
294+ x , rx = divmod (int (pos_or_x ), 16 )
295+ y , ry = divmod (int (y ), 16 )
296+ z , rz = divmod (int (z ), 16 )
299297
300298 if (x , z ) not in self .columns or y > 0x0F :
301299 return 0 , 0
@@ -310,9 +308,9 @@ def set_light(self, pos_or_x, y=None, z=None,
310308 if None in (y , z ): # pos supplied
311309 pos_or_x , y , z = pos_or_x
312310
313- x , rx = divmod (floor (pos_or_x ), 16 )
314- y , ry = divmod (floor (y ), 16 )
315- z , rz = divmod (floor (z ), 16 )
311+ x , rx = divmod (int (pos_or_x ), 16 )
312+ y , ry = divmod (int (y ), 16 )
313+ z , rz = divmod (int (z ), 16 )
316314
317315 if y > 0x0F :
318316 return
@@ -332,17 +330,17 @@ def set_light(self, pos_or_x, y=None, z=None,
332330 chunk .light_sky .set (rx , ry , rz , light_sky & 0xF )
333331
334332 def get_biome (self , x , z ):
335- x , rx = divmod (floor (x ), 16 )
336- z , rz = divmod (floor (z ), 16 )
333+ x , rx = divmod (int (x ), 16 )
334+ z , rz = divmod (int (z ), 16 )
337335
338336 if (x , z ) not in self .columns :
339337 return 0
340338
341339 return self .columns [(x , z )].biome .get (rx , rz )
342340
343341 def set_biome (self , x , z , data ):
344- x , rx = divmod (floor (x ), 16 )
345- z , rz = divmod (floor (z ), 16 )
342+ x , rx = divmod (int (x ), 16 )
343+ z , rz = divmod (int (z ), 16 )
346344
347345 if (x , z ) in self .columns :
348346 column = self .columns [(x , z )]
0 commit comments