You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -289,8 +289,10 @@ The code should work automatically, but be aware:
289
289
- Compact and efficient
290
290
- Well-supported by tools
291
291
292
-
### Patched MC JARs (Forge/NeoForge) — opaque version key
293
-
For `decompile_minecraft_version` with `jarPath`, the `version` parameter is treated as an opaque cache-key string (convention: `<mc>-<loader>-<loaderVersion>`). No parsing — the same key flows unchanged through `getDecompiledPath`, the cache DB, the FTS5 index, and every downstream tool. This is why patched MC slots into the existing `decompiled/{version}/{mapping}/` layout with zero new code paths in search/index/compare. `find_mapping` is the one exception: it strips the loader suffix via `stripPatchedVersion` so tinyfile lookups still resolve to the vanilla MC's mapping data.
292
+
### Patched MC JARs (Forge/NeoForge) — opaque version key, mojmap-only
293
+
For `decompile_minecraft_version` with `jarPath`, the `version` parameter is treated as an opaque cache-key string (convention: `<mc>-<loader>-<loaderVersion>`). No parsing — the same key flows unchanged through `getDecompiledPath`, the cache DB, the FTS5 index, and every downstream tool. This is why patched MC slots into the existing `decompiled/{version}/{mapping}/` layout with zero new code paths in search/index/compare.
294
+
295
+
Forge/NeoForge dev environments (1.17+) are **mojmap-exclusive** — yarn is a Fabric/Quilt mapping with no equivalent in the Forge ecosystem. The schema enforces `mapping === 'mojmap'` whenever `jarPath` is set. `find_mapping` does no special-casing for patched keys: callers wanting a vanilla mojmap↔yarn translation should pass the vanilla MC version directly.
Deterministic central-directory scan: any `.class` entry → decompile via VineFlower; else any `.java` → extract directly (NFRT/ForgeGradle `-sources.jar` fast path); else error. Mixed JARs always decompile (any `.class` wins). Avoids filename heuristics, which Forge/NeoForge dev artifacts don't reliably follow.
@@ -316,7 +318,7 @@ Deterministic central-directory scan: any `.class` entry → decompile via VineF
316
318
317
319
### Phase 1 Tools (Core)
318
320
1.**`get_minecraft_source`** - Get decompiled source for a Minecraft class
319
-
2.**`decompile_minecraft_version`** - Trigger full decompilation of a version. Pass `jarPath` to point at a local Forge/NeoForge **patched** MC JAR (cache key convention: `<mc>-<loader>-<loaderVersion>`, e.g. `1.21.1-neoforge-21.1.72`). Sources JARs (no `.class` entries) are extracted directly; compiled JARs run through VineFlower. `force: true` wipes the decompiled dir, the job row, and the FTS5 index for that (version, mapping).
321
+
2.**`decompile_minecraft_version`** - Trigger full decompilation of a version. Pass `jarPath` to point at a local Forge/NeoForge **patched** MC JAR (cache key convention: `<mc>-<loader>-<loaderVersion>`, e.g. `1.21.1-neoforge-21.1.72`); in this mode `mapping` must be `'mojmap'` (Forge/NeoForge dev environments are mojmap-only post-1.17). Sources JARs (no `.class` entries) are extracted directly; compiled JARs run through VineFlower. `force: true` wipes the decompiled dir, the job row, and the FTS5 index for that (version, mapping).
320
322
3.**`list_minecraft_versions`** - List available and cached versions
321
323
4.**`get_registry_data`** - Get registry data (blocks, items, entities)
'Minecraft version to decompile. When `jarPath` is provided this is treated as an opaque cache key — the conventional schema is `<mc>-<loader>-<loaderVersion>` (e.g., `1.21.1-neoforge-21.1.72`).',
56
-
),
57
-
mapping: z
58
-
.enum(['yarn','mojmap'])
59
-
.describe(
60
-
'Mapping type to use. For Forge/NeoForge dev environments (1.17+) this is always `mojmap`.',
61
-
),
62
-
force: z
63
-
.boolean()
64
-
.optional()
65
-
.describe(
66
-
'Force re-decompilation even if cached. Wipes the decompiled directory, decompile job row, and FTS5 search index for this (version, mapping) so it can be rebuilt cleanly.',
67
-
),
68
-
jarPath: z
69
-
.string()
70
-
.optional()
71
-
.describe(
72
-
'Optional path to a local Forge/NeoForge patched Minecraft JAR (supports WSL and Windows paths). When set, skips the Mojang download + remap pipeline and decompiles the provided JAR directly. Sources JARs (no .class entries) are extracted directly; compiled JARs are decompiled with VineFlower. The `mapping` parameter is treated as a label only — no remapping is performed.',
73
-
),
74
-
});
51
+
constDecompileMinecraftVersionSchema=z
52
+
.object({
53
+
version: z
54
+
.string()
55
+
.describe(
56
+
'Minecraft version to decompile. When `jarPath` is provided this is treated as an opaque cache key — the conventional schema is `<mc>-<loader>-<loaderVersion>` (e.g., `1.21.1-neoforge-21.1.72`).',
57
+
),
58
+
mapping: z
59
+
.enum(['yarn','mojmap'])
60
+
.describe(
61
+
'Mapping type to use. `yarn` is Fabric/Quilt only. Forge/NeoForge dev environments (1.17+) are mojmap-exclusive — when `jarPath` is provided, this must be `mojmap`.',
62
+
),
63
+
force: z
64
+
.boolean()
65
+
.optional()
66
+
.describe(
67
+
'Force re-decompilation even if cached. Wipes the decompiled directory, decompile job row, and FTS5 search index for this (version, mapping) so it can be rebuilt cleanly.',
68
+
),
69
+
jarPath: z
70
+
.string()
71
+
.optional()
72
+
.describe(
73
+
'Optional path to a local Forge/NeoForge patched Minecraft JAR (supports WSL and Windows paths). When set, skips the Mojang download + remap pipeline and decompiles the provided JAR directly. Sources JARs (no .class entries) are extracted directly; compiled JARs are decompiled with VineFlower. No remapping is performed — the JAR is already mojmap-named, which is why `mapping` must be `mojmap` in this mode.',
"Forge/NeoForge patched JARs are mojmap-exclusive (yarn is a Fabric/Quilt mapping with no equivalent in the Forge ecosystem). Set `mapping: 'mojmap'` when passing `jarPath`.",
'Mapping type to use. For Forge/NeoForge dev environments (1.17+), use `mojmap`.',
307
+
'Mapping type to use. `yarn` is Fabric/Quilt only. Forge/NeoForge dev environments (1.17+) are mojmap-exclusive — when `jarPath` is provided, this must be `mojmap`.',
302
308
},
303
309
force: {
304
310
type: 'boolean',
@@ -308,7 +314,7 @@ export const tools = [
308
314
jarPath: {
309
315
type: 'string',
310
316
description:
311
-
'Optional local Forge/NeoForge patched MC JAR path (WSL or Windows). When set, skips download/remap and decompiles (or extracts, if it is a sources JAR) directly. Trusts the user-supplied `mapping` as a label.',
317
+
'Optional local Forge/NeoForge patched MC JAR path (WSL or Windows). When set, skips download/remap and decompiles (or extracts, if it is a sources JAR) directly. The JAR is already mojmap-named, so `mapping` must be `mojmap`.',
0 commit comments