v1.3.0 — single jar covers Fabric 1.21.6 + Fabric 26.1.2 + NeoForge 1.21.6
이전엔 1.21.6 (v1.1.1) 와 26.1.2 (v1.2.1) 가 분리된 jar 였음. 사용자 입장에서
버전별로 다른 파일을 받아야 했고 합친 의미가 없어서, 한 jar 가 어느 환경에든
들어갈 수 있도록 컨테이너 구조로 재작업.
구조:
- outer chat_answer-1.3.0.jar
├── fabric.mod.json (entrypoint 없는 컨테이너 메타. MC dep 없음.)
├── META-INF/neoforge.mods.toml (NeoForge 1.21.6 모드 본체 메타)
├── kr/.../neoforge/ (NeoForge 1.21.6 entry + core, Mojang 매핑)
├── kr/.../core/ (NeoForge 가 쓰는 공유 core 사본)
└── META-INF/jars/ (Fabric Loader 가 자동 스캔)
├── chat_answer-fabric-1216-1.3.0.jar (MC ">=1.21.6 <1.22")
└── chat_answer-fabric-2612-1.3.0.jar (MC ">=26.1.2")
로더별 동작:
- Fabric 1.21.6 → outer 는 no-op 컨테이너, 1216 nested 가 활성 (intermediary class_NNNN 리매핑됨)
- Fabric 26.1.2 → outer 는 no-op 컨테이너, 2612 nested 가 활성 (intermediary 0.0.0 identity)
- NeoForge 1.21.6 → outer 의 NeoForge entry 가 동작. Fabric 메타와 nested jars 는 NeoForge 가 무시.
핵심 트레이드오프:
- 1.21.6 fabric subproject 는 modImplementation 필수 (intermediary 매핑 리맵 필요)
- 26.1.2 fabric subproject 는 implementation 으로 충분 (서버 jar unobfuscated → identity 매핑)
- 26.1.2 NeoForge 는 moddev plugin 이 아직 26.x 를 파싱 못 함 → 1.21.6 만 지원
- 두 nested fabric jar 는 mod id 동일 (chat_answer_fabric) — depends.minecraft 가 상호 배타라
한 환경에서 둘이 동시 candidate 가 되지 않으므로 충돌 없음.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
53
fabric-1216/build.gradle
Normal file
53
fabric-1216/build.gradle
Normal file
@@ -0,0 +1,53 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '1.16-SNAPSHOT'
|
||||
}
|
||||
|
||||
base.archivesName = "${project.mod_id}-fabric-1216"
|
||||
|
||||
// 1.21.6 은 Java 21 런타임. release 21 로 컴파일.
|
||||
java {
|
||||
toolchain.languageVersion = JavaLanguageVersion.of(25)
|
||||
}
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.release = 21
|
||||
}
|
||||
|
||||
// common/ 디렉토리의 로더 비종속 소스 포함. Mojang 매핑으로 컴파일됨.
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs += "${rootDir}/common/src/main/java"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${project.mc_1216}"
|
||||
mappings loom.officialMojangMappings()
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_1216}"
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_1216}"
|
||||
}
|
||||
|
||||
loom {
|
||||
serverOnlyMinecraftJar()
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mod_id", project.mod_id
|
||||
|
||||
filteringCharset = 'UTF-8'
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand(
|
||||
"version": project.version,
|
||||
"mod_id": project.mod_id
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
from(rootProject.file("LICENSE")) {
|
||||
rename { "${it}_${project.mod_id}_fabric_1216" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package kr.tkrmagid.chatanswer.fabric;
|
||||
|
||||
import kr.tkrmagid.chatanswer.core.ChatAnswerCore;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.message.v1.ServerMessageEvents;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
|
||||
|
||||
public final class ChatAnswerFabric implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
ServerMessageEvents.ALLOW_CHAT_MESSAGE.register((message, sender, params) ->
|
||||
ChatAnswerCore.handleChat(sender, message.signedContent())
|
||||
);
|
||||
ServerPlayConnectionEvents.JOIN.register((handler, sender, server) ->
|
||||
ChatAnswerCore.onPlayerJoin(handler.player)
|
||||
);
|
||||
}
|
||||
}
|
||||
BIN
fabric-1216/src/main/resources/assets/chat_answer/icon.png
Normal file
BIN
fabric-1216/src/main/resources/assets/chat_answer/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
20
fabric-1216/src/main/resources/fabric.mod.json
Normal file
20
fabric-1216/src/main/resources/fabric.mod.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "chat_answer_fabric",
|
||||
"version": "${version}",
|
||||
"name": "채팅정답 (Fabric impl)",
|
||||
"description": "음악퀴즈(mq) 데이터팩이 정답 입력을 받는 상태(init=5)에서 채팅을 가로채 mq:answer/submit 함수로 전달합니다. (MC 1.21.6 변형)",
|
||||
"authors": [ "tkrmagid" ],
|
||||
"license": "MIT",
|
||||
"icon": "assets/chat_answer/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [ "kr.tkrmagid.chatanswer.fabric.ChatAnswerFabric" ]
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.16.0",
|
||||
"minecraft": ">=1.21.6 <1.22",
|
||||
"java": ">=21",
|
||||
"fabric-api": "*"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user