Files
emod-cli/debug_mod/DEBUG_ENV_SCRIPT/Game.py
Blank038 011b59c948 feat(debug): 支持网易 Minecraft 调试启动
新增 debug 子命令,自动准备开发世界、注册内置调试 MOD,并将项目行为包和资源包链接到网易运行目录,方便启动游戏后直接进入调试世界。

调试 MOD 资源随仓库一起嵌入,避免依赖本机绝对路径;Windows junction 写入剥离 verbatim 前缀后的 DOS 路径,保证 Minecraft 能正确读取链接包。
2026-05-16 00:59:51 +08:00

50 lines
1.2 KiB
Python

# -*- coding: utf-8 -*-
from common.utils import xupdate
import mod.client.extraClientApi as clientApi
from .Config import TARGET_MOD_DIRS
def _RELOAD_MOD():
state = False
for rootModDir in TARGET_MOD_DIRS:
try:
if xupdate.updata_all(rootModDir):
state = True
except Exception:
import traceback
traceback.print_exc()
return state
def INIT_RELOAD_TIME():
return xupdate.set_load_time()
def SEND_CLIENT_MSG(msg):
import gui
print(msg)
gui.set_left_corner_notify_msg(msg)
def RELOAD_MOD():
import gui
msg = "[Dev] Scripts reloaded successfully."
if not _RELOAD_MOD():
msg = "[Dev] No script updates found."
SEND_CLIENT_MSG(msg)
def RELOAD_ONCE_MODULE(moduleName):
return xupdate.update(moduleName)
def RELOAD_ADDON():
import gui
import clientlevel
clientlevel.refresh_addons()
SEND_CLIENT_MSG("[Dev] Add-ons reloaded successfully.")
def RELOAD_WORLD():
import clientlevel
clientlevel.restart_local_game()
def RELOAD_SHADERS():
import gui
if clientApi.ReloadAllShaders():
SEND_CLIENT_MSG("[Dev] Shaders reloaded successfully.")
return
SEND_CLIENT_MSG("[Dev] No shader updates found.")