Class SpongeSensor

  • All Implemented Interfaces:
    ServerSensor<org.spongepowered.api.world.World>

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

      Constructors 
      Constructor Description
      SpongeSensor​(org.spongepowered.api.Game game)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getChunkCount​(org.spongepowered.api.world.World world)  
      int getEntityCount​(org.spongepowered.api.world.World world)  
      int getOnlinePlayerCount()  
      double getTPS()  
      java.lang.Iterable<org.spongepowered.api.world.World> getWorlds()
      Get the worlds running on the server platform.
      boolean supportsDirectTPS()
      Check if server platform provides TPS calculation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SpongeSensor

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

      • 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.
      • getTPS

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

        public java.lang.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>