From 46fabc2901bf7f04f74d0e0d18bb53de17b7be8a Mon Sep 17 00:00:00 2001 From: Frost-ZX Date: Tue, 6 May 2025 21:45:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=96=B9=E5=9D=97=E7=9A=84=E7=B2=92=E5=AD=90=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E7=BA=B9=E7=90=86=E6=98=AF=E9=BB=91=E7=B4=AB=E6=96=B9=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kubejs/constants.d.ts | 3 +++ kubejs/startup_scripts/_main_.js | 5 +++++ kubejs/startup_scripts/wheat_plus.js | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/kubejs/constants.d.ts b/kubejs/constants.d.ts index d58b8d5..83ec85f 100644 --- a/kubejs/constants.d.ts +++ b/kubejs/constants.d.ts @@ -152,6 +152,9 @@ type SetBlockPropsOpts = { /** 纹理文件路径,每一面都相同时指定 */ textureAll?: string; + /** 方块粒子效果纹理文件路径,不使用 `textureAll` 的情况下才需要指定 */ + textureParticle?: string; + /** 纹理文件路径,侧面都相同时指定 */ textureSide?: string; diff --git a/kubejs/startup_scripts/_main_.js b/kubejs/startup_scripts/_main_.js index 3f2501a..04e0e11 100644 --- a/kubejs/startup_scripts/_main_.js +++ b/kubejs/startup_scripts/_main_.js @@ -131,6 +131,7 @@ global.setBlockProps = function (block, opts) { let resistance = defaults(opts.resistance, 16); let soundType = defaults(opts.soundType, 'stone'); let textureAll = defaults(opts.textureAll, ''); + let textureParticle = defaults(opts.textureParticle, ''); let textureSide = defaults(opts.textureSide, ''); let textureSideNS = defaults(opts.textureSideNS, ''); let textureSideWE = defaults(opts.textureSideWE, ''); @@ -177,6 +178,10 @@ global.setBlockProps = function (block, opts) { block.texture(textureAll); } + if (textureParticle) { + block.texture('particle', textureParticle); + } + if (textureSide) { block.texture([ Direction.NORTH, diff --git a/kubejs/startup_scripts/wheat_plus.js b/kubejs/startup_scripts/wheat_plus.js index 74b22ca..8bbe1f1 100644 --- a/kubejs/startup_scripts/wheat_plus.js +++ b/kubejs/startup_scripts/wheat_plus.js @@ -354,6 +354,7 @@ function regBlockCommon(event) { box: null, model: '', texture: '', + textureParticle: 'common/carton_a_ud', textureSideNS: 'common/carton_a_ns', textureSideWE: 'common/carton_a_we', textureUpDown: 'common/carton_a_ud', @@ -1318,6 +1319,7 @@ function regBlockCommon(event) { box: null, model: '', texture: '', + textureParticle: 'common/tree_maple_wood_side', textureSide: 'common/tree_maple_wood_side', textureUpDown: 'common/tree_maple_wood_ud', type: '', @@ -1338,6 +1340,7 @@ function regBlockCommon(event) { box: null, model: '', texture: '', + textureParticle: 'common/tree_palm_wood_side', textureSide: 'common/tree_palm_wood_side', textureUpDown: 'common/tree_palm_wood_ud', type: '', @@ -1358,6 +1361,7 @@ function regBlockCommon(event) { box: null, model: '', texture: '', + textureParticle: 'common/tree_willow_wood_side', textureSide: 'common/tree_willow_wood_side', textureUpDown: 'common/tree_willow_wood_ud', type: '', @@ -1418,6 +1422,8 @@ function regBlockCommon(event) { // 获取纹理文件路径 let textureAllPath0 = config.texture; let textureAllPath1 = textureAllPath0 || ''; + let textureParticlePath0 = config.textureParticle; + let textureParticlePath1 = textureParticlePath0 || ''; let textureSidePath0 = config.textureSide; let textureSidePath1 = textureSidePath0 || ''; let textureSideNSPath0 = config.textureSideNS; @@ -1431,6 +1437,9 @@ function regBlockCommon(event) { if (textureAllPath0 && !textureAllPath0.includes(':')) { textureAllPath1 = `${P_BLOCK}/${textureAllPath0}`; } + if (textureParticlePath0 && !textureParticlePath0.includes(':')) { + textureParticlePath1 = `${P_BLOCK}/${textureParticlePath0}`; + } if (textureSidePath0 && !textureSidePath0.includes(':')) { textureSidePath1 = `${P_BLOCK}/${textureSidePath0}`; } @@ -1476,6 +1485,7 @@ function regBlockCommon(event) { filePath: modelPath1, } : null, textureAll: textureAllPath1, + textureParticle: textureParticlePath1, textureSide: textureSidePath1, textureSideNS: textureSideNSPath1, textureSideWE: textureSideWEPath1,