Class FabricSensor

java.lang.Object
net.playeranalytics.plan.gathering.FabricSensor
All Implemented Interfaces:
ServerSensor<net.minecraft.server.world.ServerWorld>

@Singleton public class FabricSensor extends Object implements ServerSensor<net.minecraft.server.world.ServerWorld>
  • Constructor Details

    • FabricSensor

      @Inject public FabricSensor(net.minecraft.server.dedicated.MinecraftDedicatedServer server)
  • Method Details

    • getTPS

      public double getTPS()
      Specified by:
      getTPS in interface ServerSensor<net.minecraft.server.world.ServerWorld>
    • getWorlds

      public Iterable<net.minecraft.server.world.ServerWorld> getWorlds()
      Description copied from interface: ServerSensor
      Get the worlds running on the server platform.
      Specified by:
      getWorlds in interface ServerSensor<net.minecraft.server.world.ServerWorld>
      Returns:
      Empty collection if the platform doesn't support worlds.
    • getEntityCount

      public int getEntityCount(net.minecraft.server.world.ServerWorld world)
      Specified by:
      getEntityCount in interface ServerSensor<net.minecraft.server.world.ServerWorld>
    • getChunkCount

      public int getChunkCount(net.minecraft.server.world.ServerWorld world)
      Specified by:
      getChunkCount in interface ServerSensor<net.minecraft.server.world.ServerWorld>
    • supportsDirectTPS

      public boolean supportsDirectTPS()
      Description copied from interface: ServerSensor
      Check if server platform provides TPS calculation.
      Specified by:
      supportsDirectTPS in interface ServerSensor<net.minecraft.server.world.ServerWorld>
      Returns:
      false if the server doesn't count TPS.
    • getOnlinePlayerCount

      public int getOnlinePlayerCount()
      Specified by:
      getOnlinePlayerCount in interface ServerSensor<net.minecraft.server.world.ServerWorld>
    • getOnlinePlayerNames

      public List<String> getOnlinePlayerNames()
      Specified by:
      getOnlinePlayerNames in interface ServerSensor<net.minecraft.server.world.ServerWorld>
    • getInstalledPlugins

      public List<PluginMetadata> getInstalledPlugins()
      Specified by:
      getInstalledPlugins in interface ServerSensor<net.minecraft.server.world.ServerWorld>