873
收录服务器
1105
注册
29 037
玩家
OnePlayerSleep 单人睡觉
根据OnePlayerSept数据包,如果玩家睡着了,有条件地通过夜间/风暴
作 者 Leaf26
发布时间 2020年3月26日
支持核心 Spigot
原生版本
支持版本 1.16,1.17,1.18,1.19
点此下载

😴 OnePlayerSleep

OnePlayerSleep 是一款轻量级的 Spigot 插件,灵感来源于 OnePlayerSleep 数据包。它允许单人通过睡觉跳过夜晚和清除雷暴,为以社区为中心的 Minecraft 服务器增添活力。插件具有高度可配置性,包括睡眠消息、时间同步、幻影生成等。

✨ 特性

  • 可配置和扩展的睡眠消息列表,包括每条消息的几率。
  • 支持 Bukkit 颜色代码。
  • 支持 PlaceholderAPI。
  • 全局更新幻影生成标志。
  • 设置允许睡眠的时间范围(受原版睡眠时间的限制)。
  • 异步随机化和消息传递。
  • 可配置的夜晚流逝动画(tickrate 和每 tick 流逝的时间)。
  • 可配置的多世界和多维度时间同步。
  • 可配置的每个世界的消息传递。
  • 启用/禁用下界/末地睡觉。
  • 启用/禁用 AFK/消失检测。

⚙️ 功能

该插件通过设置一些任务来流逝时间,选择一条消息,并将消息传递给所有相关的玩家。

通过配置选项,您可以添加任意数量的睡眠消息,随机化每个玩家的消息,传递消息并与其他世界或维度同步,添加世界名称的占位符,重置所有相关玩家的 TIME_SINCE_REST 统计信息,设置一个睡眠冷却时间以防止睡眠消息泛滥,更改睡眠时夜晚流逝的速度,甚至缩短允许睡眠的时间范围。

如果实际上只有一个玩家在线看到消息,则会跳过该消息。 OnePlayerSleep 兼容 EssentialsX 和 SuperVanish 等插件,这些插件将 setSleepingIgnored 设置为 /afk 和 /vanish 的一部分。

📝 可配置、随机的睡眠消息

使用此插件,我们可以添加任意数量的具有自定义文本、自定义悬停文本、自定义唤醒文本,甚至 Bukkit 颜色代码的消息!

每条消息都有一个可配置的被选择的几率,从所有消息几率值的总和中选择。

🛏️ 可配置的睡眠功能

默认情况下,睡眠公告不会发送给其他世界的玩家,但配置允许我们共享时间并将公告发送到其他世界、其他维度或两者:

以及重新格式化 messages.yml 中的消息。

⏱️ 异步随机化

消息的随机选择是异步运行的,以保持主线程的性能。

📦 PAPI 支持

此插件支持所有消息中的 PlaceholderAPI 占位符,并且还有一些自己的占位符。

添加了两个占位符以与 PAPI 一起使用 (wiki):

  • %oneplayersleep_sleeping_player_count% - 当前正在睡觉的玩家数量
  • %oneplayersleep_total_player_count% - 插件未忽略的玩家数量

📊 bStats

📜 命令和权限

命令

  • /sleep - 强制跳过当前世界的时间。需要权限: oneplayersleep.sleep
  • /opsreload - 重载插件配置。需要权限: oneplayersleep.reload

🛠️ 配置

这是插件的配置文件示例:


# Configuration for OnePlayerSleep

settings:
  # Whether or not to enable debug mode.
  debug: false

  # The tick rate at which the night passes while sleeping.
  tickRate: 100

  # The amount of time passed per tick.
  timePassedPerTick: 100

  # The range of time that sleep is allowed in the overworld (0-23999)
  sleepStart: 0
  sleepEnd: 12000

  # Should players in vanish or afk be ignored?
  ignoreAfkPlayers: true
  ignoreVanishedPlayers: true

  # Should sleeping be enabled in the nether and the end?
  enableNetherSleeping: false
  enableEndSleeping: false

  # Whether or not to reset the TIME_SINCE_REST statistic.
  resetTimeSinceRest: true

  # How long to wait before sending another sleep message (in ticks).
  bedCooldown: 200

  # Should we sync the time across all worlds?
  syncTime: false

  # What should we sync to?
  syncTo:
    # Should we sync to the overworld?
    overworld: true
    # Should we sync to the nether?
    nether: false
    # Should we sync to the end?
    end: false

  # Per world settings
  perWorld:
    # The default settings for all worlds.
    default:
      # Should we send messages to this world?
      sendMessage: false

      # Should this world sync the time?
      syncTime: false
    # Example world settings
    world_nether:
      sendMessage: true
      syncTime: false

messages:
  # Whether or not to send messages to players who are sleeping.
  sendToSleeping: false

  # A list of messages that can be sent when a player sleeps.
  sleepMessages:
    - message: "&b%player_name% &7is now sleeping."
      chance: 100
    - message: "&b%player_name% &7has gone to bed."
      hoverText: "&7Good night!"
      chance: 50
    - message: "&b%player_name% &7is dreaming of adventure."
      wakeUpText: "&7They wake up refreshed!"
      chance: 25