Incompatibility between Connector and SpongeNeo due to RecipeManager missing in ResourceManagerHelperImpl#sort listeners
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Java
- Étoiles
- 181
- Forks
- 41
- Merge moyen
- 16 h 38 min
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de Sinytra/ForgifiedFabricAPI
-
1.21.x bug
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
Sinytra/ForgifiedFabricAPI#276 ·
-
1.21.x bug
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
Sinytra/ForgifiedFabricAPI#269 ·
-
1.21.x bug
Difficulté 3/5 1-2 jours Accessibilité débutants 53/100
Sinytra/ForgifiedFabricAPI#267 ·
-
1.21.x bug
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
Sinytra/ForgifiedFabricAPI#265 · 6 commentaires ·
-
1.21.x bug
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
Sinytra/ForgifiedFabricAPI#263 · 2 commentaires ·
Toutes les issues de Sinytra/ForgifiedFabricAPI
Issues similaires
-
Component - Build
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
navikt/mock-oauth2-server#1149 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
oracle/graalvm-reachability-metadata#11318 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Stirling-Tools/Stirling-PDF#8709 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Javadoc config rendering issueOuvertearea/config
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
quarkusio/quarkus#57910 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour