Skip to content

Commit 07592fb

Browse files
committed
Fix idle tick time counting as scheduled tasks in F3 graph
Related: #595
1 parent e9cc6ca commit 07592fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/fix_loop_spin_waiting/MinecraftServerMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ private void managedBlock(MinecraftServer instance, BooleanSupplier isDone, Oper
3737
}
3838
}
3939

40-
@Override
41-
public void waitForTasks() {
40+
@WrapOperation(method = "waitForTasks", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/thread/ReentrantBlockableEventLoop;waitForTasks()V"))
41+
private void waitLongerForTasks(MinecraftServer instance, Operation<Void> original) {
4242
if (this.mfix$isWaitingForNextTick) {
4343
LockSupport.parkNanos("waiting for tasks", this.nextTickTimeNanos - Util.getNanos());
4444
} else {
45-
super.waitForTasks();
45+
original.call(instance);
4646
}
4747
}
4848
}

0 commit comments

Comments
 (0)