feat(debug): 支持网易 Minecraft 调试启动
新增 debug 子命令,自动准备开发世界、注册内置调试 MOD,并将项目行为包和资源包链接到网易运行目录,方便启动游戏后直接进入调试世界。 调试 MOD 资源随仓库一起嵌入,避免依赖本机绝对路径;Windows junction 写入剥离 verbatim 前缀后的 DOS 路径,保证 Minecraft 能正确读取链接包。
This commit is contained in:
21
debug_mod/DEBUG_ENV_SCRIPT/Config.py
Normal file
21
debug_mod/DEBUG_ENV_SCRIPT/Config.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from json import loads
|
||||
_DEBUG_INFO = "{#debug_options}"
|
||||
_TARGET_MOD_DIRS = "{#target_mod_dirs}"
|
||||
|
||||
try:
|
||||
DEBUG_CONFIG = loads(_DEBUG_INFO) if not isinstance(_DEBUG_INFO, dict) else _DEBUG_INFO
|
||||
except:
|
||||
DEBUG_CONFIG = {}
|
||||
|
||||
try:
|
||||
TARGET_MOD_DIRS = loads(_TARGET_MOD_DIRS) if not isinstance(_TARGET_MOD_DIRS, list) else _TARGET_MOD_DIRS
|
||||
except:
|
||||
TARGET_MOD_DIRS = []
|
||||
|
||||
def GET_DEBUG_IPC_PORT():
|
||||
import os
|
||||
port = os.getenv("MCDEV_DEBUG_IPC_PORT")
|
||||
if port is None:
|
||||
return None
|
||||
return int(port)
|
||||
Reference in New Issue
Block a user