feat: 添加纸箱方块
This commit is contained in:
@@ -132,6 +132,8 @@ global.setBlockProps = function (block, opts) {
|
|||||||
let soundType = defaults(opts.soundType, 'stone');
|
let soundType = defaults(opts.soundType, 'stone');
|
||||||
let textureAll = defaults(opts.textureAll, '');
|
let textureAll = defaults(opts.textureAll, '');
|
||||||
let textureSide = defaults(opts.textureSide, '');
|
let textureSide = defaults(opts.textureSide, '');
|
||||||
|
let textureSideNS = defaults(opts.textureSideNS, '');
|
||||||
|
let textureSideWE = defaults(opts.textureSideWE, '');
|
||||||
let textureUpDown = defaults(opts.textureUpDown, '');
|
let textureUpDown = defaults(opts.textureUpDown, '');
|
||||||
|
|
||||||
if (boxType === 'custom') {
|
if (boxType === 'custom') {
|
||||||
@@ -184,6 +186,20 @@ global.setBlockProps = function (block, opts) {
|
|||||||
], textureSide);
|
], textureSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (textureSideNS) {
|
||||||
|
block.texture([
|
||||||
|
Direction.NORTH,
|
||||||
|
Direction.SOUTH,
|
||||||
|
], textureSideNS);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (textureSideWE) {
|
||||||
|
block.texture([
|
||||||
|
Direction.WEST,
|
||||||
|
Direction.EAST,
|
||||||
|
], textureSideWE);
|
||||||
|
}
|
||||||
|
|
||||||
if (textureUpDown) {
|
if (textureUpDown) {
|
||||||
block.texture([
|
block.texture([
|
||||||
Direction.UP,
|
Direction.UP,
|
||||||
|
|||||||
@@ -305,6 +305,18 @@ function regBlockCommon(event) {
|
|||||||
|
|
||||||
let blockList = [
|
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',
|
name: 'crash_barriar_a',
|
||||||
label: '防撞墩(石头)',
|
label: '防撞墩(石头)',
|
||||||
@@ -1185,6 +1197,10 @@ function regBlockCommon(event) {
|
|||||||
let textureAllPath1 = textureAllPath0 || '';
|
let textureAllPath1 = textureAllPath0 || '';
|
||||||
let textureSidePath0 = config.textureSide;
|
let textureSidePath0 = config.textureSide;
|
||||||
let textureSidePath1 = textureSidePath0 || '';
|
let textureSidePath1 = textureSidePath0 || '';
|
||||||
|
let textureSideNSPath0 = config.textureSideNS;
|
||||||
|
let textureSideNSPath1 = textureSideNSPath0 || '';
|
||||||
|
let textureSideWEPath0 = config.textureSideWE;
|
||||||
|
let textureSideWEPath1 = textureSideWEPath0 || '';
|
||||||
let textureUpDownPath0 = config.textureUpDown;
|
let textureUpDownPath0 = config.textureUpDown;
|
||||||
let textureUpDownPath1 = textureUpDownPath0 || '';
|
let textureUpDownPath1 = textureUpDownPath0 || '';
|
||||||
|
|
||||||
@@ -1195,6 +1211,12 @@ function regBlockCommon(event) {
|
|||||||
if (textureSidePath0 && !textureSidePath0.includes(':')) {
|
if (textureSidePath0 && !textureSidePath0.includes(':')) {
|
||||||
textureSidePath1 = `${P_BLOCK}/${textureSidePath0}`;
|
textureSidePath1 = `${P_BLOCK}/${textureSidePath0}`;
|
||||||
}
|
}
|
||||||
|
if (textureSideNSPath0 && !textureSideNSPath0.includes(':')) {
|
||||||
|
textureSideNSPath1 = `${P_BLOCK}/${textureSideNSPath0}`;
|
||||||
|
}
|
||||||
|
if (textureSideWEPath0 && !textureSideWEPath0.includes(':')) {
|
||||||
|
textureSideWEPath1 = `${P_BLOCK}/${textureSideWEPath0}`;
|
||||||
|
}
|
||||||
if (textureUpDownPath0 && !textureUpDownPath0.includes(':')) {
|
if (textureUpDownPath0 && !textureUpDownPath0.includes(':')) {
|
||||||
textureUpDownPath1 = `${P_BLOCK}/${textureUpDownPath0}`;
|
textureUpDownPath1 = `${P_BLOCK}/${textureUpDownPath0}`;
|
||||||
}
|
}
|
||||||
@@ -1222,6 +1244,8 @@ function regBlockCommon(event) {
|
|||||||
} : null,
|
} : null,
|
||||||
textureAll: textureAllPath1,
|
textureAll: textureAllPath1,
|
||||||
textureSide: textureSidePath1,
|
textureSide: textureSidePath1,
|
||||||
|
textureSideNS: textureSideNSPath1,
|
||||||
|
textureSideWE: textureSideWEPath1,
|
||||||
textureUpDown: textureUpDownPath1,
|
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 |
Reference in New Issue
Block a user