CobbleChunkManager
一个面向 Minecraft 1.21.1 上 Cobblemon 1.7+ 的服务端 Fabric 模组,用于管理每个区块的宝可梦实体密度,从而减少服务器延迟。
功能说明
生成阻止 — 挂钩到 Cobblemon 的生成事件,当区块已达到实体配额(默认每区块 16 个)时取消宝可梦的生成。这是主要的性能优化功能——从源头上阻止实体创建,降低服务器上的实体总数。
热力图系统 — 追踪每个已加载区块的活动情况:宝可梦数量、玩家存在状态、活跃战斗。每个区块被分类为 HOT(有玩家/战斗的活跃区域)、WARM(中度活跃)或 COLD(空闲/无活动)。每 5 秒扫描 50 个区块。
配额执行 — 每 10 秒查找超出实体配额的区块,并使用配置的策略处理多余的野生宝可梦:
- MIGRATE(迁移)—— 将多余宝可梦传送至附近有空间的相邻区块
- DESPAWN(移除)—— 移除多余的野生宝可梦
- MIGRATE_THEN_DESPAWN(默认)—— 优先尝试迁移,无法重新安置的则直接移除
仅影响未参与战斗或未忙碌的野生宝可梦。拥有的宝可梦永远不会受到影响。
AI 节流 — 禁用 COLD 区块中宝可梦的原版 AI(寻路、移动目标等)。仅在区块热度等级发生变化时触发,因此每刻(per-tick)的性能开销几乎为零。
命令
- /ccm heatmap [radius] —— 显示附近区块的热力等级和实体数量的可视化网格
- /ccm status —— 当前区块的详细信息
- /ccm budget —— 全服配额概览,列出超出配额的区块
- /ccm migrate —— 手动触发当前区块的溢出处理
- /ccm reload —— 热重载配置文件
配置
所有值均可通过 config/cobble_chunk_manager.json 进行配置——包括阈值、配额限制、扫描间隔、溢出策略、迁移行为等。
CobbleChunkManager
A server-side Fabric mod for Cobblemon 1.7+ on Minecraft 1.21.1 that manages per-chunk Pokemon entity density to reduce server lag.
What it does
Spawn Prevention — Hooks into Cobblemon's spawn event and cancels Pokemon spawns in chunks that are already at the entity budget (default 16 per chunk). This
is the main performance feature — it stops entities from being created in the first place, reducing total entity count on the server.
Heatmap System — Tracks every loaded chunk's activity: Pokemon count, player presence, active battles. Each chunk is classified as HOT (active area with
players/battles), WARM (moderate activity), or COLD (empty/idle). Scans 50 chunks every 5 seconds.
Budget Enforcement — Every 10 seconds, finds chunks over the entity budget and handles the excess wild Pokemon using the configured strategy:
- MIGRATE — teleport excess to nearby chunks with free space
- DESPAWN — remove excess wild Pokemon
- MIGRATE_THEN_DESPAWN (default) — try to migrate first, despawn whatever can't be relocated
Only wild Pokemon that aren't in battle or busy are affected. Owned Pokemon are never touched.
AI Throttling — Disables vanilla AI (pathfinding, movement goals) for Pokemon in COLD chunks. Only triggers when a chunk's heat level changes, so the per-tick
cost is near zero.
Commands
- /ccm heatmap [radius] — visual grid of nearby chunk heat levels and entity counts
- /ccm status — detailed info for the current chunk
- /ccm budget — server-wide budget overview, lists over-budget chunks
- /ccm migrate — manually trigger overflow handling in the current chunk
- /ccm reload — hot-reload the config file
Config
All values are configurable via config/cobble_chunk_manager.json — thresholds, budget limits, scan intervals, overflow strategy, migration behavior.
评论 0
登录后参与评分
还没有评论,来抢沙发吧