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
-
Method Summary
Modifier and TypeMethodDescriptionint
getChunkCount
(org.spongepowered.api.world.server.ServerWorld world) int
getEntityCount
(org.spongepowered.api.world.server.ServerWorld world) int
double
getTPS()
Iterable<org.spongepowered.api.world.server.ServerWorld>
Get the worlds running on the server platform.boolean
Check if server platform provides TPS calculation.
-
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 interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
- Returns:
- false if the server doesn't count TPS.
-
getOnlinePlayerCount
public int getOnlinePlayerCount()- Specified by:
getOnlinePlayerCount
in interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getTPS
public double getTPS()- Specified by:
getTPS
in interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getWorlds
Description copied from interface:ServerSensor
Get the worlds running on the server platform.- Specified by:
getWorlds
in 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:
getChunkCount
in interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getEntityCount
public int getEntityCount(org.spongepowered.api.world.server.ServerWorld world) - Specified by:
getEntityCount
in interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-
getOnlinePlayerNames
- Specified by:
getOnlinePlayerNames
in interfaceServerSensor<org.spongepowered.api.world.server.ServerWorld>
-