@mctools/source
v1.2.1
Published
Locate, clone or decompile Minecraft mod source code
Maintainers
Readme
Locate, clone or decompile Minecraft mod source code
The resolved absolute path is printed to stdout; all diagnostics go to stderr, so the result is easy to capture.
A query is normally a modid. Since minecraftinstance.json carries no modid, a
jar that declares the queried one outranks an addon that merely contains it as a name
fragment — otherwise jei resolves to JEI Bees rather than the Had Enough Items
fork that actually owns the id. Java, Scala and Kotlin sources all count as valid.
Resolution pipeline
- Local match — existing folder /
.index.yamlunder$MOD_SOURCES. - Clone — GitHub/GitLab URL from
minecraftinstance.jsonor the CurseForge API ($CF_API_KEY). - Jar metadata —
mcmod.info/META-INF/MANIFEST.MF, then a GitHub search by author or name. - Same author / Gemini — repos of other mods by the same author, or the
geminiCLI. - Decompile —
cfr*.jar(in the MC dir) orvineflower*.jar(in$MOD_SOURCES).
Version pinning
Every cloned folder is checked out to the version the pack actually installs, taken from
the jar file name and its mcmod.info. The sources are moved onto a 1.12.x branch and then,
if the tip does not already match, onto a matching tag or the newest commit declaring that
version (read from version.properties / gradle.properties / build.properties /
build.gradle). Both versions are logged, so a mismatch that could not be resolved is visible
rather than silent.
Usage
Open console, navigate to your Minecraft directory (one with the mods/ directory or options.txt file)
> cd C:/Instances/MyModpackRun:
> npx @mctools/source --help
Options
Locate, clone or decompile the source code of a Minecraft 1.12.2 mod.
The resolved absolute path is printed to stdout; diagnostics go to stderr. (@mctools/source)
USAGE @mctools/source [OPTIONS] <QUERY>
ARGUMENTS
QUERY Mod id, name, or jar filename fragment
OPTIONS
-m, --mc Minecraft instance directory (default: cwd)
-s, --sources Directory holding mod sources (default: $MOD_SOURCES)
-k, --key CurseForge API key (default: $CF_API_KEY)
--silent Suppress diagnostic loggingAuthor
- https://github.com/Krutoy242
Other tools
- @mctools/errors - Scan debug.log file to find unknown errors
- @mctools/format - Format .zs files by using ESLint for typescript
- @mctools/manifest -
manifest.jsongeneration tool - @mctools/modlist - Generate .md file with all mods listed
- @mctools/reducer - Partially disable minecraft mods
- @mctools/source - Locate, clone or decompile Minecraft mod source code
- @mctools/tcon - Tweaks Tinker Constructs' materials with csv tables
- @mctools/zsfind - Look up ZenScript class definitions, fields and method signatures from CraftTweaker dumps
