Class SpongeSensor

java.lang.Object
com.djrapitops.plan.gathering.SpongeSensor
All Implemented Interfaces:
ServerSensor<org.spongepowered.api.world.World>

@Singleton public class SpongeSensor extends Object implements ServerSensor<org.spongepowered.api.world.World>
  • Constructor Details

    • SpongeSensor

      @Inject public SpongeSensor(org.spongepowered.api.Game game)
  • Method Details

    • supportsDirectTPS

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

      public int getOnlinePlayerCount()
      Specified by:
      getOnlinePlayerCount in interface ServerSensor<org.spongepowered.api.world.World>
    • getTPS

      public double getTPS()
      Specified by:
      getTPS in interface ServerSensor<org.spongepowered.api.world.World>
    • getWorlds

      public Iterable<org.spongepowered.api.world.World> getWorlds()
      Description copied from interface: ServerSensor
      Get the worlds running on the server platform.
      Specified by:
      getWorlds in interface ServerSensor<org.spongepowered.api.world.World>
      Returns:
      Empty collection if the platform doesn't support worlds.
    • getChunkCount

      public int getChunkCount(org.spongepowered.api.world.World world)
      Specified by:
      getChunkCount in interface ServerSensor<org.spongepowered.api.world.World>
    • getEntityCount

      public int getEntityCount(org.spongepowered.api.world.World world)
      Specified by:
      getEntityCount in interface ServerSensor<org.spongepowered.api.world.World>