- 
                Notifications
    You must be signed in to change notification settings 
- Fork 504
feat: Minecraft mod summarization (Forge/Fabric) #966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| JsonObject json = JsonParser.parseString(jsonText).getAsJsonObject(); | ||
| if (json.has("entrypoints")) { | ||
| JsonObject entrypoints = json.getAsJsonObject("entrypoints"); | ||
| if (entrypoints.has("main")) { | 
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)); | 
There was a problem hiding this comment.
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"); | 
There was a problem hiding this comment.
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
| I add toml4j for parse the  | 
497d549    to
    cec9a1c      
    Compare
  
    | Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
 | 
What's new