mirror of
https://github.com/layue13/MoonBridge.git
synced 2026-10-26 19:03:49 +00:00
client-mod/ 是独立构建(GTNH ExampleMod 模板 + RetroFuturaGradle),coremod + 早期 Mixin,运行时依赖 UniMixins。服务器地址填 ws:// 或 wss:// 时经 WebSocket 连接 MoonBridge,其余地址保持原版 TCP。 - Mixin:ServerAddress 解析、GuiConnecting、NetworkManager.provideLanClient 及其 ChannelInitializer、OldServerPinger(ws 条目跳过旧版 0xFE ping) - 使用 MC 自带 Netty 4.0.10 的 WebSocket13 帧编解码与 SslHandler;握手手写, Host 头与 SNI 用 URL 主机名,升级完成前缓冲原版写出 - 25 项 JUnit 测试(地址解析、上下文传递、帧适配、管线与本地 WS 服务端交互) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
44 lines
3.4 KiB
Groovy
44 lines
3.4 KiB
Groovy
/*
|
|
* Add your dependencies here. Supported configurations:
|
|
* - api("group:name:version:classifier"): if you use the types from this dependency in the public API of this mod
|
|
* Available at runtime and compiletime for mods depending on this mod
|
|
* - implementation("g:n:v:c"): if you need this for internal implementation details of the mod, but none of it is visible via the public API
|
|
* Available at runtime but not compiletime for mods depending on this mod
|
|
* - compileOnly("g:n:v:c"): if the mod you're building doesn't need this dependency during runtime at all, e.g. for optional mods
|
|
* Not available at all for mods depending on this mod, only visible at compiletime for this mod
|
|
* - compileOnlyApi("g:n:v:c"): like compileOnly, but also visible at compiletime for mods depending on this mod
|
|
* Available at compiletime but not runtime for mods depending on this mod
|
|
* - runtimeOnlyNonPublishable("g:n:v:c"): if you want to include a mod in this mod's runClient/runServer runs, but not publish it as a dependency
|
|
* Not available at all for mods depending on this mod, only visible at runtime for this mod
|
|
* - devOnlyNonPublishable("g:n:v:c"): a combination of runtimeOnlyNonPublishable and compileOnly for dependencies present at both compiletime and runtime,
|
|
* but not published as Maven dependencies - useful for RFG-deobfuscated dependencies or local testing
|
|
* - runtimeOnly("g:n:v:c"): if you don't need this at compile time, but want it to be present at runtime
|
|
* Available at runtime for mods depending on this mod
|
|
* - annotationProcessor("g:n:v:c"): mostly for java compiler plugins, if you know you need this, use it, otherwise don't worry
|
|
* - testCONFIG("g:n:v:c") - replace CONFIG by one of the above (except api), same as above but for the test sources instead of main
|
|
*
|
|
* - shadowImplementation("g:n:v:c"): effectively the same as API, but the dependency is included in your jar under a renamed package name
|
|
* Requires you to enable usesShadowedDependencies in gradle.properties
|
|
*
|
|
* - compile("g:n:v:c"): deprecated, replace with "api" (works like the old "compile") or "implementation" (can be more efficient)
|
|
*
|
|
* You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed,
|
|
* but use this sparingly as it can break using your mod as another mod's dependency if you're not careful.
|
|
*
|
|
* To depend on obfuscated jars you can use `devOnlyNonPublishable(rfg.deobf("dep:spec:1.2.3"))` to fetch an obfuscated jar from maven,
|
|
* or `devOnlyNonPublishable(rfg.deobf(project.files("libs/my-mod-jar.jar")))` to use a file.
|
|
*
|
|
* Gradle names for some of the configuration can be misleading, compileOnlyApi and runtimeOnly both get published as dependencies in Maven, but compileOnly does not.
|
|
* The buildscript adds runtimeOnlyNonPublishable to also have a runtime dependency that's not published.
|
|
*
|
|
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
|
|
*/
|
|
dependencies {
|
|
// Runtime requirement (not bundled): UniMixins, which the buildscript adds automatically for usesMixins = true.
|
|
// Netty 4.0.10.Final comes with Minecraft and is not shaded.
|
|
|
|
testImplementation(platform("org.junit:junit-bom:5.11.4"))
|
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
}
|