Fix idle tick time counting as scheduled tasks in F3 graph

Related: #595
This commit is contained in:
embeddedt 2025-08-16 11:32:15 -04:00
parent e9cc6caad5
commit 07592fb708
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -37,12 +37,12 @@ public abstract class MinecraftServerMixin extends BlockableEventLoop<Runnable>
}
}
@Override
public void waitForTasks() {
@WrapOperation(method = "waitForTasks", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/thread/ReentrantBlockableEventLoop;waitForTasks()V"))
private void waitLongerForTasks(MinecraftServer instance, Operation<Void> original) {
if (this.mfix$isWaitingForNextTick) {
LockSupport.parkNanos("waiting for tasks", this.nextTickTimeNanos - Util.getNanos());
} else {
super.waitForTasks();
original.call(instance);
}
}
}