Skip to content

feat: add Forge/NeoForge patched-source tools (Phase 4) - #18

Merged
GhostTypes merged 2 commits into
MCDxAI:mainfrom
winxpqq955:claude/forge-patched-source-tools
Oct 20, 2026
Merged

GhostTypes merged 2 commits into
MCDxAI:mainfrom
winxpqq955:claude/forge-patched-source-tools

Conversation

@winxpqq955

Copy link
Copy Markdown
Contributor

What

Seven MCP tools that build and serve the Minecraft source as modified by Forge/NeoForge (loader sources included, mojmap-only), fetched automatically via NeoFormRuntime — no more hand-built patched JARs:

Substantive: list_forge_versions, decompile_forge_minecraft_version
Thin wrappers (lazy-built): get_forge_source, get_forge_minecraft_source, search_forge_code, search_forge_minecraft_code, compare_vanilla_vs_forge

How

  • forge-maven.ts — loader versions from the loader Mavens (recommended builds via promotions_slim, NeoForge -beta markers, 24h in-process TTL)
  • nfrt.ts — wraps neoform-runtime 2.0.31 (lazily downloaded): --dist joined --neoforge <gav>:userdev, requesting gameSourcesWithNeoForge (merged MC+loader sources) + gameJarWithNeoForge
  • forge-source-service.ts — feeds both into the existing decompileLocalJar (direct extraction) + registerAsRemappedJar (AT validation keeps working). The tree lands under the existing opaque <mc>-<loader>-<ver> key, so every vanilla tool reads it unchanged
  • NFRT-forge works — first in-repo run of Forge artifacts through NFRT (the CI FG6 fixture is no longer the only route for 1.20.1)

Robustness

  • extractSourcesJar now stages + swaps atomically — a killed extraction can no longer leave a partial tree that reads as a warm cache
  • NFRT failures delete truncated result files
  • Cached reads with an explicit loaderVersion skip version metadata entirely (offline-friendly)

Testing

  • 609/609 default suite (tool count 21 → 28, both hardcoded assertions updated)
  • New: 16 offline unit tests (version parsing/mapping, orchestration incl. offline fast path + in-flight lock + force, extraction atomicity)
  • Manual E2E (npm run test:manual:forge, env-gated): NeoForge 1.21.1 5/5, Forge 1.20.1 5/5 — patched LivingEntity verified to contain the ForgeHooks.onLivingHurt injection

Seven MCP tools that build and serve the Minecraft source as modified
by Forge/NeoForge (loader sources included, mojmap-only), fetched
automatically via NeoFormRuntime instead of requiring a hand-built
patched JAR:

- list_forge_versions / decompile_forge_minecraft_version (substantive)
- get_forge_source / get_forge_minecraft_source / search_forge_code /
  search_forge_minecraft_code / compare_vanilla_vs_forge (thin wrappers
  over the existing patched-key machinery, lazy-built on first use)

Pipeline: forge-maven.ts resolves loader versions from the loader Mavens
(recommended builds via promotions_slim, NeoForge -beta markers, 24h
in-process TTL) -> nfrt.ts wraps neoform-runtime 2.0.31 (downloaded
lazily; --dist joined --neoforge <gav>:userdev, works for Forge via
--add-repository) requesting gameSourcesWithNeoForge + gameJarWithNeoForge
-> forge-source-service.ts feeds them to the existing decompileLocalJar
(direct extraction) and registerAsRemappedJar (keeps AT validation
working). The tree lands under the same opaque <mc>-<loader>-<ver> key,
so every vanilla tool reads it unchanged. NFRT artifacts are cached so
force rebuilds in seconds.

Robustness: extractSourcesJar now stages into a sibling dir and swaps
atomically (a killed extraction can no longer leave a partial tree that
reads as a warm cache), NFRT failures delete truncated result files, and
cached reads with an explicit loader version skip version metadata
entirely (works offline).

Tool count 21 -> 28; docs, skills, CLAUDE.md, AGENTS.md and CHANGELOG
updated. Verified: 609/609 default suite tests, manual E2E 5/5 for both
NeoForge 1.21.1 and Forge 1.20.1 (incl. first in-repo NFRT-forge run).
The design rationale lives in CLAUDE.md (Phase 4 tool notes) and the
CHANGELOG entry; raw planning documents don't belong in the package.
@GhostTypes GhostTypes self-assigned this Oct 20, 2026
@GhostTypes
GhostTypes merged commit 84b42fb into MCDxAI:main Oct 20, 2026
1 check passed
@GhostTypes

Copy link
Copy Markdown
Contributor

Sorry for the late reply and thank you for your work!

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.

2 participants