|
| 1 | +# find_mapping Tool - Mojmap Support Limitation |
| 2 | + |
| 3 | +## Issue Summary |
| 4 | + |
| 5 | +The `find_mapping` MCP tool does not correctly support looking up Mojang class names. |
| 6 | + |
| 7 | +## Technical Details |
| 8 | + |
| 9 | +### Current Behavior |
| 10 | + |
| 11 | +In `src/services/mapping-service.ts`, the `lookupMapping()` method: |
| 12 | + |
| 13 | +1. Always uses **Yarn mappings** as the lookup source (line 318): |
| 14 | + ```typescript |
| 15 | + const mappingPath = await this.getMappings(version, 'yarn'); |
| 16 | + ``` |
| 17 | + |
| 18 | +2. Maps `'mojmap'` to `'official'` namespace (line 408-409): |
| 19 | + ```typescript |
| 20 | + case 'mojmap': |
| 21 | + return 'official'; // Mojmap uses obfuscated -> named, but we only have official |
| 22 | + ``` |
| 23 | + |
| 24 | +### The Problem |
| 25 | + |
| 26 | +- Yarn mappings contain: `official` (obfuscated), `intermediary`, and `named` (Yarn names) |
| 27 | +- Yarn mappings do **NOT** contain Mojang's human-readable names |
| 28 | +- Mojang names like `net.minecraft.world.entity.Entity` only exist in the converted Mojmap tiny file |
| 29 | + |
| 30 | +### What Doesn't Work |
| 31 | + |
| 32 | +``` |
| 33 | +find_mapping({ |
| 34 | + symbol: "net.minecraft.world.entity.Entity", // Mojang name |
| 35 | + sourceMapping: "mojmap", |
| 36 | + targetMapping: "intermediary" |
| 37 | +}) |
| 38 | +``` |
| 39 | + |
| 40 | +This won't find anything because the Yarn file doesn't contain Mojang names. |
| 41 | + |
| 42 | +### What Does Work |
| 43 | + |
| 44 | +- `yarn` -> `intermediary` (works) |
| 45 | +- `intermediary` -> `yarn` (works) |
| 46 | +- `official` -> `intermediary` (works) |
| 47 | +- `intermediary` -> `official` (works) |
| 48 | + |
| 49 | +## Proposed Fix |
| 50 | + |
| 51 | +Modify `lookupMapping()` to: |
| 52 | + |
| 53 | +1. When `sourceMapping` or `targetMapping` is `'mojmap'`, load the Mojmap tiny file instead of Yarn |
| 54 | +2. The Mojmap tiny file has namespaces: `intermediary` and `named` (Mojang names) |
| 55 | +3. Map `'mojmap'` to `'named'` namespace instead of `'official'` |
| 56 | + |
| 57 | +### Implementation Notes |
| 58 | + |
| 59 | +- The converted Mojmap file is at: `getMojmapTinyPath(version)` |
| 60 | +- Path: `mappings/mojmap-tiny-{version}.tiny` |
| 61 | +- Namespaces in file: `intermediary`, `named` |
| 62 | + |
| 63 | +## Priority |
| 64 | + |
| 65 | +Low - This is a pre-existing limitation, not a regression. The core Mojmap remapping functionality works correctly. |
| 66 | + |
| 67 | +## Related Files |
| 68 | + |
| 69 | +- `src/services/mapping-service.ts` - `lookupMapping()` method |
| 70 | +- `src/server/tools.ts` - `find_mapping` tool handler |
0 commit comments