Fix dumdum async getLoadedChunks call, but only because Aikar broke everything.

This commit is contained in:
Alexander Söderberg
2020-04-08 21:49:41 +02:00
parent 38de74c4ff
commit 271109a726
2 changed files with 34 additions and 4 deletions

View File

@ -4,8 +4,10 @@ import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.ChunkManager;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import com.github.intellectualsites.plotsquared.plot.util.StringMan;
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
import java.util.Map;
@ -23,9 +25,16 @@ public class Debug extends SubCommand {
MainUtil.sendMessage(player,
"Key: " + meta.getKey() + " Value: " + meta.getValue().toString() + " , ");
}
;
}
}
if (args.length > 0 && "loadedchunks".equalsIgnoreCase(args[0])) {
final long start = System.currentTimeMillis();
MainUtil.sendMessage(player, "Fetching loaded chunks...");
TaskManager.runTaskAsync(() -> MainUtil.sendMessage(player,"Loaded chunks: " +
ChunkManager.manager.getChunkChunks(player.getLocation().getWorld()).size() + "(" + (System.currentTimeMillis() - start) + "ms) using thread: " +
Thread.currentThread().getName()));
return true;
}
if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) {
StringBuilder msg = new StringBuilder();
for (Captions caption : Captions.values()) {