MCIO Plugins MCIO Plugins
首页
爱发电 (opens new window)
无法下载? (opens new window)

人间工作P

我每天都好困… 最近在学习和进行 VOCALOID 创作
首页
爱发电 (opens new window)
无法下载? (opens new window)
  • PluginBase

    • PluginBase 简介
    • 构建脚本
    • 插件元数据
    • 插件主类
    • 一些工具
    • 菜单
    • 菜单配置文件
    • Vault 经济
    • 数据库连接池
    • Adventure 支持
    • 本地化系统
    • 依赖下载
    • 依赖下载 简易版
    • 依赖版本重载
      • 某某插件加载时报错,让我过来的
      • 依赖版本重载
      • 如何生成配置?
      • adventure 4.11.0
      • adventure 4.17.0
  • Item-NBT-API

  • VectorDisplays

  • 开发文档
  • PluginBase
2026-01-07
目录

依赖版本重载

<< 返回开发文档

# 某某插件加载时报错,让我过来的

插件名 的 adventure 相关库似乎出现了依赖冲突问题,请参考以下链接进行解决
https://plugins.mcio.dev/elopers/base/resolver-override

这个问题有可能会在低版本出现,简要解决方案如下:

  1. 创建配置文件: plugins/插件名/.override-libraries.yml
  2. 在下方 adventure x.x.x 章节选一份合适的配置,粘贴到上述配置中
  3. 重启服务器,使得插件加载并重新下载依赖
  4. 如果还是报错,换一份配置重试
  5. 如果配置都换完了还是报错,提供服务端信息、插件版本列表,向作者反馈相关问题

# 依赖版本重载

在这里存放用于 LibrariesResolver-Lite 的依赖版本重载配置,具体用法如下

// 在 resolver.doResolve() 之前读取并添加依赖位置重载配置
YamlConfiguration overrideLibraries = ConfigUtils.load(resolve("./.override-libraries.yml"));
for (String key : overrideLibraries.getKeys(false)) {
    resolver.getStartsReplacer().put(key, overrideLibraries.getString(key));
}
resolver.addResolvedLibrary(BuildConstants.RESOLVED_LIBRARIES);

List<URL> libraries = resolver.doResolve();
1
2
3
4
5
6
7
8

因为有用户反馈,在特殊情况下,adventure 会跟其它插件冲突导致插件无法启用,但是我又无法复现这个问题。于是决定编写配置,允许用户修改依赖版本。

当出现依赖冲突时,从下面复制配置,添加到插件数据目录下的 .override-libraries.yml 中即可。

# 如何生成配置?

// build.gradle.kts
buildscript {
    repositories.mavenCentral()
    dependencies.classpath("top.mrxiaom:LibrariesResolver-Gradle:1.7.3")
}
val base = top.mrxiaom.gradle.LibraryHelper(project)
dependencies {
    val adventure = "4.11.0" // adventure 版本
    base.library("net.kyori:adventure-api:$adventure")
    base.library("net.kyori:adventure-text-minimessage:$adventure")
    // 最好要找一个适配当前 adventure 的 platform 支持
    base.library("net.kyori:adventure-platform-bukkit:4.1.2")
    // 下面还可以添加更多依赖
}
base.collectLibraries<String> { dep ->
    val groupPath = dep.moduleGroup.replace('.', '/')
    val key = "${groupPath}/${dep.moduleName}/"
    val value = top.mrxiaom.gradle.LibraryHelper.defaultCollector().apply(dep)
    if (value != null) "'$key': '$value'" else null
}.forEach(::println) // 打印到控制台,然后从控制台复制配置即可
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

请手动从结果中去除 annotations 等不必要依赖。

# adventure 4.11.0

'net/kyori/adventure-api/': 'net/kyori/adventure-api/4.11.0/adventure-api-4.11.0.jar'
'net/kyori/adventure-key/': 'net/kyori/adventure-key/4.11.0/adventure-key-4.11.0.jar'
'net/kyori/examination-string/': 'net/kyori/examination-string/1.3.0/examination-string-1.3.0.jar'
'net/kyori/examination-api/': 'net/kyori/examination-api/1.3.0/examination-api-1.3.0.jar'
'net/kyori/adventure-text-minimessage/': 'net/kyori/adventure-text-minimessage/4.11.0/adventure-text-minimessage-4.11.0.jar'

'net/kyori/adventure-text-serializer-gson-legacy-impl/': 'net/kyori/adventure-text-serializer-gson-legacy-impl/4.11.0/adventure-text-serializer-gson-legacy-impl-4.11.0.jar'
'net/kyori/adventure-text-serializer-bungeecord/': 'net/kyori/adventure-text-serializer-bungeecord/4.1.2/adventure-text-serializer-bungeecord-4.1.2.jar'
'net/kyori/adventure-text-serializer-gson/': 'net/kyori/adventure-text-serializer-gson/4.11.0/adventure-text-serializer-gson-4.11.0.jar'
'net/kyori/adventure-text-serializer-legacy/': 'net/kyori/adventure-text-serializer-legacy/4.11.0/adventure-text-serializer-legacy-4.11.0.jar'
'net/kyori/adventure-nbt/': 'net/kyori/adventure-nbt/4.11.0/adventure-nbt-4.11.0.jar'
'net/kyori/adventure-platform-api/': 'net/kyori/adventure-platform-api/4.1.2/adventure-platform-api-4.1.2.jar'
'net/kyori/adventure-platform-facet/': 'net/kyori/adventure-platform-facet/4.1.2/adventure-platform-facet-4.1.2.jar'
'net/kyori/adventure-platform-bukkit/': 'net/kyori/adventure-platform-bukkit/4.1.2/adventure-platform-bukkit-4.1.2.jar'
'net/kyori/adventure-platform-viaversion/': 'net/kyori/adventure-platform-viaversion/4.1.2/adventure-platform-viaversion-4.1.2.jar'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# adventure 4.17.0

'net/kyori/adventure-api/': 'net/kyori/adventure-api/4.17.0/adventure-api-4.17.0.jar'
'net/kyori/adventure-key/': 'net/kyori/adventure-key/4.17.0/adventure-key-4.17.0.jar'
'net/kyori/examination-string/': 'net/kyori/examination-string/1.3.0/examination-string-1.3.0.jar'
'net/kyori/examination-api/': 'net/kyori/examination-api/1.3.0/examination-api-1.3.0.jar'
'net/kyori/adventure-text-minimessage/': 'net/kyori/adventure-text-minimessage/4.17.0/adventure-text-minimessage-4.17.0.jar'
1
2
3
4
5
上次更新: 2026/01/24, 15:12:56
依赖下载 简易版
Item-NBT-API 简介

← 依赖下载 简易版 Item-NBT-API 简介→

使用主题 Vdoing | Copyright © 2018-2026 人间工作P | 到爱发电支持我 | b99b741

除非特别说明,本站点所有文章均以 CC BY-SA 协议授权

《我的世界》和《Minecraft》是微软公司和 Mojang Synergies AB 的商标,本站点与微软公司等没有从属关系。

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式