MCPcopy
hub / github.com/fogleman/Minecraft / sectorize

Function sectorize

main.py:112–126  ·  view source on GitHub ↗

Returns a tuple representing the sector for the given `position`. Parameters ---------- position : tuple of len 3 Returns ------- sector : tuple of len 3

(position)

Source from the content-addressed store, hash-verified

110
111
112def sectorize(position):
113 """ Returns a tuple representing the sector for the given `position`.
114
115 Parameters
116 ----------
117 position : tuple of len 3
118
119 Returns
120 -------
121 sector : tuple of len 3
122
123 """
124 x, y, z = normalize(position)
125 x, y, z = x // SECTOR_SIZE, y // SECTOR_SIZE, z // SECTOR_SIZE
126 return (x, 0, z)
127
128
129class Model(object):

Callers 3

add_blockMethod · 0.85
remove_blockMethod · 0.85
updateMethod · 0.85

Calls 1

normalizeFunction · 0.85

Tested by

no test coverage detected