diff options
author | Luck <git@lucko.me> | 2022-06-25 22:48:55 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2022-06-25 22:49:41 +0100 |
commit | 4d45579d2bf57b417d5d3eca041c2131177183e4 (patch) | |
tree | c51f46d0efb323b8d7a878f383b44dbaac129fb6 /spark-fabric/src/main/java/me/lucko/spark/fabric/plugin | |
parent | 28cf3185c1374c4b5af277ef28482299694209a3 (diff) | |
download | spark-4d45579d2bf57b417d5d3eca041c2131177183e4.tar.gz spark-4d45579d2bf57b417d5d3eca041c2131177183e4.tar.bz2 spark-4d45579d2bf57b417d5d3eca041c2131177183e4.zip |
Add providers for world (entity/chunk) statistics
Diffstat (limited to 'spark-fabric/src/main/java/me/lucko/spark/fabric/plugin')
-rw-r--r-- | spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java | 12 | ||||
-rw-r--r-- | spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java index e94d697..1876658 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java @@ -29,6 +29,7 @@ import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; import me.lucko.spark.common.platform.PlatformInfo; +import me.lucko.spark.common.platform.world.WorldInfoProvider; import me.lucko.spark.common.tick.TickHook; import me.lucko.spark.common.tick.TickReporter; import me.lucko.spark.fabric.FabricCommandSender; @@ -36,6 +37,7 @@ import me.lucko.spark.fabric.FabricPlatformInfo; import me.lucko.spark.fabric.FabricSparkMod; import me.lucko.spark.fabric.FabricTickHook; import me.lucko.spark.fabric.FabricTickReporter; +import me.lucko.spark.fabric.FabricWorldInfoProvider; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; @@ -113,6 +115,11 @@ public class FabricClientSparkPlugin extends FabricSparkPlugin implements Comman } @Override + public void executeSync(Runnable task) { + this.minecraft.executeSync(task); + } + + @Override public TickHook createTickHook() { return new FabricTickHook.Client(); } @@ -123,6 +130,11 @@ public class FabricClientSparkPlugin extends FabricSparkPlugin implements Comman } @Override + public WorldInfoProvider createWorldInfoProvider() { + return new FabricWorldInfoProvider.Client(this.minecraft); + } + + @Override public PlatformInfo getPlatformInfo() { return new FabricPlatformInfo(PlatformInfo.Type.CLIENT); } diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java index 3d1a0e7..2283a84 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java @@ -31,6 +31,7 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder; import me.lucko.fabric.api.permissions.v0.Permissions; 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.tick.TickHook; import me.lucko.spark.common.tick.TickReporter; import me.lucko.spark.fabric.FabricCommandSender; @@ -39,6 +40,7 @@ import me.lucko.spark.fabric.FabricPlayerPingProvider; import me.lucko.spark.fabric.FabricSparkMod; import me.lucko.spark.fabric.FabricTickHook; import me.lucko.spark.fabric.FabricTickReporter; +import me.lucko.spark.fabric.FabricWorldInfoProvider; import me.lucko.spark.fabric.placeholder.SparkFabricPlaceholderApi; import net.fabricmc.loader.api.FabricLoader; @@ -127,6 +129,11 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman } @Override + public void executeSync(Runnable task) { + this.server.executeSync(task); + } + + @Override public TickHook createTickHook() { return new FabricTickHook.Server(); } @@ -142,6 +149,11 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman } @Override + public WorldInfoProvider createWorldInfoProvider() { + return new FabricWorldInfoProvider.Server(this.server); + } + + @Override public PlatformInfo getPlatformInfo() { return new FabricPlatformInfo(PlatformInfo.Type.SERVER); } |