1
0

refactor: 整理代码

This commit is contained in:
2022-11-12 14:41:25 +08:00
parent 7b94a9ac46
commit 4c560755af
4 changed files with 122 additions and 104 deletions
+8
View File
@@ -10,12 +10,20 @@ console.info(`${LOG_PREFIX} 加载客户端内容`);
// event.add(new ResourceLocation(`minecraft:models/block/stone`), {});
onEvent('client.generate_assets', (event) => {
if (!Array.isArray(JSON_ASSETS)) {
return;
}
console.info(`${LOG_PREFIX} 生成客户端资源 - 开始`);
// 生成
JSON_ASSETS.forEach((item) => {
event.add(new ResourceLocation(item.PATH), item.DATA);
});
// 重置
global.JSON_ASSETS = null;
console.info(`${LOG_PREFIX} 生成客户端资源 - 完成`);
});