1
0

feat: 添加纸箱方块

This commit is contained in:
2025-05-01 22:48:39 +08:00
parent eae8f31702
commit 21a2354a86
5 changed files with 40 additions and 0 deletions

View File

@@ -132,6 +132,8 @@ global.setBlockProps = function (block, opts) {
let soundType = defaults(opts.soundType, 'stone');
let textureAll = defaults(opts.textureAll, '');
let textureSide = defaults(opts.textureSide, '');
let textureSideNS = defaults(opts.textureSideNS, '');
let textureSideWE = defaults(opts.textureSideWE, '');
let textureUpDown = defaults(opts.textureUpDown, '');
if (boxType === 'custom') {
@@ -184,6 +186,20 @@ global.setBlockProps = function (block, opts) {
], textureSide);
}
if (textureSideNS) {
block.texture([
Direction.NORTH,
Direction.SOUTH,
], textureSideNS);
}
if (textureSideWE) {
block.texture([
Direction.WEST,
Direction.EAST,
], textureSideWE);
}
if (textureUpDown) {
block.texture([
Direction.UP,

View File

@@ -305,6 +305,18 @@ function regBlockCommon(event) {
let blockList = [
// 普通方块
{
name: 'carton_a',
label: '纸箱',
blockstate: null,
box: null,
model: '',
texture: '',
textureSideNS: 'common/carton_a_ns',
textureSideWE: 'common/carton_a_we',
textureUpDown: 'common/carton_a_ud',
type: '',
},
{
name: 'crash_barriar_a',
label: '防撞墩(石头)',
@@ -1185,6 +1197,10 @@ function regBlockCommon(event) {
let textureAllPath1 = textureAllPath0 || '';
let textureSidePath0 = config.textureSide;
let textureSidePath1 = textureSidePath0 || '';
let textureSideNSPath0 = config.textureSideNS;
let textureSideNSPath1 = textureSideNSPath0 || '';
let textureSideWEPath0 = config.textureSideWE;
let textureSideWEPath1 = textureSideWEPath0 || '';
let textureUpDownPath0 = config.textureUpDown;
let textureUpDownPath1 = textureUpDownPath0 || '';
@@ -1195,6 +1211,12 @@ function regBlockCommon(event) {
if (textureSidePath0 && !textureSidePath0.includes(':')) {
textureSidePath1 = `${P_BLOCK}/${textureSidePath0}`;
}
if (textureSideNSPath0 && !textureSideNSPath0.includes(':')) {
textureSideNSPath1 = `${P_BLOCK}/${textureSideNSPath0}`;
}
if (textureSideWEPath0 && !textureSideWEPath0.includes(':')) {
textureSideWEPath1 = `${P_BLOCK}/${textureSideWEPath0}`;
}
if (textureUpDownPath0 && !textureUpDownPath0.includes(':')) {
textureUpDownPath1 = `${P_BLOCK}/${textureUpDownPath0}`;
}
@@ -1222,6 +1244,8 @@ function regBlockCommon(event) {
} : null,
textureAll: textureAllPath1,
textureSide: textureSidePath1,
textureSideNS: textureSideNSPath1,
textureSideWE: textureSideWEPath1,
textureUpDown: textureUpDownPath1,
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB