Skip to content

Conversation

luiox
Copy link
Contributor

@luiox luiox commented Sep 2, 2025

What's new

  • Added a feature to summarize Forge/Fabric mod information, including main mod classes and the required Minecraft version.

JsonObject json = JsonParser.parseString(jsonText).getAsJsonObject();
if (json.has("entrypoints")) {
JsonObject entrypoints = json.getAsJsonObject("entrypoints");
if (entrypoints.has("main")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also client and server entry points. There technically are more like modmenu but I don't know where to find the "full" list of all these extra entry points.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will modify the code according to the content of the document at https://wiki.fabricmc.net/documentation:fabric_mod_json.

consumer.appendSummary(title);

if (!finalMcVersion.isEmpty()) {
consumer.appendSummary(new Label(Lang.getBinding("service.analysis.minecraft-version").get() + " " + finalMcVersion));
Copy link
Owner

@Col-E Col-E Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use String.format templates in bindings, see menu.mappings.export.unsupported for example:

// menu.mappings.export.unsupported=%s (Unsupported)
Lang.format("menu.mappings.export.unsupported", formatName)

}

// 2. Try to find Forge mod information
FileInfo forgeFileInfo = resource.getFileBundle().get("mcmod.info");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think mcmod.info is used mostly in older versions of forge (Like 1.12), and newer versions have this info at META-INF/mods.toml - Would be nice to support both

@luiox luiox requested a review from Col-E September 5, 2025 04:10
@luiox
Copy link
Contributor Author

luiox commented Sep 5, 2025

I add toml4j for parse the META-INF/mods.toml file.

@luiox luiox force-pushed the feat/minecraft-summerize branch from 497d549 to cec9a1c Compare September 6, 2025 07:29
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.09%. Comparing base (80e5b27) to head (78019fb).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #966   +/-   ##
=========================================
  Coverage     65.09%   65.09%           
  Complexity     4293     4293           
=========================================
  Files           396      396           
  Lines         18436    18436           
  Branches       2958     2958           
=========================================
  Hits          12001    12001           
  Misses         4964     4964           
  Partials       1471     1471           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants