UltiWorlds 是 UltiTools-API 框架下的多世界管理模块,提供完整的世界创建、传送、保护和背包隔离功能。
Requires UltiTools-API 6.3.0 or later; an older framework refuses to load this module. / 需要 UltiTools-API 6.3.0 或更高版本;更早的框架会拒绝加载本模块。
- 世界创建 - 支持多种环境类型(主世界/下界/末地)和地形类型(标准/超平坦/放大化/巨型生物群系)
- 创建向导 - 交互式对话引导,60秒超时保护
- 世界加载/卸载 - 动态加载和卸载世界,节省服务器资源
- 世界删除 - 安全删除世界(包含确认机制)
- 自动卸载 - 空世界自动卸载,可配置等待时间;检查间隔
auto_unload.check_interval(秒)可取 1 到 107374182,建议至少 10 秒,/ul reload即可生效
- 快速传送 - 支持GUI界面和命令行传送
- 传送冷却 - 可配置的传送冷却时间
- 出生点管理 - 每个世界独立的出生点设置
- 权限控制 - 每个世界可单独设置访问权限
- 方块保护 - 禁止破坏/放置方块
- 交互保护 - 禁止与方块交互
- 爆炸保护 - 防止爆炸破坏地形
- PVP 控制 - 每个世界独立的 PVP 开关
- 生物控制 - 独立控制怪物/动物生成
- 天气控制 - 锁定世界天气
- 独立背包 - 每个世界(组)独立的背包
- 末影箱隔离 - 每个世界独立的末影箱
- 经验隔离 - 可选的经验等级隔离
- 状态隔离 - 可选的生命值/饥饿度/药水效果隔离
- 世界分组 - 支持多个世界共享同一背包组
- 世界锁定 - 临时锁定世界入口
- 世界封禁 - 完全禁止进入世界
- 隐藏世界 - 从列表中隐藏世界
| 命令 | 权限 | 描述 |
|---|---|---|
/world |
ultiworlds.use |
打开世界列表 GUI |
/world list |
ultiworlds.use |
列出所有世界 |
/world tp <世界> |
ultiworlds.use |
传送到指定世界 |
/world info [世界] |
ultiworlds.use |
查看世界的全部设置(省略时为当前世界) |
/world wizard |
ultiworlds.admin.create |
启动创建向导 |
/world create <名称> [类型] |
ultiworlds.admin.create |
创建世界 |
/world delete <世界> |
ultiworlds.admin.delete |
删除世界 |
/world load <世界> |
ultiworlds.admin.load |
加载世界 |
/world unload <世界> |
ultiworlds.admin.unload |
卸载世界 |
/world setspawn |
ultiworlds.admin.setspawn |
设置世界出生点 |
/world set <世界> <选项> <值> |
ultiworlds.admin.settings |
修改世界设置 |
/world protect <世界> |
ultiworlds.admin.protect |
启用完整保护 |
/world unprotect <世界> |
ultiworlds.admin.protect |
禁用所有保护 |
/world block <世界> |
ultiworlds.admin.block |
禁止进入世界 |
/world unblock <世界> |
ultiworlds.admin.block |
允许进入世界 |
通过 /world set <世界> <选项> <值> 命令可以修改以下选项:
| 选项 | 值类型 | 描述 |
|---|---|---|
pvp |
true/false | PVP 开关 |
monsters |
true/false | 怪物生成 |
animals |
true/false | 动物生成 |
weather |
true/false | 天气变化 |
hidden |
true/false | 从列表隐藏 |
locked |
true/false | 锁定世界 |
blocked |
true/false | 禁止进入 |
autoUnload |
true/false | 无人时自动卸载 |
protectBreak |
true/false | 禁止破坏方块 |
protectPlace |
true/false | 禁止放置方块 |
protectInteract |
true/false | 禁止交互 |
protectExplosion |
true/false | 禁止爆炸破坏 |
displayname |
文本 | 显示名称 |
description |
文本 | 世界描述 |
icon |
Material | GUI 图标 |
# config/worlds.yml
# 默认世界名称
default_world: "world"
# 受保护的世界(不能自动卸载或删除)
protected_worlds:
- "world"
- "world_nether"
- "world_the_end"
# 服务器启动时自动加载的世界
load_worlds_on_start: []
# 自动卸载配置
auto_unload:
enabled: false
check_interval: 60 # 检查间隔(秒,1 到 107374182;建议至少 10)
unload_after: 300 # 空世界等待时间(秒)
# 传送配置
tp_to_world:
enabled: true
permission_per_world: false
cooldown: 10
# 背包隔离配置
world_isolation:
enabled: false
separate_inventory: true
separate_ender_chest: true
separate_experience: false
separate_health: false
separate_hunger: false
separate_effects: false
shared_worlds:
- "world,world_nether,world_the_end"| 权限 | 描述 |
|---|---|
ultiworlds.use |
基础使用权限 |
ultiworlds.admin |
管理员权限(包含所有子权限) |
ultiworlds.admin.create |
创建世界 |
ultiworlds.admin.delete |
删除世界 |
ultiworlds.admin.load |
加载世界 |
ultiworlds.admin.unload |
卸载世界 |
ultiworlds.admin.setspawn |
设置出生点 |
ultiworlds.admin.settings |
修改世界设置 |
ultiworlds.admin.protect |
管理世界保护 |
ultiworlds.admin.block |
管理世界访问 |
ultiworlds.bypass.locked |
绕过世界锁定 |
ultiworlds.bypass.blocked |
绕过世界封禁 |
ultiworlds.bypass.protection |
绕过世界保护 |
ultiworlds.world.* |
访问所有世界 |
ultiworlds.world.<世界名> |
访问指定世界 |
-
首次创建世界设置时,新版本用稳定 ID 防止同名重复记录;已有记录不迁移。 已有记录的 ID 和设置会被保留。 升级前已经存在的同名重复行不会自动合并或删除,模块仍读取存储返回的第一行;备份数据库并人工核对这些记录,不要假定升级会修复它们。 共享数据库的服务器应全部升级后再并发初始化此前没有设置行的世界;旧版本仍可能用随机 ID 插入重复行。 该保证针对完全相同的世界名,不合并仅大小写不同的名称,也不提供多进程共享 JSON 目录的协调(#57)。
-
手工编辑共享 SQLite 数据库中的布尔设置时,只能写
0或1。 修改世界设置时,模块会把该世界存储的每个值与读取时的值比较, 只在记录未被改动时才写入(见FEATURES.md的ultiworlds.settings.shared-db-external-change-kept)。SQLite 把布尔设置存为文本, 如果手工写入其他拼写,例如UPDATE world_settings SET pvp_enabled = 'false' …,之后对该世界设置的每一次修改都会被当作冲突拒绝, 控制台记录“更新世界设置失败”,直到该值被改回0或1。MySQL 按数值比较,不受其他拼写影响。无论 SQLite 还是 MySQL, 都不要手工把开关类或数值类设置写成NULL:模块会把它读成false或0,与存储的NULL永远不相等,于是之后对该世界设置的每一次修改 都会同样被拒绝,直到重新写入一个值——开关类设置写0或1,数值类设置写一个数字。 -
多台服务器共用同一个 SQLite 文件时,并发写入可能让一次设置修改失败。 如果另一台服务器正在写同一个 SQLite 文件, 而这时
/world set正在修改设置,SQLite 会直接拒绝本服务器的写入,而不是等待对方完成,于是这次修改失败:玩家看到框架的通用红字 “Command execution failed: Failed to conditionally update entity”,设置没有改变。另一台服务器写入的值会被保留,数据不会损坏。 重新执行一次命令即可。SQLite 并不适合多台服务器同时写同一个文件;多台服务器共享数据请使用 MySQL。
- World Creation - Multiple environment types (Normal/Nether/End) and terrain types (Normal/Flat/Amplified/Large Biomes)
- Creation Wizard - Interactive dialog with 60-second timeout protection
- Load/Unload - Dynamic world loading/unloading to save server resources
- World Deletion - Safe world deletion with confirmation
- Auto-Unload - Automatic unloading of empty worlds with configurable delay; the check interval
auto_unload.check_interval(seconds) accepts 1 to 107374182, at least 10 seconds is recommended, and/ul reloadapplies a change
- Quick Teleport - GUI and command-line teleportation
- Teleport Cooldown - Configurable cooldown between teleports
- Spawn Management - Independent spawn points per world
- Permission Control - Per-world access permissions
- Block Protection - Prevent block breaking/placing
- Interaction Protection - Prevent block interaction
- Explosion Protection - Prevent explosion damage
- PVP Control - Per-world PVP toggle
- Mob Control - Independent monster/animal spawn control
- Weather Control - Lock world weather
- Separate Inventory - Independent inventory per world (group)
- Ender Chest Isolation - Per-world ender chest
- Experience Isolation - Optional XP level isolation
- Status Isolation - Optional health/hunger/potion effect isolation
- World Groups - Multiple worlds can share the same inventory group
- World Lock - Temporarily lock world entrance
- World Block - Completely block world access
- Hidden Worlds - Hide worlds from the list
| Command | Permission | Description |
|---|---|---|
/world |
ultiworlds.use |
Open world list GUI |
/world list |
ultiworlds.use |
List all worlds |
/world tp <world> |
ultiworlds.use |
Teleport to world |
/world info [world] |
ultiworlds.use |
View all of a world's settings (the current world when omitted) |
/world wizard |
ultiworlds.admin.create |
Start creation wizard |
/world create <name> [type] |
ultiworlds.admin.create |
Create world |
/world delete <world> |
ultiworlds.admin.delete |
Delete world |
/world load <world> |
ultiworlds.admin.load |
Load world |
/world unload <world> |
ultiworlds.admin.unload |
Unload world |
/world setspawn |
ultiworlds.admin.setspawn |
Set world spawn |
/world set <world> <option> <value> |
ultiworlds.admin.settings |
Modify world settings |
/world protect <world> |
ultiworlds.admin.protect |
Enable full protection |
/world unprotect <world> |
ultiworlds.admin.protect |
Disable all protection |
/world block <world> |
ultiworlds.admin.block |
Block world access |
/world unblock <world> |
ultiworlds.admin.block |
Unblock world access |
- Install UltiTools-API 6.3.0 or later (required)
- Download UltiWorlds module
- Place in
plugins/UltiTools/plugins/directory - Restart server
- Configure
config/worlds.ymlas needed
-
First creation of world settings uses a stable ID to prevent same-name duplicate rows; existing rows are not migrated. Existing row IDs and settings are retained. Same-name duplicates created before upgrading are not merged or deleted; the module still reads the first row the store returns. Back up the database and inspect those rows manually rather than assuming an upgrade repairs them. Upgrade every server sharing the database before concurrently initializing a world that has no settings row: an older version can still insert a random-ID duplicate. The new-row guarantee is for the exact same world name; it does not merge case variants or coordinate processes sharing a JSON directory (#57).
-
When editing a boolean setting by hand in a shared SQLite database, write only
0or1. A world-settings change compares every stored value of that world with what it read and writes only if the row is unchanged (seeultiworlds.settings.shared-db-external-change-keptinFEATURES.md). SQLite stores boolean settings as text, so a hand edit that writes another spelling, such asUPDATE world_settings SET pvp_enabled = 'false' ..., makes every later change of that world's settings be refused as contended, and the console logs "Failed to update world settings", until the value is set back to0or1. MySQL compares numerically and is not affected by other spellings. On SQLite and MySQL alike, never writeNULLby hand into a true/false or number setting: it is read back asfalseor0, which never compares equal to the storedNULL, so every later change of that world's settings is refused the same way until a value is written back --0or1for a true/false setting, a number for a number setting. -
Several servers sharing one SQLite file: a concurrent write can make one settings change fail. If another server is writing to the same SQLite file while
/world setchanges a setting, SQLite refuses this server's write instead of waiting for the other writer, so that change fails: the player sees the framework's generic red "Command execution failed: Failed to conditionally update entity" and the setting is not changed. The other server's value is kept and nothing is corrupted. Run the command again. SQLite is not built for several servers writing one file; to share world settings between servers, use MySQL.
UltiWorlds 2.0 is the successor to the multi-world functionality in UltiTools 5.x. Key improvements:
| Feature | UltiTools 5.x | UltiWorlds 2.0 |
|---|---|---|
| Framework | Manual registration | Annotation-driven |
| Command System | AbstractTabExecutor | BaseCommandExecutor |
| Data Storage | AbstractDataEntity | BaseDataEntity |
| GUI | Manual InventoryHolder | BasePaginationPage |
| World Protection | Basic | Full (break/place/interact/explosion) |
| Inventory Isolation | None | Full with groups |
| Creation Wizard | None | Conversation API |
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- GitHub Issues: Report a bug
- Discord: UltiKits Community