refactor: 支持 Minecraft 1.21.1 版本
This commit is contained in:
@@ -6,20 +6,18 @@ const LOG_PREFIX = global.LOG_PREFIX;
|
||||
console.info(`${LOG_PREFIX} 加载客户端内容`);
|
||||
|
||||
// 生成客户端资源
|
||||
// event.add(new ResourceLocation(`<命名空间>:<资源相对路径>`), `JSON`);
|
||||
// event.add(new ResourceLocation(`minecraft:models/block/stone`), {});
|
||||
onEvent('client.generate_assets', (event) => {
|
||||
|
||||
if (!Array.isArray(JSON_ASSETS)) {
|
||||
return;
|
||||
}
|
||||
ClientEvents.generateAssets('after_mods', function (event) {
|
||||
|
||||
console.info(`${LOG_PREFIX} 生成客户端资源 - 开始`);
|
||||
|
||||
JSON_ASSETS.forEach((item) => {
|
||||
event.add(new ResourceLocation(item.PATH), item.DATA);
|
||||
});
|
||||
if (Array.isArray(JSON_ASSETS)) {
|
||||
JSON_ASSETS.forEach((item) => {
|
||||
event.json(item.path, item.data);
|
||||
});
|
||||
} else {
|
||||
console.error(`${LOG_PREFIX} 生成客户端资源 - 异常 - 列表不是数组`);
|
||||
}
|
||||
|
||||
console.info(`${LOG_PREFIX} 生成客户端资源 - 完成`);
|
||||
console.info(`${LOG_PREFIX} 生成客户端资源 - 结束`);
|
||||
|
||||
});
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "ES2015",
|
||||
"lib": [
|
||||
"ES5",
|
||||
"ES2015"
|
||||
],
|
||||
"rootDir": ".",
|
||||
"typeRoots": [
|
||||
"../../.probe/client/probe-types"
|
||||
],
|
||||
"baseUrl": "../../.probe/client/probe-types",
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"files": [
|
||||
"../constants.d.ts"
|
||||
],
|
||||
"include": [
|
||||
"./**/*.js",
|
||||
"./**/*.ts",
|
||||
null
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user