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

Method process_queue

main.py:415–424  ·  view source on GitHub ↗

Process the entire queue while taking periodic breaks. This allows the game loop to run smoothly. The queue contains calls to _show_block() and _hide_block() so this method should be called if add_block() or remove_block() was called with immediate=False

(self)

Source from the content-addressed store, hash-verified

413 func(*args)
414
415 def process_queue(self):
416 """ Process the entire queue while taking periodic breaks. This allows
417 the game loop to run smoothly. The queue contains calls to
418 _show_block() and _hide_block() so this method should be called if
419 add_block() or remove_block() was called with immediate=False
420
421 """
422 start = time.perf_counter()
423 while self.queue and time.perf_counter() - start < 1.0 / TICKS_PER_SEC:
424 self._dequeue()
425
426 def process_entire_queue(self):
427 """ Process the entire queue with no breaks.

Callers 1

updateMethod · 0.80

Calls 1

_dequeueMethod · 0.95

Tested by

no test coverage detected