-
Notifications
You must be signed in to change notification settings - Fork 15
/
GenBlockJson.lua
86 lines (69 loc) · 2.42 KB
/
GenBlockJson.lua
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
local outFile = nil;
local modName = "idlframewok";
local blockName = "grid_normal";
local function GenModelBlockItem()
local path = string.format("src\\main\\resources\\assets\\%s\\models\\item\\%s.json", modName, blockName);
outFile = io.open(path,"w");
outFile:write('{\n');
local content = string.format("\t\"parent\": \"%s:block/%s\"\n", modName,blockName );
outFile:write(content);
outFile:write('}\n');
outFile:close();
end
local function GenModelBlock()
local path = string.format("src\\main\\resources\\assets\\%s\\models\\block\\%s.json", modName, blockName);
outFile = io.open(path,"w");
outFile:write('{\n');
outFile:write('\t\"parent\": \"block/cube_all\",\n');
outFile:write('\t\"textures\": {\n');
local content = string.format("\t\t\"all\": \"%s:blocks/%s\"\n", modName,blockName );
outFile:write(content);
outFile:write('\t}\n');
outFile:write('}\n');
outFile:close();
end
local function GenBlockState()
local path = string.format("src\\main\\resources\\assets\\%s\\blockstates\\%s.json", modName, blockName);
outFile = io.open(path,"w");
outFile:write('{\n');
outFile:write('\t\"variants\": {\n');
local content = string.format("\t\t\"normal\": { \"model\": \"%s:%s\" }\n", modName,blockName );
outFile:write(content);
outFile:write('\t}\n');
outFile:write('}\n');
outFile:close();
end
local function GenBlock(_blockName)
blockName = _blockName;
print("Creating:"..blockName)
GenModelBlockItem();
GenModelBlock();
GenBlockState();
end
local function GenItem(_typeName, _itemName)
print("Creating:".._typeName.." ".._itemName)
local path = string.format("src\\main\\resources\\assets\\%s\\models\\item\\%s.json", modName, _itemName);
outFile = io.open(path,"w");
local content = string.format('{"parent": "item/handheld","textures": {"layer0":"%s:items/%s/%s"}}\n', modName, _typeName, _itemName );
outFile:write(content);
outFile:close();
end
GenItem("misc", "idl_ai_terminal");
--GenBlock("idl_glass");
-- GenItem("misc", "nano_mender_greater");
-- GenItem("misc", "package_fade_armor_diamond");
-- for i = 1,4 do
-- GenItem("misc", "armor_qsh_"..i);
-- end
-- for i = 1,4 do
-- GenItem("misc", "mor_armor_"..i);
-- end
--GenBlock("builder_farm_sin");
--GenBlock("de_water_orb");
--GenItem("misc", "water_extractor")
--GenItem("misc", "disturb_measure")
--GenItem("skill", "skill_radar_creature")
-- GenItem("skill", "clone_block")
-- for i = 1,4 do
-- GenItem("armor", "l_m_armor_" .. i)
-- end