forked from paulevsGitch/BetterEnd
-
Notifications
You must be signed in to change notification settings - Fork 42
/
signgen.js
54 lines (47 loc) · 2 KB
/
signgen.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
const path = require("path")
const fs = require("fs")
const woods = ["pythadendron", "end_lotus", "lacugrove", "dragon_tree", "tenanea","helix_tree", "umbrella_tree", "jellyshroom", "lucernia", "mossy_glowshroom", "lucernia_jellyshroom"]
const woodDE = ["Pythadendron", "Endlotus", "Lacugrove", "Drachenbaum", "Tenanea","Spiralbaum", "Schirmbaum", "Geleepilz", "Lucernia", "Glühmospilz", "Gelelucernia"]
const woodEN = ["Pythadendron", "End Lotus", "Lacugrove", "Dragon Tree", "Tenanea","Helix Tree", "Umbrella Tree", "Jellyshroom", "Lucernia", "Mossy Glowshroom", "Jelly Lucernia"]
const nameDE = "Hängendes {wood}schild"
const nameEN = "Hanging {wood} Sign"
woods.forEach(wood => {
const blockName = wood+'_hanging_sign'
const wallBlockName = wood+'_wall_hanging_sign'
const basePath = "./src/main/resources/assets/betterend";
const particleName = 'particles_'+wood;
const blockState = `{
"variants": {
"": {
"model": "betterend:block/${particleName}"
}
}
}`
const particles = `{
"textures": {
"particle": "betterend:block/${wood}_planks"
}
}`
const model = `{
"parent": "item/generated",
"textures": {
"layer0": "betterend:item/${blockName}"
}
}`
fs.writeFileSync(path.join(basePath, "blockstates", blockName+".json"), blockState);
fs.writeFileSync(path.join(basePath, "blockstates", wallBlockName+".json"), blockState);
fs.writeFileSync(path.join(basePath, "models", "block", particleName+".json"), particles);
fs.writeFileSync(path.join(basePath, "models", "item", blockName+".json"), model);
})
console.log()
for (let i=0; i<woods.length; i++){
let wood = woods[i]
const blockName = wood+'_hanging_sign'
console.log(`"block.betterend.${blockName}": "${nameEN.replace("{wood}", woodEN[i])}",`)
}
console.log()
for (let i=0; i<woods.length; i++){
let wood = woods[i]
const blockName = wood+'_hanging_sign'
console.log(`"block.betterend.${blockName}": "${nameDE.replace("{wood}", woodDE[i])}",`)
}