()
| 96 | } |
| 97 | |
| 98 | private void loop() { |
| 99 | long nextTickNanos = System.nanoTime(); |
| 100 | while (this.running) { |
| 101 | // TODO: Run the other tick logic |
| 102 | |
| 103 | // TODO: Split chunk batch handling to multiple threads |
| 104 | this.server.playerList().players().forEach(player -> player.chunkBatchHandler().tick()); |
| 105 | |
| 106 | while (true) { |
| 107 | Runnable task = this.tasks.poll(); |
| 108 | if (task == null) break; |
| 109 | task.run(); |
| 110 | } |
| 111 | |
| 112 | nextTickNanos += this.tickNanos; |
| 113 | LockSupport.parkNanos(nextTickNanos - System.nanoTime()); |
| 114 | } |
| 115 | } |
| 116 | } |
nothing calls this directly
no test coverage detected