Class NukkitSensor

  • All Implemented Interfaces:
    ServerSensor<cn.nukkit.level.Level>

    @Singleton
    public class NukkitSensor
    extends java.lang.Object
    implements ServerSensor<cn.nukkit.level.Level>
    • Constructor Detail

      • NukkitSensor

        @Inject
        public NukkitSensor​(PlanNukkit plugin)
    • Method Detail

      • supportsDirectTPS

        public boolean supportsDirectTPS()
        Description copied from interface: ServerSensor
        Check if server platform provides TPS calculation.
        Specified by:
        supportsDirectTPS in interface ServerSensor<cn.nukkit.level.Level>
        Returns:
        false if the server doesn't count TPS.
      • getTPS

        public double getTPS()
        Specified by:
        getTPS in interface ServerSensor<cn.nukkit.level.Level>
      • getChunkCount

        public int getChunkCount​(cn.nukkit.level.Level world)
        Specified by:
        getChunkCount in interface ServerSensor<cn.nukkit.level.Level>
      • getEntityCount

        public int getEntityCount​(cn.nukkit.level.Level world)
        Specified by:
        getEntityCount in interface ServerSensor<cn.nukkit.level.Level>
      • getWorlds

        public java.lang.Iterable<cn.nukkit.level.Level> getWorlds()
        Description copied from interface: ServerSensor
        Get the worlds running on the server platform.
        Specified by:
        getWorlds in interface ServerSensor<cn.nukkit.level.Level>
        Returns:
        Empty collection if the platform doesn't support worlds.