Ducky Updater Lib

模组

· 作者 syorito-hatsuki

用于从 Modrinth 检查模组更新的简单库

3 本站下载 0 关注 更新于 5 个月前

最新 2026.6.1 · 26.3 · Fabric

一键开服(送7天)

Ducky Updater Lib

描述

一个简单的库,用于从 Modrinth 检查模组更新。

添加依赖

build.gradle.kts

repositories {
    maven {
        url = "https://api.modrinth.com/maven"
    }
}

dependencies {
    // 选项 1:将 Ducky Updater 包含到项目中,使其在你自己的 jar 包中可用(额外约 17kb)
    include(modImplementation("maven.modrinth", "ducky-updater-lib", "<version>"))
    
    // 选项 2:依赖 Ducky Updater,但要求用户手动安装它
    modImplementation("maven.modrinth", "ducky-updater-lib", "<version>")
}

fabric.mod.json

{
  "depends": {
    "fabricloader": "*",
    ...
    // 同时在你的 fabric.mod.json 中添加依赖
    "ducky-updater": "*"
  }
}

用法

fabric.mod.json

{
  "custom": {
    ...
    "duckyupdater": {
      // 来自项目页面的模组 Modrinth ID
      "modrinthId": "mWxGwd3F",
      // 可选(release, beta, alpha)
      // 默认值:release
      "type": "release",
      // 可选(true, false)
      // 默认值 false
      "featured": false
    }
  },
}
2023.7.1 版本之前
public class ModName implements ModInitializer {
    @Override
    public void onInitialize() {
        DuckyUpdater.checkForUpdate(
                "modrinthId",
                "modId",
                "alpha",        // 可选!默认为 release 
                true            // 可选!默认为 true
        );
    }
}

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源