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,