v1.3.2 — verbose logging to diagnose missing active=1b write

증상: chat_answer:status active 가 0b 그대로 → 데이터팩 login 메시지 안 뜸.
mq:load 는 정상 작동(0b 초기화 됨)인데 모드의 onPlayerJoin 이 1b 로 안 씀.

추가 로그:
  - ChatAnswerFabric.onInitialize: 진입/완료, event register 예외시 ERROR
  - ChatAnswerCore.onPlayerJoin: 진입 (player 이름 포함), 성공 시 INFO,
    실패 catch 를 LOG.debug → LOG.warn 으로 승격해 latest.log 에 보이게.

이 로그를 보고 다음 중 어디서 깨지는지 좁힐 수 있음:
  - "Fabric entrypoint onInitialize starting" 안 보임 → nested jar 미로드
  - "onInitialize starting" 보이고 "registered" 안 보임 → fabric-api ABI mismatch
  - "onPlayerJoin fired" 안 보임 → JOIN 이벤트 미발화
  - "active=1b set" 안 보이고 "failed" 만 보임 → command 실행 실패

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-05-14 03:02:00 +09:00
parent 939505c861
commit d1c6504973
4 changed files with 43 additions and 15 deletions

View File

@@ -4,15 +4,26 @@ 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;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class ChatAnswerFabric implements ModInitializer {
private static final Logger LOG = LoggerFactory.getLogger(ChatAnswerCore.MOD_ID);
@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)
);
LOG.info("[{}] Fabric entrypoint onInitialize starting", ChatAnswerCore.MOD_ID);
try {
ServerMessageEvents.ALLOW_CHAT_MESSAGE.register((message, sender, params) ->
ChatAnswerCore.handleChat(sender, message.signedContent())
);
ServerPlayConnectionEvents.JOIN.register((handler, sender, server) ->
ChatAnswerCore.onPlayerJoin(handler.player)
);
LOG.info("[{}] Fabric entrypoint registered: ALLOW_CHAT_MESSAGE + JOIN", ChatAnswerCore.MOD_ID);
} catch (Throwable t) {
LOG.error("[{}] Fabric entrypoint event registration failed", ChatAnswerCore.MOD_ID, t);
throw t;
}
}
}