跳到正文

Ducky Updater Lib

一个用于检查 Modrinth 上模组更新的简易前置库。

收藏

截图

介绍

介绍由机器翻译自 Modrinth 原页面,仅供参考。

Ducky Updater Lib

简介

用于检查模组是否有 Modrinth 更新的简易前置库

添加依赖

build.gradle.kts

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

dependencies {
    // Option 1: Include Ducky Updater to project for it available within your own jar (additional ~17kb)
    include(modImplementation("maven.modrinth", "ducky-updater-lib", "<version>"))
    
    // Option 2: Depend on Ducky Updater, but require that users install it manually
    modImplementation("maven.modrinth", "ducky-updater-lib", "<version>")
}

fabric.mod.json

{
  "depends": {
    "fabricloader": "*",
    ...
    // Also add dependency in your fabric.mod.json 
    "ducky-updater": "*"
  }
}

用法

fabric.mod.json

{
  "custom": {
    ...
    "duckyupdater": {
      //Mod modrinth ID from project page
      "modrinthId": "mWxGwd3F",
      // Optional (release, beta, alpha)
      // Default: release
      "type": "release",
      // Optional (true, false)
      // Default false
      "featured": false
    }
  },
}
2023.7.1 之前
public class ModName implements ModInitializer {
    @Override
    public void onInitialize() {
        DuckyUpdater.checkForUpdate(
                "modrinthId",
                "modId",
                "alpha",        // Optional! Default release 
                true            // Optional! Default true
        );
    }
}

常见问题

Ducky Updater Lib 支持哪些 Minecraft 版本?

Ducky Updater Lib 支持 Minecraft Java 版 1.13–26.3,共 51 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

Ducky Updater Lib 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。

评论

登录后评论和评分

syorito-hatsuki 的其他作品

查看全部 →