Skip to content

Fix Forge configurable type actions not always being set - #253

Merged
rubensworks merged 1 commit into
master-26-ltsfrom
fix-forge-configurable-types-race
Oct 10, 2026
Merged

rubensworks merged 1 commit into
master-26-ltsfrom
fix-forge-configurable-types-race

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Fixes CyclopsMC/EverlastingAbilities#329

Problem

On Forge, ConfigurableTypesForge.load() was only called from CyclopsCoreForge.onConfigsRegister. Forge constructs mods in parallel, and dependents such as EverlastingAbilities declare ordering="NONE" on cyclopscore. So a dependent mod could run loadModInit() before CyclopsCore had swapped in the Forge actions. Its configs then used the default actions instead of GuiActionForge, ItemActionForge, BlockActionForge and ParticleActionForge.

For GUIs this means the menu type is never wrapped in ContainerFactoryWrapperForge. Forge's OpenContainer then falls back to MenuType.create(id, inv), which passes a null buffer to IContainerFactoryCommon. The result is the NPE in ItemLocation.readFromPacketBuffer and a client disconnect (see the linked issue).

This is a regression from the 1.21.6 update. That update moved the call out of ModBaseForge's static initializer because load() needed the mod instance at the time. The 26.1 update dropped that parameter again but left the call where it was.

Fix

Restore the static { ConfigurableTypesForge.load(); } block in ModBaseForge, matching 1.21-lts and the current NeoForge and Fabric loaders. The Forge action classes have no constructor arguments or static state, so creating them at class-load time is safe.

Testing

  • ./gradlew :loader-forge:build passes.
  • ./gradlew :loader-forge:runGameTestServer passes (4/4).
  • There's no dedicated regression test because the bug is a race between mod constructors. I did not reproduce the crash in a client.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YMNuC5qun9MuBrCbBBhDBh


Generated by Claude Code

ConfigurableTypesForge.load() was only called from CyclopsCoreForge's
config registration. Since Forge constructs mods in parallel, dependent
mods could register their configs before this ran, causing them to use
the default actions. For GUIs, this meant menu types were not wrapped in
an IContainerFactory, so the client received a null buffer when opening
a menu with extra data.

Closes CyclopsMC/EverlastingAbilities#329

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMNuC5qun9MuBrCbBBhDBh
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 31.409%. remained the same — fix-forge-configurable-types-race into master-26-lts

@rubensworks
rubensworks merged commit 595ff85 into master-26-lts Oct 10, 2026
6 checks passed
@rubensworks
rubensworks deleted the fix-forge-configurable-types-race branch October 10, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using totem bug

3 participants