Class StoreSummaryService
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
Answers "what does this actually do to my server?" in the user's own language.
Modrinth's own one-line description is written by the author, in English, and often for other modders ("An intermediary api aimed to ease developing multiplatform mods"). So the store ships a hand-written catalogue for the projects a server owner is most likely to meet, in the five languages the app speaks. It is looked up locally: no request, no key, no cost, and it works offline.
Anything outside the catalogue falls back to a sentence built from what Modrinth does tell us — the kind of project, its main tag and, above all, whether players have to install it too, which is the one thing that decides whether a mod is usable on a public server.
The catalogue can be replaced without rebuilding by dropping a
store-summaries.json in the user's data folder.
public sealed class StoreSummaryService
- Inheritance
-
StoreSummaryService
- Inherited Members
Constructors
StoreSummaryService(string?)
public StoreSummaryService(string? overridePath = null)
Parameters
overridePathstring
Properties
Count
How many projects the catalogue covers (useful when checking it loaded at all).
public int Count { get; }
Property Value
Shared
Shared instance; the catalogue is read once per run.
public static StoreSummaryService Shared { get; }
Property Value
Methods
Blurb(StoreItem, IReadOnlyList<StoreTagDefinition>?)
What a card shows about a project: a summary in the user's language, plus the author's own line underneath when it says something the summary doesn't.
This is the single answer to "what do we print for this project", and every surface uses it — the browser cards, the dependencies, the related strip and the details header. Before it existed each of those repeated its own version of the rule, and two of them stopped at "hand-written text or else the author's English", which is why the same mod could read in Spanish on its own page and in English in another mod's related strip.
Unlike Describe(StoreItem, IReadOnlyList<StoreTagDefinition>?) this leaves out the install-side sentence: it is the same for most projects, so on a strip of six cards it would repeat six times, and the surfaces that need it show it on their own (a badge on the card, a full sentence on the details page).
public StoreBlurb Blurb(StoreItem item, IReadOnlyList<StoreTagDefinition>? tags = null)
Parameters
itemStoreItemtagsIReadOnlyList<StoreTagDefinition>
Returns
Curated(StoreItem)
The hand-written summary for this project in the interface language, or null when it isn't in the catalogue. English is used when a language is missing from an entry.
public string? Curated(StoreItem item)
Parameters
itemStoreItem
Returns
Describe(StoreItem, IReadOnlyList<StoreTagDefinition>?)
The summary to show: the hand-written one when it exists, otherwise a sentence built from the project's kind, its main tag and how it has to be installed. Never empty.
public string Describe(StoreItem item, IReadOnlyList<StoreTagDefinition>? tags = null)
Parameters
itemStoreItemtagsIReadOnlyList<StoreTagDefinition>
Returns
SideSentence(StoreItem)
The part that actually matters for a server: does everyone have to install this, or only you?
public static string SideSentence(StoreItem item)
Parameters
itemStoreItem