Incompatibility between Connector and SpongeNeo due to RecipeManager missing in ResourceManagerHelperImpl#sort listeners
还没有人认领这个 Issue。
评估
调研方向
Start by reading ResourceManagerHelperImpl#sort(List<PreparableReloadListener>) and getWrapperLookup, then compare the reload listener list with and without SpongeNeo on Forge 1.21.1 using Forgified Fabric API. Reproduce with Connector 2.0.0-beta.8 and a Fabric mod such as BetterEnd, and inspect the linked crash log. Done means reloads no longer fail with “No RecipeManager found” while compatibility and tag behavior are checked.
由索引模型根据 Issue 内容生成。
描述
Minecraft version
1.21.1
Describe the bug
When running Connector (2.0.0-beta.8) together with SpongeNeo on Forge 1.21.1 using Forgified Fabric API, the server fails resource reloads because ResourceManagerHelperImpl#getWrapperLookup cannot find a RecipeManager in the reload listeners list. This happens because SpongeNeo’s reload listener handling changes the order and contents of the listener list before Connector/FAPI processing, so the vanilla RecipeManager is no longer present when FAPI sorts listeners.
Steps to reproduce
- Install connector on a SpongeNeo server
- Add some fabric mod such as betterend
- Then crashed cause the No RecipeManager found in listeners!
...
Logs
https://gist.github.com/Sam-Chai/308356f2317c3ff77194950dd3956b4f
Additional context
From the begining I found that it seems like connector caused this problem. But when I check the crash-report, I notice that this crash from the FFAPI.
The issue from connector: https://github.com/Sinytra/Connector/issues/1911
Cause
ResourceManagerHelperImpl#sort(List) assumes the provided list always contains a RecipeManager instance (vanilla behavior). SpongeNeo modifies the reload process so that the RecipeManager is not in the list when FAPI’s sort runs. This triggers the IllegalStateException.
Proposed Fix
Add a compatibility patch in Connector that, when SpongeNeo is detected, ensures a RecipeManager is present in the listeners list before FAPI attempts to resolve dependencies.
Suggested Implementation
A minimal Mixin to ResourceManagerHelperImpl#sort(List) with remap=false, inserting the vanilla RecipeManager from the running server if missing:
@Inject(method = "sort(Ljava/util/List;)V", at = @At("HEAD"))
private void connector$ensureRecipeManagerPresent(List<PreparableReloadListener> listeners, CallbackInfo ci) {
if (!FMLEnvironment.dist.isDedicatedServer() || !ModList.get().isLoaded("spongeneo")) return;
for (PreparableReloadListener l : listeners) if (l instanceof RecipeManager) return;
MinecraftServer server = ServerLifecycleHooks.getCurrentServer();
if (server == null) return;
ReloadableServerResources res = server.getServerResources().managers();
if (res == null) return;
RecipeManager rm = res.getRecipeManager();
if (rm == null) return;
listeners.add(0, rm);
}
This ensures that:
- It only runs on a dedicated server.
- It only triggers when SpongeNeo is loaded.
- It does nothing if a RecipeManager is already in the list.
- It adds the RecipeManager at the start of the list to preserve vanilla/FAPI expectations.
Result:
I fixed that. Connector and FFAPI with betterend running on a SpongeNeo server.
But I havn't test too much, and it semms caused some tag problem and I have to fix it.
- 主要语言
- Java
- 星标
- 181
- 派生
- 41
- 平均合并
- 10 天 5 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Sinytra/ForgifiedFabricAPI 的其他 Issue
-
Missing mixin in fabric-registry-sync-v0 suspected to break modded registry loading可能重新可做 @Su5eD 于 93 天前认领,目前没有进行中的 PR。 未关闭26.1.x bug
Sinytra/ForgifiedFabricAPI#280 · 6 条评论 · 已指派 1 人 ·
-
1.21.x bug
难度 4/5 3-5 天 新手友好度 45/100
Sinytra/ForgifiedFabricAPI#276 ·
-
1.21.x bug
难度 4/5 3-5 天 新手友好度 42/100
Sinytra/ForgifiedFabricAPI#269 ·
-
1.21.x bug
难度 3/5 1-2 天 新手友好度 53/100
Sinytra/ForgifiedFabricAPI#267 ·
-
1.21.x bug
难度 3/5 1-2 天 新手友好度 48/100
Sinytra/ForgifiedFabricAPI#265 · 6 条评论 ·
查看 Sinytra/ForgifiedFabricAPI 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
refinedmods/refinedstorage2#1421 ·
-
StepExamBenchmarkTest runs a loop and prints a timing but asserts nothing可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭jules
难度 1/5 1 小时以内 新手友好度 82/100
open-learning-exchange/myplanet#18199 · 1 条评论 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
Scheme-less stream URLs throw NullPointerException instead of URISyntaxException可能已有人在做 @blihio 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
pedroSG94/RootEncoder#2218 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
apache/rocketmq-dashboard#6872 ·
维护者通常 3 天内回复