Package com.djrapitops.plan.gathering
Class SpongeSensor
java.lang.Object
com.djrapitops.plan.gathering.SpongeSensor
- All Implemented Interfaces:
ServerSensor<org.spongepowered.api.world.server.ServerWorld>
@Singleton
public class SpongeSensor
extends Object
implements ServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetChunkCount(org.spongepowered.api.world.server.ServerWorld world) intgetEntityCount(org.spongepowered.api.world.server.ServerWorld world) Optional<long[]> getMspt()Milliseconds per tick stored in the MinecraftServer class.intdoublegetTPS()Iterable<org.spongepowered.api.world.server.ServerWorld> Get the worlds running on the server platform.booleanbooleanbooleanCheck if server platform provides TPS calculation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.djrapitops.plan.gathering.ServerSensor
usingRedisBungee
-
Constructor Details
-
SpongeSensor
@Inject public SpongeSensor(org.spongepowered.api.Game game)
-
-
Method Details
-
supportsDirectTPS
public boolean supportsDirectTPS()Description copied from interface:ServerSensorCheck if server platform provides TPS calculation.- Specified by:
supportsDirectTPSin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>- Returns:
- false if the server doesn't count TPS.
-
getOnlinePlayerCount
public int getOnlinePlayerCount()- Specified by:
getOnlinePlayerCountin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getTPS
public double getTPS()- Specified by:
getTPSin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getWorlds
Description copied from interface:ServerSensorGet the worlds running on the server platform.- Specified by:
getWorldsin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>- Returns:
- Empty collection if the platform doesn't support worlds.
-
getChunkCount
public int getChunkCount(org.spongepowered.api.world.server.ServerWorld world) - Specified by:
getChunkCountin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getEntityCount
public int getEntityCount(org.spongepowered.api.world.server.ServerWorld world) - Specified by:
getEntityCountin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getOnlinePlayerNames
- Specified by:
getOnlinePlayerNamesin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getInstalledPlugins
- Specified by:
getInstalledPluginsin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
supportsBans
public boolean supportsBans()- Specified by:
supportsBansin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
isBanned
- Specified by:
isBannedin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getMspt
Description copied from interface:ServerSensorMilliseconds per tick stored in the MinecraftServer class.Contains 0 values that are initialized on server boot, which should be ignored.
- Specified by:
getMsptin interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>- Returns:
- Optional empty if not supported on the platform.
-