Skip to content

Commit

Permalink
Profile queued tasks.
Browse files Browse the repository at this point in the history
Signed-off-by: Ross Allan <rallanpcl@gmail.com>
  • Loading branch information
LunNova committed Jul 17, 2013
1 parent a533fdd commit b075629
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions resources/patches-deobfuscated.xml
Expand Up @@ -42,6 +42,7 @@
<volatile field="serverRunning"/>
<volatile field="serverIsRunning"/>
<replaceInitializer field="worlds" class="nallar.collections.ListSet"/>
<profile>runQueuedTasks</profile>
</class>
<class id="net.minecraft.server.MinecraftServer" env="mcpc">
<replaceMethod code="{
Expand Down
14 changes: 9 additions & 5 deletions src/common/nallar/patched/server/PatchMinecraftServer.java
Expand Up @@ -367,11 +367,7 @@ public void updateTimeLightAndEntities() {
final Profiler profiler = theProfiler;
profiler.startSection("levels");

spigotTLETick();

for (Runnable runnable = runQueue.poll(); runnable != null; runnable = runQueue.poll()) {
runnable.run();
}
runQueuedTasks();

Integer[] dimensionIdsToTick = this.dimensionIdsToTick = DimensionManager.getIDs();

Expand Down Expand Up @@ -440,6 +436,14 @@ public void updateTimeLightAndEntities() {
profiler.endSection();
}

private void runQueuedTasks() {
spigotTLETick();

for (Runnable runnable = runQueue.poll(); runnable != null; runnable = runQueue.poll()) {
runnable.run();
}
}

private void spigotTLETick() {
// Replaced in patcher
}
Expand Down

0 comments on commit b075629

Please sign in to comment.