aboutsummaryrefslogtreecommitdiff
path: root/spark-sponge7/src
diff options
context:
space:
mode:
Diffstat (limited to 'spark-sponge7/src')
-rw-r--r--spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7ClassSourceLookup.java2
-rw-r--r--spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java2
-rw-r--r--spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7WorldInfoProvider.java21
3 files changed, 21 insertions, 4 deletions
diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7ClassSourceLookup.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7ClassSourceLookup.java
index 90f3b8f..899ce58 100644
--- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7ClassSourceLookup.java
+++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7ClassSourceLookup.java
@@ -20,7 +20,7 @@
package me.lucko.spark.sponge;
-import me.lucko.spark.common.util.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.ClassSourceLookup;
import org.spongepowered.api.Game;
diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java
index e6c9a04..0e3f4eb 100644
--- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java
+++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java
@@ -29,8 +29,8 @@ import me.lucko.spark.common.monitor.ping.PlayerPingProvider;
import me.lucko.spark.common.platform.PlatformInfo;
import me.lucko.spark.common.platform.world.WorldInfoProvider;
import me.lucko.spark.common.sampler.ThreadDumper;
+import me.lucko.spark.common.sampler.source.ClassSourceLookup;
import me.lucko.spark.common.tick.TickHook;
-import me.lucko.spark.common.util.ClassSourceLookup;
import org.slf4j.Logger;
import org.spongepowered.api.Game;
diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7WorldInfoProvider.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7WorldInfoProvider.java
index fa6fa6b..df58028 100644
--- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7WorldInfoProvider.java
+++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7WorldInfoProvider.java
@@ -20,6 +20,7 @@
package me.lucko.spark.sponge;
+import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import me.lucko.spark.common.platform.world.AbstractChunkInfo;
@@ -44,8 +45,24 @@ public class Sponge7WorldInfoProvider implements WorldInfoProvider {
}
@Override
- public Result<Sponge7ChunkInfo> poll() {
- Result<Sponge7ChunkInfo> data = new Result<>();
+ public CountsResult pollCounts() {
+ int players = this.server.getOnlinePlayers().size();
+ int entities = 0;
+ int tileEntities = 0;
+ int chunks = 0;
+
+ for (World world : this.server.getWorlds()) {
+ entities += world.getEntities().size();
+ tileEntities += world.getTileEntities().size();
+ chunks += Iterables.size(world.getLoadedChunks());
+ }
+
+ return new CountsResult(players, entities, tileEntities, chunks);
+ }
+
+ @Override
+ public ChunksResult<Sponge7ChunkInfo> pollChunks() {
+ ChunksResult<Sponge7ChunkInfo> data = new ChunksResult<>();
for (World world : this.server.getWorlds()) {
List<Chunk> chunks = Lists.newArrayList(world.getLoadedChunks());