1
0

feat: 添加现代彩色灯方块

This commit is contained in:
2022-09-04 18:05:43 +08:00
parent 94ad90ab64
commit 78b0f75973
50 changed files with 75 additions and 0 deletions

View File

@@ -290,6 +290,46 @@ onEvent('block.registry', (event) => {
});
// 注册方块 - 灯
onEvent('block.registry', (event) => {
console.info(`${LOG_PREFIX} 注册方块 - 灯 - 开始`);
const keys = Object.keys(COLORS);
keys.forEach((key) => {
const color = COLORS[key];
const id = `${MOD_ID}:lamp_modern_${color.CODE}`;
const block = event.create(id, 'basic');
// 纹理文件路径前缀
// wheat_plus:block/lamp_modern/color_
const tBase = `${PATH_TEXTURE}lamp_modern/${color.CODE}`;
setBlockProps(block, {
boxType: 'full',
displayName: `现代${color.LABEL_CN}`,
lightLevel: 1,
material: 'glass',
renderType: 'translucent',
});
block.modelJson = {
parent: `${PATH_MODEL}lamp_modern`,
textures: {
glow: `${tBase}_glow`,
core: `${tBase}_core`,
particle: `${tBase}_core`
}
};
});
console.info(`${LOG_PREFIX} 注册方块 - 灯 - 完成`);
});
// 注册物品
// onEvent('item.registry', (event) => {
// console.info(`${LOG_PREFIX} 注册物品 - 开始`);

View File

@@ -0,0 +1,35 @@
{
"credit": "Create by Frost-ZX using Blockbench.",
"parent": "block/block",
"ambientocclusion": false,
"elements": [
{
"name": "core",
"from": [0, 0, 0],
"to": [16, 16, 16],
"shade": false,
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#core"},
"east": {"uv": [0, 0, 16, 16], "texture": "#core"},
"south": {"uv": [0, 0, 16, 16], "texture": "#core"},
"west": {"uv": [0, 0, 16, 16], "texture": "#core"},
"up": {"uv": [0, 0, 16, 16], "texture": "#core"},
"down": {"uv": [0, 0, 16, 16], "texture": "#core"}
}
},
{
"name": "glow",
"from": [-0.75, -0.75, -0.75],
"to": [16.75, 16.75, 16.75],
"shade": false,
"faces": {
"north": {"uv": [3, 3, 13, 13], "texture": "#glow"},
"east": {"uv": [3, 3, 13, 13], "texture": "#glow"},
"south": {"uv": [3, 3, 13, 13], "texture": "#glow"},
"west": {"uv": [3, 3, 13, 13], "texture": "#glow"},
"up": {"uv": [3, 3, 13, 13], "texture": "#glow"},
"down": {"uv": [3, 3, 13, 13], "texture": "#glow"}
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB