? 功能
- 加载玩家特定中心周围的矩形区域或正方形及圆形区域。
- 限制每个刻(tick)和每个世界区域内的加载区块数量。
- 限制每个玩家允许的区域大小;按世界序列化区块加载,以保持服务器负载可预测。
- 查看加载进度、预计剩余时间、已保存区域以及服务器内存状态。
- 取消加载任务并释放由中断任务加载的区块。
- 重命名和调整已保存区域的大小。
- 导出和导入区域定义,并创建已保存区域数据的备份。
- 自动释放不活跃区域,同时保留其已保存的定义。
- 追踪多个区域共享的区块,以便卸载一个区域时不会释放另一个区域的区块。
? 命令
所有命令均可通过 /cpl 或 /chunkpreloader 使用。
| 命令 |
描述 |
/cpl start <x1,z1> <x2,z2> <name> |
使用两个方块坐标角点加载矩形区域。 |
/cpl center <x,z> |
在当前世界中设置以方块坐标表示的半径中心。 |
/cpl radius <radius-chunks> |
加载以你保存的中心为圆心的正方形区域,半径以区块为单位测量。区域名称自动生成。 |
/cpl circle <radius-chunks> <name> |
加载以你保存的中心为圆心的圆形区域,半径以区块为单位测量。 |
/cpl cancel [area-name] |
取消当前的激活加载任务,可选择指定其名称。 |
/cpl list |
列出已保存区域及其是否处于激活状态。 |
/cpl info <name> |
显示区域的所属世界、形状、区块数量和坐标。 |
/cpl status |
显示已保存区域数量、正在进行的加载任务数、管理的强制加载区块数以及内存使用情况。 |
/cpl unload <name> |
卸载并移除已保存的区域。 |
/cpl rename <old-name> <new-name> |
重命名已保存的区域。 |
/cpl resize <name> <x1,z1> <x2,z2> |
替换矩形区域的边界并加载新区域。 |
/cpl export <area-name> <file-name> |
将区域定义导出到插件的 exports 文件夹中。 |
/cpl import <file-name> <new-area-name> |
从 exports 文件夹导入定义并保存。 |
/cpl backup |
创建带有时间戳的已保存区域数据备份。 |
/cpl reload |
重新加载配置并恢复符合条件的已保存区域。 |
坐标与半径详情
start、center 和 resize 接受方块坐标,而非区块坐标。例如,100,200 表示方块 X=100 和方块 Z=200。坐标会被转换为它们所触及的区块。半径值以区块为单位;一个区块等于 16 个方块。/radius 创建正方形,/circle 创建以距离中心区块的区块距离测量的圆形足迹。
区域名称长度为 1–32 个字符,仅限字母、数字、下划线或连字符。导出文件名为 1–64 个字符,仅限字母、数字、下划线或连字符。在世界中单独设置中心;它仅对设置它的玩家私有。
? 权限
每个命令都有独立的权限节点。默认情况下,加载和只读命令授予基本访问权限;区域管理命令默认仅限操作员使用。
chunkpreloader.command.start, .center, .radius, .cancel, .list, .info, .status
chunkpreloader.command.unload, .rename, .resize, .export, .import, .backup, .reload
chunkpreloader.notifications:当 notifications.enabled 为 true 时接收通知。
chunkpreloader.admin:授予管理员权限,并绕过玩家特定的区域上限。
chunkpreloader.limit.<size>:授予匹配的已配置区域大小层级(例如 chunkpreloader.limit.5000)。
服务器配置的每世界限制是所有玩家的上限。如果没有 chunkpreloader.admin,有效限制是该上限与玩家默认或授予层级的较小值。
⚙️ 配置
默认的 config.yml 如下:
enabled-worlds:
- world
- world_nether
- world_the_end
performance:
# 每个活动任务每秒最多强制加载的区块数
chunks-per-tick: 100
# 区域可能包含的最大已保存/加载区块数
max-area-size: 10000
# 在开始大型加载前警告玩家
show-warnings: true
auto-unload:
# 如果区域没有玩家活动,则释放强制加载的区块
enabled: false
# 不活跃超时时间(分钟)
timeout: 1440
autosave:
# 每隔多少秒保存管理的区域定义
interval: 300
notifications:
# 当加载完成/失败或区域自动卸载时,通知有权限的在线玩家
enabled: false
permissions:
# 没有提升大小权限的玩家的最大区域大小
default-max-area-size: 1000
# 可通过 chunkpreloader.limit.<size> 获得的额外区块限制
area-size-limits:
- 5000
- 10000
world-specific:
world:
max-area-size: 10000
chunk-load-speed: 100
world_nether:
max-area-size: 5000
chunk-load-speed: 50
world_the_end:
max-area-size: 5000
chunk-load-speed: 50
enabled-worlds: 允许区域加载和恢复的世界。
performance.chunks-per-tick: 服务器每个刻(tick)处理加载的最大区块数默认值。数值越大,完成加载越快,但会增加服务器每个刻的工作量。
performance.max-area-size: 单个区域的最大区块数默认值;也是各世界限制的上限。
performance.show-warnings: 当加载区域超过玩家有效区域限制的一半时,向玩家发出警告。
auto-unload.enabled: 在区域空闲后释放其活跃区块的内存占用。已保存的区域定义仍会保留,当玩家返回该区域时可再次恢复。
auto-unload.timeout: 释放前无操作的时间长度,单位为分钟。
autosave.interval: 保存区域数据的时间间隔,单位为秒;低于 10 秒的值将被调整为 10。
notifications.enabled: 向拥有 chunkpreloader.notifications 权限且在线的玩家发送加载成功/失败通知以及自动卸载提示。
permissions.default-max-area-size: 未配置大小层级权限的玩家所能拥有的最大区块数上限。
permissions.area-size-limits: 可用的区域大小层级,对应权限为 chunkpreloader.limit.<size>。
world-specific.<world>.max-area-size: 指定世界的最大区域大小(以区块数计)。
world-specific.<world>.chunk-load-speed: 指定世界每刻处理的区块批次大小,覆盖全局批次设置。
当插件启动或重载时,无效或过小的安全设置会被钳制到安全的最小值。
? 已保存的区域与备份
区域定义会自动保存并在重启后恢复。若启用了空闲卸载功能,区块会被释放,但区域定义仍会保留;进入该区域范围可重新启动恢复过程。区域导出文件存储在插件的 exports 文件夹中,执行 /cpl backup 命令会将带时间戳的数据备份写入其 backups 文件夹。
由多个受管理区域共享的区块将保持强制加载状态,直到最后一个拥有该区块的区域被卸载为止。如果某个区块在插件开始管理之前就已存在强制加载设置,则当插件停止管理该区块时,原有的强制加载设置将会被恢复。
? Features
- Load rectangular areas or square and circular regions around a player-specific center.
- Limit loading to configured chunks per tick and per-world area sizes.
- Limit each player's permitted area size; chunk loading is serialized per world to keep server load predictable.
- View loading progress, estimated remaining time, saved areas, and server memory status.
- Cancel a load and release chunks loaded by an interrupted task.
- Rename and resize saved areas.
- Export and import area definitions and create backups of saved area data.
- Automatically release inactive areas while retaining their saved definitions.
- Track chunks shared by multiple areas so unloading one area does not release another area's chunks.
? Commands
All commands are available through /cpl or /chunkpreloader.
| Command |
Description |
/cpl start <x1,z1> <x2,z2> <name> |
Load a rectangular area using two block-coordinate corners. |
/cpl center <x,z> |
Set your radius center in block coordinates in your current world. |
/cpl radius <radius-chunks> |
Load a square centered on your saved center, with the radius measured in chunks. Area name is generated automatically. |
/cpl circle <radius-chunks> <name> |
Load a circular area centered on your saved center, with the radius measured in chunks. |
/cpl cancel [area-name] |
Cancel your active load, optionally specifying its name. |
/cpl list |
List saved areas and whether each is active. |
/cpl info <name> |
Show an area's world, shape, chunk count, and coordinates. |
/cpl status |
Show saved area count, active loading tasks, managed force-loaded chunk count, and memory use. |
/cpl unload <name> |
Unload and remove a saved area. |
/cpl rename <old-name> <new-name> |
Rename a saved area. |
/cpl resize <name> <x1,z1> <x2,z2> |
Replace a rectangular area's bounds and load the replacement. |
/cpl export <area-name> <file-name> |
Export an area definition into the plugin's exports folder. |
/cpl import <file-name> <new-area-name> |
Import a definition from the exports folder and save it. |
/cpl backup |
Create a timestamped backup of saved area data. |
/cpl reload |
Reload configuration and restore eligible saved areas. |
Coordinate and radius details
start, center, and resize accept block coordinates, not chunk coordinates. For example, 100,200 means block X=100 and block Z=200. The coordinates are converted to the chunks they touch. Radius values are in chunks; one chunk is 16 blocks. /radius creates a square. /circle creates a circular footprint measured by chunk distance from the center chunk.
Area names are 1–32 letters, numbers, underscores, or hyphens. Export names are 1–64 letters, numbers, underscores, or hyphens. Set a center separately in each world; it is private to the player who set it.
? Permissions
Each command has its own permission node. Basic access is granted by default for loading and read-only commands; area administration commands default to operators.
chunkpreloader.command.start, .center, .radius, .cancel, .list, .info, .status
chunkpreloader.command.unload, .rename, .resize, .export, .import, .backup, .reload
chunkpreloader.notifications receives notices when notifications.enabled is true.
chunkpreloader.admin grants administrative permissions and bypasses the player-specific area cap.
chunkpreloader.limit.<size> grants the matching configured area-size tier (for example, chunkpreloader.limit.5000).
The server's configured per-world limit is an upper bound for all players. Without chunkpreloader.admin, the effective limit is the lesser of that upper bound and the player's default or granted tier.
⚙️ Configuration
The default config.yml is:
enabled-worlds:
- world
- world_nether
- world_the_end
performance:
# Maximum number of chunks to force-load per server tick per active task
chunks-per-tick: 100
# Maximum number of saved/loading chunks an area may contain
max-area-size: 10000
# Warn players before starting large loads
show-warnings: true
auto-unload:
# Release force-loaded chunks after an area has had no player activity
enabled: false
# Inactivity timeout in minutes
timeout: 1440
autosave:
# Save managed area definitions every this many seconds
interval: 300
notifications:
# Notify permitted online players when a load finishes/fails or an area auto-unloads
enabled: false
permissions:
# Maximum area size for a player without an elevated size permission
default-max-area-size: 1000
# Additional chunk limits available through chunkpreloader.limit.<size>
area-size-limits:
- 5000
- 10000
world-specific:
world:
max-area-size: 10000
chunk-load-speed: 100
world_nether:
max-area-size: 5000
chunk-load-speed: 50
world_the_end:
max-area-size: 5000
chunk-load-speed: 50
enabled-worlds: Worlds where area loads and restorations are permitted.
performance.chunks-per-tick: Default maximum chunks a load processes per server tick. Larger values finish sooner but create more server work per tick.
performance.max-area-size: Default maximum chunks in one area; also the upper limit for per-world limits.
performance.show-warnings: Warn players before a load larger than half their effective area limit.
auto-unload.enabled: Release active area chunks after inactivity. Saved definitions remain and can be restored when a player returns to the area.
auto-unload.timeout: Inactivity duration in minutes before release.
autosave.interval: Interval in seconds between saving area data; values below 10 seconds are raised to 10.
notifications.enabled: Send load success/failure and auto-unload notices to online players with chunkpreloader.notifications.
permissions.default-max-area-size: Chunk cap for players without a configured size-tier permission.
permissions.area-size-limits: The size tiers available as chunkpreloader.limit.<size> permissions.
world-specific.<world>.max-area-size: Maximum area size in chunks for that world.
world-specific.<world>.chunk-load-speed: Per-tick chunk batch size for that world, overriding the global batch setting.
Invalid or too-small safety settings are clamped to safe minimums when the plugin starts or reloads.
? Saved areas and backups
Area definitions are saved automatically and restored after a restart. With inactivity unloading enabled, chunks are released but the definition is retained; entering its area can start restoration again. Area exports are stored in the plugin's exports folder, and /cpl backup writes timestamped data backups to its backups folder.
Chunks shared by multiple managed areas remain force-loaded until the final owning area is unloaded. Any force-load setting that was already present before the plugin began managing a chunk is restored when the plugin releases its management of that chunk.
评论 0
登录后参与评分
还没有评论,来抢沙发吧