From 929b055c0891640e056573cccc7228f84655fad9 Mon Sep 17 00:00:00 2001 From: Frost-ZX Date: Sun, 21 May 2023 00:05:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=B2=99=E7=A0=BE?= =?UTF-8?q?=E6=A5=BC=E6=A2=AF=E3=80=81=E6=B2=99=E7=A0=BE=E5=8D=8A=E7=A0=96?= =?UTF-8?q?=E3=80=81=E6=A9=A1=E6=9C=A8=E6=A0=91=E5=8F=B6=E5=A2=99=E6=96=B9?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kubejs/startup_scripts/wheat_plus.js | 61 ++++++++++++++++-- .../textures/block/common/oak_leaves.png | Bin 0 -> 445 bytes 2 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 resourcepack/assets/wheat_plus/textures/block/common/oak_leaves.png diff --git a/kubejs/startup_scripts/wheat_plus.js b/kubejs/startup_scripts/wheat_plus.js index fbc1f66..fa02429 100644 --- a/kubejs/startup_scripts/wheat_plus.js +++ b/kubejs/startup_scripts/wheat_plus.js @@ -713,12 +713,12 @@ function regBlockRoad(event) { } /** - * @description 注册方块 - 其它 + * @description 注册方块 - 其他 - 基础 * @param {Registry.Block} event */ -function regBlockOther(event) { +function regBlockOtherBasic(event) { - console.info(`${LOG_PREFIX} 注册方块 - 其它 - 开始`); + console.info(`${LOG_PREFIX} 注册方块 - 其他 - 基础 - 开始`); const blocks = [ { @@ -807,7 +807,57 @@ function regBlockOther(event) { }); - console.info(`${LOG_PREFIX} 注册方块 - 其它 - 完成`); + console.info(`${LOG_PREFIX} 注册方块 - 其他 - 基础 - 完成`); + +} + +/** + * @description 注册方块 - 其他 - 特殊 + * @param {Registry.Block} event + */ +function regBlockOtherShaped(event) { + + console.info(`${LOG_PREFIX} 注册方块 - 其他 - 特殊 - 开始`); + + const blocks = [ + { + name: 'gravel_stairs', + label: '沙砾楼梯', + texture: 'minecraft:block/gravel', + type: 'stairs', + }, + { + name: 'gravel_slab', + label: '沙砾半砖', + texture: 'minecraft:block/gravel', + type: 'slab', + }, + { + name: 'oak_leaves_wall', + label: '橡木树叶墙', + texture: `${P_BLOCK}/common/oak_leaves`, + type: 'wall', + }, + ]; + + blocks.forEach((config) => { + + const id = `${MOD_ID}:${config.name}`; + const block = event.create(id, config.type); + + // 设置基础属性 + setBlockProps(block, { + displayName: config.label, + material: 'stone', + renderType: 'cutout_mipped', + }); + + // 设置方块纹理 + block.textureAll(config.texture); + + }); + + console.info(`${LOG_PREFIX} 注册方块 - 其他 - 特殊 - 完成`); } @@ -819,7 +869,8 @@ onEvent('block.registry', regBlockLampSimple); onEvent('block.registry', regBlockMinecart); onEvent('block.registry', regBlockRoad); onEvent('block.registry', regBlockReinforcedConcrete); -onEvent('block.registry', regBlockOther); +onEvent('block.registry', regBlockOtherBasic); +onEvent('block.registry', regBlockOtherShaped); // 注册物品 // onEvent('item.registry', function (event) { diff --git a/resourcepack/assets/wheat_plus/textures/block/common/oak_leaves.png b/resourcepack/assets/wheat_plus/textures/block/common/oak_leaves.png new file mode 100644 index 0000000000000000000000000000000000000000..bfc49cf9699d7fef74bd78d6d596d86f02ac031e GIT binary patch literal 445 zcmV;u0Yd(XP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf6951U69E94oEQKA0a8gsK~y+TU6Vad z12GVV$CjvqAle2A#07E!4#fe|P^H-ea41fI==qUoRsoTUV##Oci-wG}@%nk*%$w&; zS*~M_eQd`lcaOvTbU&5V*smo@X>}-PHf@V@gMXZfr5W`SkuF