forked from Ezhh/abripanes
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.lua
More file actions
64 lines (61 loc) · 2 KB
/
Copy pathapi.lua
File metadata and controls
64 lines (61 loc) · 2 KB
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
function abripanes.register_pane(name, def)
for i = 1, 15 do
core.register_alias("xpanes:" .. name .. "_" .. i, "xpanes:" .. name .. "_flat")
end
local flatgroups = table.copy(def.groups)
flatgroups.pane = 1
core.register_node(":xpanes:" .. name .. "_flat", {
description = def.description,
drawtype = "nodebox",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
inventory_image = def.inventory_image,
wield_image = def.wield_image,
paramtype2 = "facedir",
use_texture_alpha = "blend",
light_source = 4,
tiles = { def.textures[3], def.textures[3], def.textures[1] },
groups = flatgroups,
drop = "xpanes:" .. name .. "_flat",
sounds = def.sounds,
node_box = {
type = "fixed",
fixed = { { -1 / 2, -1 / 2, -1 / 32, 1 / 2, 1 / 2, 1 / 32 } },
},
selection_box = {
type = "fixed",
fixed = { { -1 / 2, -1 / 2, -1 / 32, 1 / 2, 1 / 2, 1 / 32 } },
},
connect_sides = { "left", "right" },
})
local groups = table.copy(def.groups)
groups.pane = 1
groups.not_in_creative_inventory = 1
core.register_node(":xpanes:" .. name, {
drawtype = "nodebox",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
use_texture_alpha = "blend",
light_source = 4,
description = def.description,
tiles = { def.textures[3], def.textures[3], def.textures[1] },
groups = groups,
drop = "xpanes:" .. name .. "_flat",
sounds = def.sounds,
node_box = {
type = "connected",
fixed = { { -1 / 32, -1 / 2, -1 / 32, 1 / 32, 1 / 2, 1 / 32 } },
connect_front = { { -1 / 32, -1 / 2, -1 / 2, 1 / 32, 1 / 2, -1 / 32 } },
connect_left = { { -1 / 2, -1 / 2, -1 / 32, -1 / 32, 1 / 2, 1 / 32 } },
connect_back = { { -1 / 32, -1 / 2, 1 / 32, 1 / 32, 1 / 2, 1 / 2 } },
connect_right = { { 1 / 32, -1 / 2, -1 / 32, 1 / 2, 1 / 2, 1 / 32 } },
},
connects_to = { "group:pane", "group:stone", "group:glass", "group:wood", "group:tree" },
})
core.register_craft({
output = "xpanes:" .. name .. "_flat 16",
recipe = def.recipe,
})
end