-
Notifications
You must be signed in to change notification settings - Fork 3
/
buildSlab.js
86 lines (76 loc) · 2.87 KB
/
buildSlab.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const path = require("path")
const fs = require("fs")
const colors = [
'white', 'light_gray', 'gray', 'black',
'brown',
'red', 'orange', 'yellow', 'lime', 'green', 'cyan', 'light_blue', 'blue', 'purple', 'magenta', 'pink']
const colorsEN = [
'White', 'Light gray', 'Gray', 'Black',
'Brown',
'Red', 'Orange', 'Yellow', 'Lime', 'Green', 'Cyan', 'Light blue', 'Blue', 'Purple', 'Magenta', 'Pink']
const colorsDE = [
'Weiße', 'Hellgraue', 'Graue', 'Schwarze',
'Braune',
'Rote', 'Orange', 'Gelbe', 'Hellgrüne', 'Grüne', 'Türkise', 'Hellblaue', 'Blaue', 'Violette', 'Magenta', 'Pinke']
const type = "wool"
const nameEN = "Wool Slab"
const nameDE = "Wollstufe"
colors.forEach(color => {
const blockName = color+'_'+type
const basePath = "./src/main/resources/assets/wunderreich";
const blockState = `{
"variants": {
"type=bottom": {
"model": "wunderreich:block/${blockName}_slab"
},
"type=double": {
"model": "block/${blockName}"
},
"type=top": {
"model": "wunderreich:block/${blockName}_slab_top"
}
}
}`
const modelTop = `{
"parent": "minecraft:block/slab_top",
"textures": {
"bottom": "minecraft:block/${blockName}",
"top": "minecraft:block/${blockName}",
"side": "minecraft:block/${blockName}"
}
}`
const modelBottom = `{
"parent": "minecraft:block/slab",
"textures": {
"particle": "block/${blockName}",
"bottom": "minecraft:block/${blockName}",
"top": "minecraft:block/${blockName}",
"side": "minecraft:block/${blockName}"
}
}`
const item = `{
"parent": "wunderreich:block/${blockName}_slab"
}`
const BLOCK_NAME = blockName.toUpperCase();
const register = `public static final Block ${BLOCK_NAME}_SLAB = registerSlab("${blockName}_slab",
Blocks.${BLOCK_NAME},
ConcreteSlabBlock::new,
Configs.MAIN.addSlabs.get());`
fs.writeFileSync(path.join(basePath, "blockstates", blockName+"_slab.json"), blockState);
fs.writeFileSync(path.join(basePath, "models/block", blockName+"_slab.json"), modelBottom);
fs.writeFileSync(path.join(basePath, "models/block", blockName+"_slab_top.json"), modelTop);
fs.writeFileSync(path.join(basePath, "models/item", blockName+"_slab.json"), item);
console.log(register);
})
console.log()
for (let i=0; i<colors.length; i++){
let color = colors[i]
const blockName = color+'_'+type
console.log(`"block.wunderreich.${blockName}_slab": "${colorsEN[i]} ${nameEN}",`)
}
console.log()
for (let i=0; i<colors.length; i++){
let color = colors[i]
const blockName = color+'_'+type
console.log(`"block.wunderreich.${blockName}_slab": "${colorsDE[i]} ${nameDE}",`)
}