mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-12 06:48:50 +02:00
Moved back to Check.isPaperAvailable for PaperTPSTask
This commit is contained in:
parent
ea873f798e
commit
22bbf3afc0
@ -11,6 +11,7 @@ import com.djrapitops.plan.system.settings.locale.Msg;
|
||||
import com.djrapitops.plan.system.tasks.bukkit.*;
|
||||
import com.djrapitops.plan.utilities.file.export.HtmlExport;
|
||||
import com.djrapitops.plugin.api.Benchmark;
|
||||
import com.djrapitops.plugin.api.Check;
|
||||
import com.djrapitops.plugin.api.TimeAmount;
|
||||
import com.djrapitops.plugin.api.utility.log.Log;
|
||||
import com.djrapitops.plugin.task.ITask;
|
||||
@ -29,9 +30,7 @@ public class BukkitTaskSystem extends TaskSystem {
|
||||
private final Plan plugin;
|
||||
|
||||
public BukkitTaskSystem(Plan plugin) {
|
||||
String serverName = plugin.getServer().getServerName();
|
||||
boolean isPaper = serverName.equals("Paper") || serverName.equals("TacoSpigot");
|
||||
tpsCountTimer = isPaper
|
||||
tpsCountTimer = Check.isPaperAvailable()
|
||||
? new PaperTPSCountTimer(plugin)
|
||||
: new BukkitTPSCountTimer(plugin);
|
||||
|
||||
|
@ -2,6 +2,7 @@ package com.djrapitops.plan.system.tasks;
|
||||
|
||||
import com.djrapitops.plan.PlanPlugin;
|
||||
import com.djrapitops.plan.data.container.TPS;
|
||||
import com.djrapitops.plan.system.processing.Processor;
|
||||
import com.djrapitops.plan.system.processing.processors.TPSInsertProcessor;
|
||||
import com.djrapitops.plan.utilities.MiscUtils;
|
||||
import com.djrapitops.plugin.task.AbsRunnable;
|
||||
@ -36,7 +37,7 @@ public abstract class TPSCountTimer<T extends PlanPlugin> extends AbsRunnable {
|
||||
addNewTPSEntry(nanoTime, now);
|
||||
|
||||
if (history.size() >= 60) {
|
||||
new TPSInsertProcessor(new ArrayList<>(history)).queue();
|
||||
Processor.queue(new TPSInsertProcessor(new ArrayList<>(history)));
|
||||
history.clear();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user