此插件的功能
FemaleGenderPlugin 是 Female Gender Mod(Fabric / Forge)的一款轻量级 服务端插件。该模组本身允许每位玩家自定义其身体模型的渲染方式——但默认情况下,这些数据需要在客户端之间传输。在离线模式服务器中,或在直接客户端同步不可靠的情况下,其他玩家看到的将是过时或默认的身体模型。
本插件通过充当中继来解决这一问题:每个客户端只需将模组数据发送一次到服务器,服务器便会立即将其重新广播给所有其他玩家——无论服务器的在线模式设置如何,都能实现即时、一致的数据同步。无需玩家间协商,也不会遗漏更新。
主要特性
- 支持离线服务器 —— 同步完全在服务端进行,因此不依赖于像点对点同步那样依赖 Mojang 会话/皮肤基础设施。
- 自动实时重新同步 —— 在玩家加入、退出以及在游戏中更新模组设置时触发。所有在线玩家会立即看到更改。
- 广泛的模组版本支持 —— 支持协议版本 1 至 5,涵盖 Wildfire's Gender Mod 从
0.0.1 到当前发布的所有版本,同时支持 Fabric 和 Forge 数据包格式。
- 无需面向玩家的配置 —— 你的玩家无需进行任何设置。只要他们安装了模组,即可正常工作。
同步工作原理简述
- 玩家的客户端(运行 Female Gender Mod)通过模组的插件通道将其配置发送给服务器。
- 插件存储该配置,并立即为每位在线玩家重新序列化数据,使用适合接收者(Fabric 或 Forge)的正确数据包格式。
- 当新玩家加入时,所有人(包括新加入者)都会重新同步,确保没有人停留在过时的数据上。
配置
mod:
# 用于读取/写入模组数据包数据的协议格式。
# -1(默认值)始终使用最新已知协议,因此在常规插件/模组更新时无需修改此项。
# 一个未记录/不受支持的值将在启动时禁用插件。
protocol: -1
如果你需要固定特定的协议(例如,因为你的服务器故意运行较旧的模组构建),请显式设置:
| 协议 |
支持的模组版本 |
| 1 |
0.0.1 – 2.8.0 |
| 2 |
2.8.1 – 3.0.1 |
| 3 |
3.1.0 – 4.0.0 |
| 4 |
4.0.1 – 4.x (pre-5.0.0) |
| 5 |
5.0.0+ |
开发者 API
对于希望以编程方式接入性别数据的插件开发者,FemaleGenderPlugin 提供了一个公共 API 对象 (ru.mth.femalegender.api.FemaleGenderAPI) —— 可在 Kotlin 或 Java 中使用,无需额外库。在你的 plugin.yml / paper-plugin.yml 中添加此插件作为(软)依赖项,然后直接调用它。
针对特定查看者的覆盖 —— 仅让某位玩家对特定查看者显示不同的外观,而不修改该玩家自身存储的数据:
// 使 `target` 对 `viewer` 显示自定义配置,但仅对该查看者生效。
FemaleGenderAPI.setOverride(target = targetUuid, viewer = viewerUuid, configuration = customConfig)
// 移除覆盖
FemaleGenderAPI.clearOverride(target = targetUuid, viewer = viewerUuid)
FemaleGenderAPI.clearOverridesFor(target = targetUuid)
适用于伪装插件、角色扮演幻觉、管理工具,或任何需要“玩家 A 看到的玩家 B”与 B 的实际设置不同的系统。
强制性别(面向所有人) —— 权威地锁定玩家在所有查看者眼中的性别身份,例如由角色扮演申请表驱动,而不覆盖其其他个人设置(如胸部大小、物理效果等):
FemaleGenderAPI.setForcedGender(
target = playerUuid,
identity = GenderIdentities.FEMALE,
fallback = fallbackConfiguration // 仅在玩家从未发送过模组数据时使用
)
FemaleGenderAPI.clearForcedGender(playerUuid)
- 如果玩家已有真实的模组数据记录,则仅覆盖
generalOptions.genderIdentity —— 其余部分保持不变。
- 如果玩家从未发送过任何模组数据(未安装模组或尚未连接),则将完整使用提供的
fallback 配置,以便即使未安装模组的玩家也能向他人展示一致且可见的身份。
- 调用任一方法都会触发立即重新同步 —— 无需等待下一次加入/更新事件。
FemaleGenderAPI.getOverride(target, viewer) // 当前对特定配对生效的 ModConfiguration?
FemaleGenderAPI.getForcedGender(target) // 当前生效的 ForcedGender?
FemaleGenderAPI.forcedTargets() // 具有强制性别的 Set<UUID>
兼容性
- 服务端: Paper 1.21+(Java 21)
- 客户端: Female Gender Mod,Fabric 或 Forge,版本 0.0.1 至当前版本
- 未安装客户端模组的玩家不受影响,除非通过开发者 API 的强制性别后备功能进行干预
What this plugin does
FemaleGenderPlugin is a lightweight server-side plugin for Female Gender Mod (Fabric / Forge). The mod itself lets each player customize how their body is rendered — but by default that data has to travel client-to-client. On offline-mode servers, or whenever direct client sync isn't reliable, players end up seeing outdated or default bodies for everyone else.
This plugin fixes that by becoming the relay: every client sends its mod data to the server once, and the server re-broadcasts it to everyone else — instantly, consistently, and regardless of the server's online-mode setting. No player-to-player negotiation, no missed updates.
Key features
- Works on offline servers — sync happens entirely server-side, so it doesn't depend on Mojang session/skin infrastructure the way peer-to-peer syncing can.
- Automatic, real-time resync — triggered on join, on quit, and whenever a player updates their mod settings in-game. Everyone online sees changes immediately.
- Broad mod-version support — speaks protocol versions 1 through 5, covering Wildfire's Gender Mod from
0.0.1 all the way through current releases, for both the Fabric and Forge packet formats.
- No player-facing configuration — nothing to set up for your players. If they have the mod installed, it just works.
How syncing works, in short
- A player's client (running Female Gender Mod) sends its configuration to the server over the mod's plugin channel.
- The plugin stores it and immediately re-serializes it for every online player, in the correct packet format for each recipient (Fabric or Forge).
- When a new player joins, everyone (including the newcomer) gets re-synced, so nobody is stuck looking at stale data.
Configuration
mod:
# The packet format used for mod data reads/writes.
# -1 (default) always uses the newest known protocol, so you won't need
# to touch this on routine plugin/mod updates.
# An undocumented/unsupported value disables the plugin on launch.
protocol: -1
If you need to pin a specific protocol (e.g. because your server intentionally runs an older mod build), set it explicitly:
| Protocol |
Supported mod versions |
| 1 |
0.0.1 – 2.8.0 |
| 2 |
2.8.1 – 3.0.1 |
| 3 |
3.1.0 – 4.0.0 |
| 4 |
4.0.1 – 4.x (pre-5.0.0) |
| 5 |
5.0.0+ |
Developer API
For plugin developers who want to hook into gender data programmatically, FemaleGenderPlugin exposes a public API object (ru.mth.femalegender.api.FemaleGenderAPI) — usable from Kotlin or Java, no extra library needed. Add this plugin as a (soft-)dependency in your plugin.yml / paper-plugin.yml and call it directly.
Per-viewer overrides — make one player look different to a specific viewer only, without touching that player's own stored data:
// Make `target` appear with a custom configuration, but only to `viewer`.
FemaleGenderAPI.setOverride(target = targetUuid, viewer = viewerUuid, configuration = customConfig)
// Remove it again
FemaleGenderAPI.clearOverride(target = targetUuid, viewer = viewerUuid)
FemaleGenderAPI.clearOverridesFor(target = targetUuid)
Useful for disguise plugins, roleplay illusions, admin tooling, or any system where "what player A sees of player B" needs to diverge from B's real settings.
Forced gender (for everyone) — authoritatively lock a player's gender identity across all viewers, e.g. driven by an RP application form, without overwriting their other personal settings (bust size, physics, etc.):
FemaleGenderAPI.setForcedGender(
target = playerUuid,
identity = GenderIdentities.FEMALE,
fallback = fallbackConfiguration // used only if the player has never sent mod data at all
)
FemaleGenderAPI.clearForcedGender(playerUuid)
- If the player already has real mod data on record, only
generalOptions.genderIdentity is overridden — everything else stays theirs.
- If the player has never sent any mod data (mod not installed, or hasn't connected yet), the provided
fallback configuration is used in full, so even mod-less players can be given a consistent, visible identity to others.
- Calling either method triggers an immediate resync — no need to wait for the next join/update event.
FemaleGenderAPI.getOverride(target, viewer) // ModConfiguration? currently in effect for a specific pair
FemaleGenderAPI.getForcedGender(target) // ForcedGender? currently active
FemaleGenderAPI.forcedTargets() // Set<UUID> of everyone with a forced gender
Compatibility
- Server: Paper 1.21+ (Java 21)
- Client: Female Gender Mod, Fabric or Forge, versions 0.0.1 through current
- Players without the client mod installed are unaffected unless targeted via the developer API's forced-gender fallback
评论 0
登录后参与评分
还没有评论,来抢沙发吧