类 PlayerTimeApi

java.lang.Object
cn.handyplus.time.api.PlayerTimeApi

public final class PlayerTimeApi extends Object
PlayerTime API。
从以下版本开始:
1.1.1
  • 方法详细资料

    • getSecond

      public static long getSecond(UUID playerUuid, TimeScopeEnum scope)
      获取玩家指定范围的在线秒数。
      参数:
      playerUuid - 玩家 UID
      scope - 统计范围
      返回:
      在线秒数,玩家无记录时为 0
      抛出:
      IllegalArgumentException - 统计范围为空或不受支持时抛出
    • getTime

      public static long getTime(UUID playerUuid, TimeScopeEnum scope, TimeUnit unit)
      获取玩家指定范围、指定单位的在线时长。
      参数:
      playerUuid - 玩家 UID
      scope - 统计范围
      unit - 时间单位
      返回:
      指定单位的在线时长,不足一个单位的部分向下取整