feat: 添加现代彩色灯方块
@@ -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) => {
|
// onEvent('item.registry', (event) => {
|
||||||
// console.info(`${LOG_PREFIX} 注册物品 - 开始`);
|
// console.info(`${LOG_PREFIX} 注册物品 - 开始`);
|
||||||
|
|||||||
@@ -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"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 1.2 KiB |