Feathered Friend

Config

# 配置

Feathered Friend 有两个配置层:

  • 客户端配置 (featheredfriend-client.toml):UI 和本地首选项行为。
  • 服务器配置 (featheredfriend-server.toml):同步到客户端的游戏权威值。

在典型的开发运行中:

  • neoforge/run/config/featheredfriend-client.toml
  • neoforge/run/config/featheredfriend-server.toml
![羽毛好友配置和设置屏幕](assets/images/features/config/config.webp)
Feathered Friend in-game settings screen.
Authoritative model

服务器配置是游戏规则的真实来源。客户端接收同步值并应将它们视为只读,除非服务器允许编辑。


同步管道

  1. 客户端请求设置(RequestServerSettingsPayload)。
  2. 服务器发送完整快照 (ServerSettingsPayload)。
  3. 服务器还会在登录时推送设置。
  4. 服务器滴答观察器检查配置更改和重新广播。

因此,TOML 热重载和游戏内设置中的编辑都会传播到连接的客户端。


热重载行为

FFServerConfig 中的服务器配置值是运行时值。

FFConfigSyncEvents 监视值并在它们发生变化时重新广播,包括:

  • 功能切换(enableSuspiciousFeatherenableSuspiciousChestenableRavenArmorenableMailbox
  • 限制/冷却时间
  • 聊天切换

ravenLinkDurationSeconds 在活动会话期间会重新读取,因此当前链接可以在配置更改后立即缩短/延长。

DEEP DIVE: dirty-flag + save

FFServerConfig 中的设置器将设置标记为脏并尝试 SERVER_SPEC.save(),以便更改可以快速同步并保留到磁盘。


游戏内设置权限

自定义设置 GUI 通过 open_settings 键绑定(默认情况下未绑定)打开。

仅当两者都为 true 时才允许服务器端编辑:

  • allowServerSettingsScreenEditing = true
  • 玩家拥有4级操作员权限

否则,客户端可以查看同步值,但无法应用服务器设置编辑。


客户端配置(仅限本地)

客户端配置仅控制本地 UI/首选项,包括:

  • scrollUiFontModeVANILLAJACQUARDALAGARD
  • 乌鸦状态徽章位置/锚点/视觉模式
  • 最喜欢的印章钥匙
  • raven日志视图设置(类别可见性/颜色)

这些不会改变服务器的游戏玩法。


服务器配置(游戏权限)

settings 部分

KeyDefaultRangePurpose
chatDisabledDefaultfalseboolGlobal player chat disable (commands unaffected).
ravenChestsPerPlayer30..64Max placed Suspicious Chests per player.
ravenLogRetentionMinutes100800..129600Raven log retention window (minutes).
ravenLogMaxBytesPerPlayer2621440..4194304Max Raven log size per player before clear.
enderpackDepositCooldownSeconds6000..86400Cooldown between Enderpack -> chest deposit workflows.
scrollDeliveryCooldownSeconds6000..86400Cooldown between scroll courier dispatches.
courierTimeoutRetrySeconds600..86400Auto-retry interval for timeout-failed courier jobs.
brushRavenCooldownSeconds300..86400Cooldown between brushing ravens.
ravenLinkDurationSeconds305..600Raven Link session duration.
allowServerSettingsScreenEditingtrueboolAllows/disallows OP editing in settings screen.
features.enableSuspiciousFeathertrueboolEnables Suspicious Feather logic.
features.enableSuspiciousChesttrueboolEnables Suspicious Chest special logic.
features.enableRavenArmortrueboolEnables Raven Armor equip/stat logic.
features.enableMailboxtrueboolEnables mailbox spotting + courier mailbox routing.

spawning 部分

KeyDefaultRangePurpose
wildRavensPerPlayer10..16Wild raven cap per online non-spectator player.

如果功能切换关闭

功能切换禁用逻辑,而不是项目/块存在:

  • 现有的物品/方块仍然存在
  • 库存仍可访问
  • 跳过特定功能的运行时系统

示例:

  • enableMailbox=false:邮箱存储仍然打开,但发现/路由被禁用。
  • enableSuspiciousChest=false:箱子存储仍然有效,但栖息/存款逻辑被禁用。
  • enableSuspiciousFeather=false:Raven Link 启动/恢复路径已禁用。
Do not confuse 'disabled' with 'deleted'

禁用功能只是一种行为切换。它不会删除该功能的现有世界数据。

服务器快照示例

JSON
{
  "settings": {
    "ravenChestsPerPlayer": 3,
    "enderpackDepositCooldownSeconds": 600,
    "scrollDeliveryCooldownSeconds": 600,
    "ravenLinkDurationSeconds": 30,
    "allowServerSettingsScreenEditing": true,
    "features": {
      "enableSuspiciousFeather": true,
      "enableSuspiciousChest": true,
      "enableRavenArmor": true,
      "enableMailbox": true
    }
  },
  "spawning": {
    "wildRavensPerPlayer": 1
  }
}

支持这个项目

喜欢这个 Wiki 和这些模组吗?

你的每一份支持都能帮助我持续开发新功能、完善文档并发布更新。

返回顶部