1
0
forked from bot/app

添加对lyfunction的支持

This commit is contained in:
2024-05-31 22:42:04 +08:00
parent 96c85d9dca
commit c2b3018908
6 changed files with 121 additions and 39 deletions

View File

@ -9,6 +9,7 @@ import yaml
from .data import LiteModel
from .language import Language, get_default_lang_code
from .ly_function import loaded_functions
_loaded_resource_packs: list["ResourceMetadata"] = [] # 按照加载顺序排序
temp_resource_root = "data/liteyuki/resources"
@ -127,6 +128,7 @@ def load_resources():
# 加载默认资源和语言
# 清空临时资源包路径data/liteyuki/resources
_loaded_resource_packs.clear()
loaded_functions.clear()
if os.path.exists(temp_resource_root):
shutil.rmtree(temp_resource_root)
os.makedirs(temp_resource_root, exist_ok=True)