# 这是什么
如果你曾在服务器上运行过 Minecolonies,你可能遇到过这个问题:一旦玩家离开其殖民地超过几个区块,一切就会停止。市民不再去工作,建造者不再建造,农民不再种植。殖民地只是“进入休眠”。
罪魁祸首是 Spigot 的优化机制——实体激活范围(entity-activation-range)。它对普通生物很有用,但对 Minecolonies 来说弊大于利。默认情况下,当玩家距离超过 32 格时,服务器会停止处理实体的 AI。
这个插件解决了这个问题。它确保服务器始终“看到”你的殖民地市民,无论玩家身在何处。
# 工作原理
该插件运行一个后台任务,定期“唤醒”服务器上的所有 Minecolonies 市民。它直接与服务器的内部机制(NMS)协作,以绕过 Spigot 的默认距离检查。即使玩家远离或已下线,建造者仍会继续建造,守卫仍会巡逻,市民仍会继续工作。
该插件仅影响活体实体,因此不会在物品、经验球或矿车上浪费资源。
配置
config.yml 文件让你可以控制插件的行为:
activation-inticks: 插件检查和激活市民的频率。20 ticks = 1 秒。如果你的服务器规模较大且希望减少负载,可设置为 40。
max-entities-per-tick: 插件在一个周期内处理的市民数量。如果你有 300 名市民并将此值设置为 100,他们将在多个周期中分批激活。较低的值可减少 CPU 峰值。
debug: 如果你想查看控制台中的插件操作,请开启此项。这在测试时很有用,但在正常操作中最好保持关闭。
track-builder-actions: 记录建造者破坏和放置的方块。仅在排查建造者是否真正工作时需要启用。
keep-chunks-loaded-when-no-players: 设置为 true,即使服务器为空,也希望殖民地能全天候持续运行。
keep-chunks-loaded-when-players-online: 设置为 true,即使玩家距离较远但仍在线,也希望殖民地保持活跃。
chunk-ticket-update-inticks: 插件更新区块加载票证的频率。这比市民激活的频率低,以节省资源。
enable-ownership-check-for-force-load: 当为 true 时,插件仅为当前在线的所有者的市民加载区块。通过不加载非活跃殖民地来节省资源。
make-invulnerable-when-force-loaded: 当强制加载其所在区块时,使市民免受伤害。防止玩家在附近保护他们时市民被怪物杀死。
命令
主命令:/mcfix 或 /minecoloniesfix
所需权限:minecoloniesfix.admin(默认:操作员)
/mcfix — 显示可用命令列表。
/mcfix status — 显示当前插件状态:任务是否正在运行、缓存了多少实体、强制加载了多少区块以及当前设置。
/mcfix reload — 在不重启服务器的情况下重新加载 config.yml。在修改配置文件后使用此命令。
/mcfix scan — 强制插件重新扫描服务器上的 Minecolonies 实体并更新其缓存。在新殖民地创建后很有用。
/mcfix run — 手动触发一次激活周期。用于测试一切是否按预期工作。
/mcfix debug on/off/toggle — 开启、关闭或切换调试模式。更改将立即保存到 config.yml。
兼容性
服务器核心:Spigot、Paper、Purpur(1.20.1 及以上版本,应兼容低至 1.18 的版本)
模组:Minecolonies(任何使用标准实体机制的版本)
性能建议
对于拥有 5+ 个殖民地和超过 300 名市民的服务器,建议将 activation-interval-ticks 设置为 40,将 max-entities-per-tick 设置为 200。这可以分散工作量并保持运行流畅。
该插件设计为轻量级。它仅接触 Minecolonies 市民,对其他内容不加干涉,因此不会干扰其他插件或模组。
为什么存在这个插件
Minecolonies 是一个出色的模组,但它并非针对 Spigot 风格的实体激活限制而构建。如果没有此类修复,玩家必须停留在殖民地附近才能使其取得进展。这对于单人游戏来说没问题,但在多人服务器上,人们可能会在不同区域探索、建造或在不同时间下线,这就变成了一个真正的问题。
这个插件让殖民地即使在玩家没有站在它们旁边时也能自然繁荣发展。
# What Is This
If you've ever run a server with Minecolonies, you've probably run into this problem: as soon as a player moves more than a couple of chunks away from their colony, everything stops. Citizens stop going to work, builders stop building, farmers stop planting. The colony just "goes to sleep."
The culprit is Spigot's optimization mechanic — entity-activation-range. It's great for regular mobs, but for Minecolonies it does more harm than good. By default, the server stops processing entity AI when the player is more than 32 blocks away.
This plugin fixes that. It makes sure the server always "sees" your colony citizens, no matter where the player is.
# How It Works
The plugin runs a background task that periodically "wakes up" all Minecolonies citizens on the server. It works directly with the server's internal mechanics (NMS) to bypass Spigot's default distance checks. Builders keep building, guards keep patrolling, and citizens keep working — even when the player is far away or has logged off.
The plugin only affects living entities, so it won't waste resources on items, experience orbs, or minecarts.
Configuration
The config.yml file gives you control over how the plugin behaves:
activation-interval-ticks: How often the plugin checks and activates citizens. 20 ticks = 1 second. Set to 40 if you have a large server and want to reduce load.
max-entities-per-tick: How many citizens the plugin processes in one cycle. If you have 300 citizens and set this to 100, they'll be activated in batches over several cycles. Lower values reduce CPU spikes.
debug: Turn this on if you want to see what the plugin is doing in console. Useful for testing, but best kept off during normal operation.
track-builder-actions: Logs what blocks builders are breaking and placing. Only needed if you're troubleshooting whether builders are actually working.
keep-chunks-loaded-when-no-players: Set to true if you want colonies to keep running 24/7, even when the server is empty.
keep-chunks-loaded-when-players-online: Set to true if you want colonies to stay active even when players are far away but still online.
chunk-ticket-update-interval-ticks: How often the plugin updates chunk loading tickets. This runs less frequently than citizen activation to save resources.
enable-ownership-check-for-force-load: When true, the plugin only loads chunks for citizens whose owners are currently online. Saves resources by not loading inactive colonies.
make-invulnerable-when-force-loaded: Makes citizens invulnerable to damage when their chunks are force-loaded. Prevents them from dying to mobs when the player isn't around to protect them.
Commands
Main command: /mcfix or /minecoloniesfix
Permission required: minecoloniesfix.admin (default: operators)
/mcfix — Shows a list of available commands.
/mcfix status — Displays current plugin status: whether the task is running, how many entities are cached, how many chunks are force-loaded, and current settings.
/mcfix reload — Reloads config.yml without restarting the server. Use this after making changes to the config file.
/mcfix scan — Forces the plugin to rescan the server for Minecolonies entities and update its cache. Useful after new colonies are created.
/mcfix run — Manually triggers one activation cycle. Good for testing if everything is working as expected.
/mcfix debug on/off/toggle — Turns debug mode on, off, or toggles it. Changes are saved to config.yml immediately.
Compatibility
Server cores: Spigot, Paper, Purpur (1.20.1 and above, should work with versions back to 1.18)
Mod: Minecolonies (any version that uses standard entity mechanics)
Performance Tips
For servers with 5+ colonies and over 300 citizens, consider setting activation-interval-ticks to 40 and max-entities-per-tick to 200. This spreads out the workload and keeps things running smoothly.
The plugin is designed to be lightweight. It only touches Minecolonies citizens and leaves everything else alone, so it won't interfere with other plugins or mods.
Why This Exists
Minecolonies is a fantastic mod, but it wasn't built with Spigot-style entity activation limits in mind. Without a fix like this, players are forced to stay near their colonies for them to make any progress. That's fine for singleplayer, but on a multiplayer server where people explore, build in different areas, or log off at different times, it becomes a real problem.
This plugin lets colonies thrive naturally, even when players aren't standing right next to them.
评论 0
登录后参与评分
还没有评论,来抢沙发吧