MCPcopy Index your code
hub / github.com/fogleman/Minecraft / remove_block

Method remove_block

main.py:256–272  ·  view source on GitHub ↗

Remove the block at the given `position`. Parameters ---------- position : tuple of len 3 The (x, y, z) position of the block to remove. immediate : bool Whether or not to immediately remove block from canvas.

(self, position, immediate=True)

Source from the content-addressed store, hash-verified

254 self.check_neighbors(position)
255
256 def remove_block(self, position, immediate=True):
257 """ Remove the block at the given `position`.
258
259 Parameters
260 ----------
261 position : tuple of len 3
262 The (x, y, z) position of the block to remove.
263 immediate : bool
264 Whether or not to immediately remove block from canvas.
265
266 """
267 del self.world[position]
268 self.sectors[sectorize(position)].remove(position)
269 if immediate:
270 if position in self.shown:
271 self.hide_block(position)
272 self.check_neighbors(position)
273
274 def check_neighbors(self, position):
275 """ Check all blocks surrounding `position` and ensure their visual

Callers 2

add_blockMethod · 0.95
on_mouse_pressMethod · 0.80

Calls 3

hide_blockMethod · 0.95
check_neighborsMethod · 0.95
sectorizeFunction · 0.85

Tested by

no test coverage detected