world_utils module¶
-
utils.world_utils.block_coords_to_chunk_coords(x, z)[source]¶ Converts the supplied block coordinates into chunk coordinates
Parameters: Return type: Returns: The resulting chunk coordinates in (x, z) order
-
utils.world_utils.blocks_slice_to_chunk_slice(blocks_slice)[source]¶ Converts the supplied blocks slice into chunk slice :type blocks_slice:
slice:param blocks_slice: The slice of the blocks :rtype:slice:return: The resulting chunk slice
-
utils.world_utils.chunk_coords_to_block_coords(x, z)[source]¶ Converts the supplied chunk coordinates into block coordinates
Parameters: Return type: Returns: The resulting block coordinates in (x, z) order
-
utils.world_utils.chunk_coords_to_region_coords(cx, cz)[source]¶ Converts the supplied chunk coordinates into region coordinates
Parameters: Return type: Returns: The resulting region coordinates in (x, z) order
-
utils.world_utils.from_nibble_array(arr)[source]¶ Unpacks a nibble array into a full size numpy array
Parameters: arr ( ndarray) – The nibble arrayReturn type: ndarrayReturns: The resulting array
-
utils.world_utils.get_smallest_dtype(arr, uint=True)[source]¶ Returns the smallest dtype (number) that the array can afford :type arr:
ndarray:param arr: The array to check on :type uint:bool:param uint: Should the array fit in uint or not (default: True) :rtype:int:return: The number of bits all the elements can be represented with