-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathoctagon_panes.lua
155 lines (145 loc) · 3.98 KB
/
octagon_panes.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
local function register(basename, color, texture)
local nodename_single = "scifi_nodes:" .. basename .. "_pane"
local nodename_double = "scifi_nodes:" .. basename .. "_pane_double"
local nodename_offset = "scifi_nodes:" .. basename .. "_pane_offset"
local nodename_slope = "scifi_nodes:" .. basename .. "_slope"
local recipe_ingredient = "scifi_nodes:" .. basename
local base_decription = color .. " octagon glass"
-- single height
minetest.register_node(nodename_single, {
description = base_decription .. " pane",
drawtype = "nodebox",
tiles = {
texture
},
wield_image = texture,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = false,
node_box = {
type = "fixed",
fixed = {{-0.5, -0.5, -0.03125, 0.5, 0.5, 0.03125}},
},
selection_box = {
type = "fixed",
fixed = {{-0.5, -0.5, -0.25, 0.5, 0.5, 0.25}},
},
groups = {
cracky = 3,
oddly_breakable_by_hand = 3
},
use_texture_alpha = "blend",
sounds = scifi_nodes.node_sound_glass_defaults()
})
-- double height
minetest.register_node(nodename_double, {
description = base_decription .. " pane (double)",
drawtype = "nodebox",
tiles = {
texture
},
wield_image = texture,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = false,
node_box = {
type = "fixed",
fixed = {{-0.5, -0.5, -0.03125, 0.5, 1.5, 0.03125}},
},
selection_box = {
type = "fixed",
fixed = {{-0.5, -0.5, -0.25, 0.5, 1.5, 0.25}},
},
groups = {
cracky = 3,
oddly_breakable_by_hand = 3
},
use_texture_alpha = "blend",
sounds = scifi_nodes.node_sound_glass_defaults()
})
-- single height with offset
minetest.register_node(nodename_offset, {
description = base_decription .. " pane (offset)",
drawtype = "nodebox",
tiles = {
texture
},
wield_image = texture,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = false,
node_box = {
type = "fixed",
fixed = {{-0.5, -0.5, 0.96875, 0.5, 0.5, 1.03125}},
},
selection_box = {
type = "fixed",
fixed = {{-0.5, -0.5, 0.75, 0.5, 0.5, 1.25}},
},
groups = {
cracky = 3,
oddly_breakable_by_hand = 3,
not_blocking_trains = 1
},
use_texture_alpha = "blend",
sounds = scifi_nodes.node_sound_glass_defaults()
})
-- slope pane
minetest.register_node(nodename_slope, {
description = base_decription .. " pane (slope)",
sunlight_propagates = true,
drawtype = "mesh",
mesh = "scifi_nodes_slope_simple.obj",
tiles = {
texture
},
paramtype = "light",
paramtype2 = "facedir",
use_texture_alpha = "blend",
light_source = 10,
groups = {
cracky = 2,
dig_generic = 3
},
selection_box = scifi_nodes.slope_box_simple,
collision_box = scifi_nodes.slope_box_simple,
is_ground_content = false,
sounds = scifi_nodes.node_sound_glass_defaults()
})
-- register recipes
minetest.register_craft({
output = nodename_single .. " 16",
recipe = {
{recipe_ingredient}
},
})
minetest.register_craft({
output = nodename_slope .. " 16",
recipe = {
{"", "", recipe_ingredient},
{"", recipe_ingredient, ""},
{recipe_ingredient, "", ""}
},
})
minetest.register_craft({
output = nodename_double .. " 16",
recipe = {
{recipe_ingredient},
{recipe_ingredient}
},
})
minetest.register_craft({
output = nodename_offset,
type = "shapeless",
recipe = {nodename_single},
})
end
register("octrng", "Orange", "scifi_nodes_octrng.png")
register("octgrn", "Green", "scifi_nodes_octgrn.png")
register("octbl", "Blue", "scifi_nodes_octbl.png")
register("octppl", "Purple", "scifi_nodes_octppl.png")
register("octwht", "White", "scifi_nodes_octwht.png")
register("glass", "Dark Glass pane", "scifi_nodes_glass.png")