Fix idle tick time counting as scheduled tasks in F3 graph
Related: #595
This commit is contained in:
parent
e9cc6caad5
commit
07592fb708
|
|
@ -37,12 +37,12 @@ public abstract class MinecraftServerMixin extends BlockableEventLoop<Runnable>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@WrapOperation(method = "waitForTasks", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/thread/ReentrantBlockableEventLoop;waitForTasks()V"))
|
||||||
public void waitForTasks() {
|
private void waitLongerForTasks(MinecraftServer instance, Operation<Void> original) {
|
||||||
if (this.mfix$isWaitingForNextTick) {
|
if (this.mfix$isWaitingForNextTick) {
|
||||||
LockSupport.parkNanos("waiting for tasks", this.nextTickTimeNanos - Util.getNanos());
|
LockSupport.parkNanos("waiting for tasks", this.nextTickTimeNanos - Util.getNanos());
|
||||||
} else {
|
} else {
|
||||||
super.waitForTasks();
|
original.call(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user