Repository navigation
Platform Addons
Vintage Resourcify API v1 accepts providers from separate Forge 1.7.10 mods. The entry point is dev.dediamondpro.resourcify.api.ProviderApi; provider models use the existing services interfaces. No plugin manifest or discovery mechanism is required.
Compile against a release containing API v1 and require that release at runtime. For GTNH convention builds:
repositories {
maven { url = "https://maven.fentanylsolutions.org/releases" }
}
dependencies {
devOnlyNonPublishable("dev.dediamondpro.resourcify:VintageResourcify:VERSION:dev")
}Replace VERSION with the release used by the addon. Do not shade Vintage Resourcify or its API into the addon. Declare required-after:vintage-resourcify in the addon's @Mod(dependencies = ...), adding a minimum-version constraint for the chosen release.
Register once from the client proxy, during FMLInitializationEvent or FMLPostInitializationEvent. Keep API and provider references out of server initialization. ExampleService below is the addon's IService implementation:
import dev.dediamondpro.resourcify.api.ProviderApi;
import dev.dediamondpro.resourcify.api.RegistrationResult;
import net.minecraft.util.ResourceLocation;
// Inside the client proxy's init/postInit method:
if (!ProviderApi.isRegistrationEnabled()) return;
RegistrationResult result = ProviderApi.register(
new ExampleService(),
new ResourceLocation("exampleaddon", "textures/platform.png")
);
if (result != RegistrationResult.REGISTERED) {
// Report result through the addon's logger.
}The icon is optional; omit the second argument to use no custom icon. Supply a square PNG at assets/exampleaddon/textures/platform.png. The provider's getName() supplies its display name.
getPlatformId() must remain stable and match [a-z0-9][a-z0-9_-]*. IDs are persisted with installed packs. Registration returns INVALID_ID, RESERVED_ID, or DUPLICATE_ID for conflicts; modrinth, curseforge, and curse are reserved. Registration never replaces an existing provider. Config reloads retain addon providers.
ProviderApi.getProvider(id) returns the registered service or null. getProviders() returns an immutable snapshot.
For manual configuration without an addon, see Custom Modrinth platforms.
Use ProviderApi.registerModrinth() when the platform implements the Modrinth v2 API. No IService, project, or version implementation is needed. For a 67minecraft addon, register from the client proxy:
RegistrationResult result = ProviderApi.registerModrinth(
"67minecraft",
"67Minecraft",
"https://67.fentanylsolutions.org/api/v2",
"https://67.fentanylsolutions.org",
new ResourceLocation("resourcify67", "textures/platform.png")
);Bundle the icon in the addon, or omit the final argument. Pass the complete API base and website base explicitly; the helper does not infer hosts or append /v2. Both URLs require HTTPS and must have no credentials, query, or fragment. Surrounding whitespace and trailing slashes are removed. Malformed URLs and blank display names throw IllegalArgumentException; ID validation and duplicate handling use the registration results above. Registration makes no network requests.
The adapter provides browsing, project details, versions, downloads, and hash-based update checks. The service must implement the corresponding Modrinth v2 endpoints and response formats. Author links and dependency lookups use the registered platform. This helper works in both distributions and does not enable platforms.json in CurseForge builds.
Keep 67minecraft as the stable ID to recognize existing installations. If an enabled configured platform already owns that ID, registration returns DUPLICATE_ID; disable that configured entry and restart to use the addon.
| Interface | Responsibility |
|---|---|
IService |
Identity, supported ProjectTypes, search, filters, sort options, project lookup, and updates. |
ISearchData |
Result projects and total result count. Search offsets count projects, not pages. |
IProject |
Project metadata, browser URL, description, versions, optional members and gallery. |
IVersion |
File metadata, release metadata, compatibility, changelog, and dependencies. |
Return only supported project types. Use RESOURCE_PACK, IRIS_SHADER, and/or OPTIFINE_SHADER as appropriate. Version filtering uses getMinecraftVersions(); an empty list does not imply compatibility with every version. Use ISO-8601 instants for release dates, matching Instant.parse, and byte counts for file sizes.
Keep identity, metadata getters, and URL recognition free of network work. search() is called on a worker. Methods returning CompletableFuture must return promptly and perform I/O on the addon's executor. Provider callbacks must not manipulate Minecraft UI. Handle timeouts and API errors; distinguish failures from successful empty results. Constructors must not start network requests.
canFetchProjectUrl() and fetchProjectFromUrl() remain part of IService, but implementing them alone does not add a URL-import UI.
Ordinary versions use IVersion.getDownloadUrl() and getSha1(). Return an empty SHA-1 string if unavailable. Never put an MD5 or another digest in that field.
For expiring links, other checksum algorithms, or browser-only downloads, implement AsyncDownloadVersion alongside the version model:
import dev.dediamondpro.resourcify.api.AsyncDownloadVersion;
import dev.dediamondpro.resourcify.api.DownloadChecksum;
import dev.dediamondpro.resourcify.api.DownloadTarget;
// In the version implementation:
@Override
public CompletableFuture<DownloadTarget> resolveDownload() {
return CompletableFuture.supplyAsync(() -> {
// Resolve through the platform API here.
return DownloadTarget.direct(downloadUrl,
new DownloadChecksum(DownloadChecksum.Algorithm.MD5, md5));
}, executor);
}The example's downloadUrl is a java.net.URL; executor belongs to the addon. Resolution runs after distribution checks, off the client thread, for each attempt. Complete exceptionally on failure. Cancellation discards late results; it does not guarantee cancellation of the addon's network operation.
Direct targets require HTTPS. Supported digests are MD5, SHA1, SHA256, and SHA512; pass null when no digest is available. Verification finishes before the installed file is replaced. Filenames must be single filenames, without directories.
Return DownloadTarget.browser(pageUrl) when a download requires login, payment, or human verification. Project pages offer Open website. Individual updates open the normal link prompt; batch updates requiring a browser are deferred for individual action. Browser downloads are not automatically installed or recorded. Do not embed credentials in URLs. API v1 does not support authenticated download headers or an embedded login browser.
For AsyncDownloadVersion, legacy getDownloadUrl() may return null; keep getSha1() as the real SHA-1 or an empty string.
Implement IdentifiedVersion.getFileId() when the platform has a stable remote file ID. IDs must be nonempty and unique within the project; they drive installed-version and ignored-update identity, independently of signed URLs.
Inside IService.getUpdates(), call ProviderApi.getInstalledPack(file) on a worker to obtain InstalledPack: platform ID, project ID, remote file ID, local SHA-1, update track, and installed release date. Unknown metadata is null; untracked files return null. Renamed files can be matched by their local hash. Check the platform ID before using a record. Local SHA-1 identifies installed bytes; it is independent of the provider's download checksum.
Return a map from each recognized file to its newer IVersion, or to null if current. Omit unrecognized files. A null minecraftVersion requests the newest release without a Minecraft-version filter; otherwise honor the requested branch. Do not propose a downgrade. Unknown local files can remain unsupported if the platform has no hash lookup.
Both regular and CurseForge builds accept programmatically registered addon providers. isRegistrationEnabled() returns true in both. CurseForge builds disable user-configured Modrinth-compatible endpoints (platforms.json), while permitting downloads and updates from registered addon providers. Unregistered third-party platform IDs remain blocked there; installation records remain readable if an addon is removed. Registration does not discover or install addons. DISABLED_BY_DISTRIBUTION is reserved for distributions that disable registration.
API v1 preserves IService, IProject, and IVersion; new download and identity capabilities are opt-in interfaces. Use ProviderApi for registration and metadata access. GUI classes, ServiceRegistry, LocalIndex, and download implementation classes are not supported addon entry points. The old registerService() method remains available for existing callers and now enforces registration restrictions.