Class FabricSensor
java.lang.Object
net.playeranalytics.plan.gathering.FabricSensor
- All Implemented Interfaces:
ServerSensor<net.minecraft.server.world.ServerWorld>
@Singleton
public class FabricSensor
extends Object
implements ServerSensor<net.minecraft.server.world.ServerWorld>
-
Constructor Summary
ConstructorsConstructorDescriptionFabricSensor(net.minecraft.server.dedicated.MinecraftDedicatedServer server) -
Method Summary
Modifier and TypeMethodDescriptionintgetChunkCount(net.minecraft.server.world.ServerWorld world) intgetEntityCount(net.minecraft.server.world.ServerWorld world) Optional<long[]> getMspt()Milliseconds per tick stored in the MinecraftServer class.intdoublegetTPS()Iterable<net.minecraft.server.world.ServerWorld> Get the worlds running on the server platform.booleanCheck 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
isBanned, supportsBans, usingRedisBungee
-
Constructor Details
-
FabricSensor
@Inject public FabricSensor(net.minecraft.server.dedicated.MinecraftDedicatedServer server)
-
-
Method Details
-
getTPS
public double getTPS()- Specified by:
getTPSin interfaceServerSensor<net.minecraft.server.world.ServerWorld>
-
getWorlds
Description copied from interface:ServerSensorGet the worlds running on the server platform.- Specified by:
getWorldsin interfaceServerSensor<net.minecraft.server.world.ServerWorld>- Returns:
- Empty collection if the platform doesn't support worlds.
-
getEntityCount
public int getEntityCount(net.minecraft.server.world.ServerWorld world) - Specified by:
getEntityCountin interfaceServerSensor<net.minecraft.server.world.ServerWorld>
-
getChunkCount
public int getChunkCount(net.minecraft.server.world.ServerWorld world) - Specified by:
getChunkCountin interfaceServerSensor<net.minecraft.server.world.ServerWorld>
-
supportsDirectTPS
public boolean supportsDirectTPS()Description copied from interface:ServerSensorCheck if server platform provides TPS calculation.- Specified by:
supportsDirectTPSin interfaceServerSensor<net.minecraft.server.world.ServerWorld>- Returns:
- false if the server doesn't count TPS.
-
getOnlinePlayerCount
public int getOnlinePlayerCount()- Specified by:
getOnlinePlayerCountin interfaceServerSensor<net.minecraft.server.world.ServerWorld>
-
getOnlinePlayerNames
- Specified by:
getOnlinePlayerNamesin interfaceServerSensor<net.minecraft.server.world.ServerWorld>
-
getInstalledPlugins
- Specified by:
getInstalledPluginsin interfaceServerSensor<net.minecraft.server.world.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<net.minecraft.server.world.ServerWorld>- Returns:
- Optional empty if not supported on the platform.
-