ResidenceBridge
用于在 Velocity / BungeeCord 网络中共享 Residence 数据、传送请求和全局限制的跨服务器 Residence 桥接插件。
功能特性
/res create 和 /res rename 使用全局唯一的领地名称。
- 跨服务器
/res tp <name>,支持自动切换服务器并在目标服务器上执行最终的 Residence 传送。
- 跨服务器标签补全:在
/res tp、/res remove、/res rename 等命令中支持全球领地名称的自动补全。
- 全局
/res list 显示玩家在所有子服务器上的领地,管理员可使用 /res list <player> 查看其他玩家的领地。
- 全局领地数量限制,可按权限组配置,并与 LuckPerms 权限分配兼容。
- 基于权限的传送等待时间,期间取消移动和伤害;管理员或拥有特定权限的玩家可跳过等待。
- 跨服务器常用操作:
/res rename、/res give、/res remove 和 /res delete 会切换到拥有该领地的服务器并在那里执行原始命令。
- 定时 MySQL 同步所有本地 Residence 数据,适合安装在已运行的网络中。
- PlaceholderAPI 占位符:
%reslink_ressize%、%reslink_reslist_1%、%reslink_reslist_2% 等。
- 自定义消息支持传统
& 颜色代码和 &#RRGGBB RGB 颜色代码。
- 支持 Folia 调度的玩家任务。
依赖要求
| 组件 |
要求 |
| 子服务器 |
Paper / Spigot / Folia 1.16+ |
| Residence |
每个子服务器均已安装 |
| Velocity |
Velocity 3.x |
| 数据库 |
MySQL 5.7+ 或 MariaDB 10.4+ |
| PlaceholderAPI |
可选,仅在使用占位符时需要 |
配置检查清单
1. 子服务器 ID
请使用与 Velocity 服务器相同的名称:
# velocity.toml
[servers]
s1 = "127.0.0.1:25566"
s2 = "127.0.0.1:25567"
# s1/plugins/ResidenceBridge/config.yml
server-id: "s1"
# s2/plugins/ResidenceBridge/config.yml
server-id: "s2"
如果 server-id 与 Velocity 服务器名称不匹配,数据库同步仍可工作,但跨服务器切换将失败。
2. MySQL
所有子服务器必须使用同一个数据库。表会自动创建。
mysql:
host: "127.0.0.1"
port: 3306
database: "minecraft"
username: "root"
password: "password"
数据库用户需要 CREATE TABLE、ALTER TABLE、SELECT、INSERT、UPDATE 和 DELETE 权限。
3. 代理通道
Velocity 端的插件目前没有单独的配置。请在子服务器端保留以下配置:
velocity:
channel: "residencebridge:main"
fallback-bungee-channel: true
对于纯 Velocity 网络,可以将 fallback-bungee-channel 设置为 false;如果不确定,保持默认值即可。
4. 首次同步与调试
在现有网络上安装后,从每个子服务器的控制台运行:
rb sync
检查 ResidenceBridge 能读取到的内容:
rb debug
重要的调试字段:
| 字段 |
含义 |
Residence instance |
Residence 插件实例是否可用 |
Residence names / Residence values |
是否能读取 Residence API 数据 |
Residence file snapshots |
是否找到了保存的 Residence 文件快照 |
Snapshots |
将同步到 MySQL 的最终数据 |
如果 Snapshots 不为 0,rb sync 应将数据写入 MySQL。
命令与权限
| 命令 |
权限 |
默认 |
类型 |
描述 |
/res tp <name> |
Residence 原始权限 |
玩家 |
玩家 |
跨服务器传送到领地。ResidenceBridge 会将玩家切换到目标服务器并继续执行那里的 Residence 传送。 |
/res list |
Residence 原始权限 |
玩家 |
玩家 |
列出玩家在所有链接子服务器上的全球领地。 |
/res remove <name> |
Residence 原始权限 |
玩家 |
玩家 |
移除一个领地。如果该领地在其他服务器上,ResidenceBridge 会将玩家切换到拥有该领地的服务器并在那里执行操作。 |
/res delete <name> |
Residence 原始权限 |
玩家 |
玩家 |
别名风格的删除操作,必要时通过拥有服务器处理。 |
/res rename <old> <new> |
Residence 原始权限 |
玩家 |
玩家 |
重命名一个领地,同时保持整个网络中领地名称的全局唯一性。 |
/res give <name> <player> |
Residence 原始权限 |
玩家 |
玩家 |
将领地转移给另一个玩家。跨服务器所有权操作会路由到拥有服务器。 |
/res list <player> |
residencebridge.list.others |
OP |
管理员 |
列出另一个玩家的全球领地。 |
/rb reload |
residencebridge.command.reload |
OP |
管理员 |
重新加载子服务器配置。 |
/rb sync |
residencebridge.command.sync |
OP |
管理员 |
立即将本地 Residence 数据同步到 MySQL。 |
/rb debug |
residencebridge.command.debug |
OP |
管理员 |
打印 Residence 读取和同步诊断信息。 |
/residencebridge reload |
residencebridge.command.reload |
OP |
管理员 |
/rb reload 的别名。 |
基于权限的行为在 config.yml 中配置,并与 LuckPerms 配合良好,例如 lp group vip permission set reslink.count.vip true。默认示例:
| 权限 |
用途 |
ResLinkDefault |
3 秒传送等待 |
ResLinkDefaultCount |
3 个全球领地 |
reslink.tp.vip |
1 秒传送等待 |
reslink.count.vip |
10 个全球领地 |
residencebridge.list.others |
列出另一个玩家的全球领地 |
residencebridge.teleport.bypass |
无传送等待 |
residencebridge.limit.bypass |
无限全球领地数量 |
PlaceholderAPI
| 占位符 |
描述 |
%reslink_ressize% |
玩家的全球领地数量 |
%reslink_reslist_1% |
玩家的第一处领地名称 |
%reslink_reslist_2% |
玩家的第二处领地名称 |
数据库表
| 表名 |
用途 |
residence_bridge_index |
包含名称、服务器、世界、所有者和状态的全球领地索引 |
residence_bridge_pending_tp |
待处理的跨服务器传送请求 |
residence_bridge_pending_action |
待处理的跨服务器命令操作 |
ResidenceBridge
Cross-server Residence bridge for sharing Residence data, teleport requests, and global limits across a Velocity / BungeeCord network.
Features
- Globally unique residence names for
/res create and /res rename.
- Cross-server
/res tp <name> with automatic server switching and final Residence teleport on the target server.
- Cross-server tab completion for global residence names in
/res tp, /res remove, /res rename, and similar commands.
- Global
/res list showing residences owned by the player on every sub-server, plus /res list <player> for admins.
- Global residence count limits, configurable by permission group and compatible with LuckPerms permission assignments.
- Permission-based teleport wait time, with movement and damage cancellation; admins or a configured permission can skip the wait.
- Cross-server common actions:
/res rename, /res give, /res remove, and /res delete switch to the owning server and execute the original command there.
- Scheduled MySQL sync for all local Residence data, suitable for installing on an already running network.
- PlaceholderAPI placeholders:
%reslink_ressize%, %reslink_reslist_1%, %reslink_reslist_2%, and so on.
- Custom messages with legacy
& colors and &#RRGGBB RGB colors.
- Folia-aware scheduling for player tasks.
Requirements
| Component |
Requirement |
| Sub-server |
Paper / Spigot / Folia 1.16+ |
| Residence |
Installed on every sub-server |
| Velocity |
Velocity 3.x |
| Database |
MySQL 5.7+ or MariaDB 10.4+ |
| PlaceholderAPI |
Optional, only required for placeholders |
Configuration Checklist
1. Sub-server IDs
Use the same names as Velocity servers:
# velocity.toml
[servers]
s1 = "127.0.0.1:25566"
s2 = "127.0.0.1:25567"
# s1/plugins/ResidenceBridge/config.yml
server-id: "s1"
# s2/plugins/ResidenceBridge/config.yml
server-id: "s2"
If server-id does not match a Velocity server name, database sync can still work, but cross-server switching will fail.
2. MySQL
All sub-servers must use the same database. Tables are created automatically.
mysql:
host: "127.0.0.1"
port: 3306
database: "minecraft"
username: "root"
password: "password"
The database user needs CREATE TABLE, ALTER TABLE, SELECT, INSERT, UPDATE, and DELETE permissions.
3. Proxy Channel
The Velocity-side plugin currently has no separate config file. Keep this on the sub-server side:
velocity:
channel: "residencebridge:main"
fallback-bungee-channel: true
For pure Velocity networks, fallback-bungee-channel may be set to false; keeping the default is fine when unsure.
4. First Sync and Debugging
After installing on an existing network, run this from every sub-server console:
rb sync
Check what ResidenceBridge can read:
rb debug
Important debug fields:
| Field |
Meaning |
Residence instance |
Whether the Residence plugin instance is available |
Residence names / Residence values |
Whether Residence API data is readable |
Residence file snapshots |
Whether saved Residence files were found |
Snapshots |
Final data that will be synced to MySQL |
If Snapshots is not 0, rb sync should write data to MySQL.
Commands and Permissions
| Command |
Permission |
Default |
Type |
Description |
/res tp <name> |
Residence original permission |
Player |
Player |
Cross-server teleport to a residence. ResidenceBridge will switch the player to the target server and continue the Residence teleport there. |
/res list |
Residence original permission |
Player |
Player |
Lists the player's global residences across all linked sub-servers. |
/res remove <name> |
Residence original permission |
Player |
Player |
Removes a residence. If the residence is on another server, ResidenceBridge switches the player to the owning server and executes the action there. |
/res delete <name> |
Residence original permission |
Player |
Player |
Alias-style delete action handled through the owning server when needed. |
/res rename <old> <new> |
Residence original permission |
Player |
Player |
Renames a residence while keeping residence names globally unique across the network. |
/res give <name> <player> |
Residence original permission |
Player |
Player |
Transfers a residence to another player. Cross-server ownership actions are routed to the owning server. |
/res list <player> |
residencebridge.list.others |
OP |
Admin |
Lists another player's global residences. |
/rb reload |
residencebridge.command.reload |
OP |
Admin |
Reloads the sub-server config. |
/rb sync |
residencebridge.command.sync |
OP |
Admin |
Syncs local Residence data to MySQL immediately. |
/rb debug |
residencebridge.command.debug |
OP |
Admin |
Prints Residence read and sync diagnostics. |
/residencebridge reload |
residencebridge.command.reload |
OP |
Admin |
Alias of /rb reload. |
Permission-driven behavior is configured in config.yml and works well with LuckPerms, for example lp group vip permission set reslink.count.vip true. Default examples:
| Permission |
Purpose |
ResLinkDefault |
3-second teleport wait |
ResLinkDefaultCount |
3 global residences |
reslink.tp.vip |
1-second teleport wait |
reslink.count.vip |
10 global residences |
residencebridge.list.others |
List another player's global residences |
residencebridge.teleport.bypass |
No teleport wait |
residencebridge.limit.bypass |
Unlimited global residence count |
PlaceholderAPI
| Placeholder |
Description |
%reslink_ressize% |
Player's global residence count |
%reslink_reslist_1% |
Player's first residence name |
%reslink_reslist_2% |
Player's second residence name |
Database Tables
| Table |
Purpose |
residence_bridge_index |
Global residence index with name, server, world, owner, and status |
residence_bridge_pending_tp |
Pending cross-server teleport requests |
residence_bridge_pending_action |
Pending cross-server command actions |
评论 0
登录后参与评分
还没有评论,来抢沙发吧