mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Slow down queue a bit because 1.13+ performance is bad
This commit is contained in:
parent
525ba648ae
commit
bbde2f5e06
2 changed files with 8 additions and 7 deletions
|
@ -491,9 +491,9 @@ public class Settings extends Config {
|
|||
|
||||
@Comment("Settings relating to PlotSquared's GlobalBlockQueue")
|
||||
public static final class QUEUE {
|
||||
@Comment({"Average time per tick spent completing chunk tasks in ms. Target average TPS = 20 * 50 / TARGET_TIME.",
|
||||
@Comment({"Average time per tick spent completing chunk tasks in ms.",
|
||||
"Waits (chunk task time / target_time) ticks before completely the next task."})
|
||||
public static int TARGET_TIME = 65;
|
||||
public static int TARGET_TIME = 40;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ public class GlobalBlockQueue {
|
|||
private final RunnableVal2<Long, LocalBlockQueue> SET_TASK =
|
||||
new RunnableVal2<Long, LocalBlockQueue>() {
|
||||
@Override public void run(Long free, LocalBlockQueue queue) {
|
||||
long t1 = System.currentTimeMillis();
|
||||
do {
|
||||
boolean more = queue.next();
|
||||
if (!more) {
|
||||
|
@ -66,9 +67,9 @@ public class GlobalBlockQueue {
|
|||
}
|
||||
return;
|
||||
}
|
||||
} while ((lastPeriod =
|
||||
((GlobalBlockQueue.this.secondLast = System.currentTimeMillis())
|
||||
- GlobalBlockQueue.this.last)) < free);
|
||||
} while (((GlobalBlockQueue.this.secondLast = System.currentTimeMillis())
|
||||
- GlobalBlockQueue.this.last) < free);
|
||||
lastPeriod = System.currentTimeMillis() - t1;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -124,8 +125,8 @@ public class GlobalBlockQueue {
|
|||
lastPeriod -= targetTime;
|
||||
return;
|
||||
}
|
||||
SET_TASK.value1 = 50 + Math.min(
|
||||
(50 + GlobalBlockQueue.this.last) - (GlobalBlockQueue.this.last =
|
||||
SET_TASK.value1 = 30 + Math.min(
|
||||
(30 + GlobalBlockQueue.this.last) - (GlobalBlockQueue.this.last =
|
||||
System.currentTimeMillis()),
|
||||
GlobalBlockQueue.this.secondLast - System.currentTimeMillis());
|
||||
SET_TASK.value2 = GlobalBlockQueue.this.getNextQueue();
|
||||
|
|
Loading…
Reference in a new issue