这是 Cerulan 的分支,而 Cerulan 本身又是 Icterine 的分支。原维护者已有一年未更新此项目,因此我作为 Cerulean 的分支并沿用相同名称,将其更新至现代版本。
Cerulean 是一个优化 Minecraft 进度检查系统的模组,特别是针对导致严重卡顿的 InventoryChangeTrigger(物品栏变化触发器),在包含大量模组化进度的整合包中,该触发器可能会造成严重的延迟。Cerulean 是 Icterine 的分支,由 Txni 更新至 1.21.1 并添加了额外功能。
除了更新至 1.21.1 外,Cerulean 还增加了一个选项,允许每隔数个刻(ticks)才处理一次进度,这是 Achievements Optimizer(Achievements Optimizer 与原版 Icterine 不兼容)等模组使用的策略。该选项的处理方式确保了玩家每次拾取物品时,进度都会被处理——从而防止因移动物品而导致进度卡住的情况。
来自原版模组的说明:
- 优化了获取物品时的进度触发;
- 可能会破坏与原版的一致性,但不会影响原版进度,也不应影响绝大多数模组/数据包;
- 即使确实影响了某些内容,通过丢弃并重新拾取所需的其中一个物品,仍然可以获得该进度;
- 目前已知没有不兼容问题或故障;
- 所有对原版代码的注入均可在配置文件中禁用。
- 所有更改均为服务器端生效。
测试结果
在专用服务器上进行的实时测试,有 3 名活跃玩家在线,运行包含超过 200 个模组的自定义 Forge 整合包以及 BlazeandCave's Advancements Pack,后者增加了超过 950 个进度。使用 Spark 收集了一小时的统计数据。
使用 Icterine 时,InventoryChangeTrigger 的执行速度几乎快 2.5 倍(截至 1.1.0 版本),耗时约占一个刻时间的 7.5%,而不是原来的 20%。
Icterine 1.0.0 的统计对比(约快 2 倍):

原版 InventoryChangeTrigger 的工作原理
- 当游戏检测到玩家物品栏中的堆叠数量发生变化时,它会为该变化调用 InventoryChangeTrigger。这包括拾取物品、丢弃物品、丢弃整个堆叠以及在物品栏内移动物品。
- 此外,当你打开容器(箱子、熔炉等)时,游戏会认为你物品栏中的所有槽位都发生了变化,并为所有槽位(包括空槽位)调用触发器。
- InventoryChangeTrigger 会计算你物品栏中空槽、非空槽和完全填满的槽的数量。这些信息 可用于进度触发器,但在原版中并未使用。
- InventoryChangeTrigger 会遍历已注册的进度标准。
- 如果标准具有槽位数量要求且不匹配步骤 2 中的值,或者如果标准没有物品要求,则跳过该标准。
- 如果标准只有一个物品要求,则将变化的堆叠与该要求进行比对。
- 如果标准有多个物品要求(例如,“Cover me with debris” 需要拥有全套下界合金盔甲),每一个物品堆叠都会与每个要求进行比对(但已满足的要求会被移除,不再进行比对)。
- 物品匹配,尤其是针对标签(tag)的匹配,非常消耗性能。但游戏会先检查玩家的物品类型是否与要求中的类型匹配,然后再检查其他参数,如数量、附魔和其他 NBT 数据。
Icterine 的优化原理
- 在步骤 1 中,当丢弃堆叠或将它们移出物品栏(例如放入箱子)时,不调用 InventoryChangeTrigger。这由配置文件中的
ignore_triggers_for_emptied_stacks参数控制。 - 同样地,如果堆叠变化是由减少堆叠数量但未清空它引起的(例如,玩家从满堆叠中丢弃了一个物品),则不调用 InventoryChangeTrigger。由
ignore_triggers_for_decreased_stacks控制。 - 并且,如果堆叠数量增加但未达到任何进度的阈值,也不调用 InventoryChangeTrigger。例如,泥土堆叠数量从 52 增加到 53,但你的整合包中没有获得 53 个泥土的进度。由
optimize_triggers_for_increased_stacks控制。 - 修改游戏在玩家打开容器界面时检查物品变化的方式,这样你在打开任何东西时,就不会立即将所有堆叠视为已变化。由
initialize_inventory_last_slots控制。 - 在步骤 6 中,首先检查变化的槽位是否匹配任何要求,然后再检查物品栏中的其他堆叠。由
optimize_multiple_predicate_trigger控制。 - 在步骤 7 中,先比较堆叠数量以避免不必要的标签匹配。同时使用之前的堆叠数量以避免更多的不必要匹配。由
check_count_before_item_predicate_match控制。
支持的版本
Icterine v1.2.0 适用于 Minecraft Fabric/Quilt 1.18.2 至 1.19.4,以及 Forge 1.18.2 至 1.19.2 (forge moment)。
Icterine v1.3.0 具有与 v1.2.0 相同的功能,适用于 Fabric/Quilt 1.20 - 1.20.4,Forge 1.19.3 - 1.20.4,以及 NeoForge 1.20.1 - 1.20.4。
请使用 版本页面 上的过滤器来选择正确的文件。
如果你需要移植到其他版本,请提交 Issue,或在 Discord 服务器上提问。
This is fork of Cerulan which is actually a fork of Icterine. Original maintainer didn't update it for a year, so i updated to modern versions as a fork of Cerulean under same name.
Cerulean is a mod that optimizes Minecraft's advancement checking system, specifically the laggy InventoryChangeTrigger, which can cause heavy lag in modpacks with lots of modded advancements. Cerulean is fork of Icterine, updated to 1.21.1 by Txni with additional features.
Aside from being updated to 1.21.1, Cerulean adds an option to only process advancements every few ticks, which is the strategy used by mods like Achievements Optimizer (which does not work with the original Icterine). This option is handled in a way that ensures the first time an item is picked up per player, it is always processed for achievements--preventing cases where advancements would stall until you moved items around.
Summary from original mod:
- Optimizes triggering advancements for obtaining items;
- Might break parity with vanilla, but doesn't affect vanilla advancements and shouldn't affect the vast majority of mods/datapacks;
- Even if it does affect something, advancement still should be obtainable by just dropping and picking up one of required items;
- Currently, there are no known incompatibilities or issues;
- Every injection into vanilla code can be disabled in config file.
- All changes are server-side.
Results
Live test performed on dedicated server with 3 active players online, running custom Forge modpack with over 200 mods and BlazeandCave's Advancements Pack, which adds over 950 advancements. Stats collected using Spark for one hour.
With Icterine, InventoryChangeTrigger executes almost 2.5 times faster (as of version 1.1.0), spending about 7.5% of the tick time instead of 20%.
Stats comparison for Icterine 1.0.0 (~2 times faster):

How vanilla InventoryChangeTrigger works
- When the game detects that stack in player inventory has changed, it calls InventoryChangeTrigger for it. This includes picking up items, dropping items, dropping whole stacks, moving items in your inventory.
- Also, when you open a container (chest, furnace, etc.), game thinks that all the slots in your inventory changed, and calls trigger for all of them, including empty slots.
- InventoryChangeTrigger counts empty, non-empty and completely filled slots in your inventory. This information could be used in advancement triggers, but is not used in vanilla.
- InventoryChangeTrigger goes over registered advancement criteria.
- If criterion has slot count requirements and they don't match values from step 2, or if criterion doesn't have item requirements, criterion is skipped.
- If criterion has only one item requirement, changed stack is checked against this requirement.
- If criterion has multiple items requirements (e.g., "Cover me with debris" requires having full netherite armor set), every item stack in the inventory is checked against every requirement (but fulfilled requirements get removed and are no longer checked).
- Item matching, especially against tag, is very heavy. But the game first checks if the player's item type matches the one from the requirement, and only then checks other parameters like count, enchants and other NBT data.
How Icterine's optimizations work
- In step 1, do not call InventoryChangeTrigger when you drop stacks or move them out of your inventory (e.g. to chest). This is controlled by the
ignore_triggers_for_emptied_stacksparameter in config file. - Similarly, do not call InventoryChangeTrigger if stack change was caused by decreasing stack but not emptying it (e.g. player dropped single item from the full stack). Controlled by
ignore_triggers_for_decreased_stacks. - And also do not call InventoryChangeTrigger if stack size increased, but hasn't passed threshold for any advancement. For example, dirt stack size increased from 52 to 53, but there's no advancement for getting 53 dirt in your modpack. Controlled by
optimize_triggers_for_increased_stacks. - Modify how game checks for changed items when player opens container screen, so it doesn't treat all the stack as changed the second you open anything. Controlled by
initialize_inventory_last_slots. - In step 6, firstly check if changed slot matches any requirement, and only then check other stack in the inventory. Controlled by
optimize_multiple_predicate_trigger. - In step 7, compare the stack count first to avoid unneeded tag matching. Also use previous stack count to avoid even more unneeded matching. Controlled by
check_count_before_item_predicate_match.
Supported versions
Icterine v1.2.0 works with Minecraft Fabric/Quilt from 1.18.2 to 1.19.4, and Forge from 1.18.2 to 1.19.2 (forge moment).
Icterine v1.3.0 has the same features as v1.2.0 and works with Fabric/Quilt 1.20 - 1.20.4, Forge 1.19.3 - 1.20.4, and NeoForge 1.20.1 - 1.20.4.
Use filter on the versions page to choose the right file.
If you need port to any other version, please open an issue, or ask on Discord server.
下载 Cerulean Fork
下载 Cerulean Fork
下载 Cerulean Fork
下载 Cerulean Fork
下载 Cerulean Fork
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cerulean Fork
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cerulean Fork
下载 Cerulean Fork
下载 Cerulean Fork
下载 Cerulean Fork
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
评论 0
登录后参与评分
还没有评论,来抢沙发吧