-
Notifications
You must be signed in to change notification settings - Fork 8
/
crystals.lua
50 lines (43 loc) · 1.21 KB
/
crystals.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
local sbox = {
type = "fixed",
fixed = {-5/16, -8/16, -6/16, 5/16, -1/32, 5/16},
}
local crystal_list = {
{"ghost_crystal", "ghost_crystal.png",},
{"red_crystal", "red_crystal.png",},
{"rose_quartz", "rose_quartz.png",},
}
for i in ipairs(crystal_list) do
local name = crystal_list[i][1]
local texture = crystal_list[i][2]
minetest.register_node(":crystals:"..name.."_1", {
description = "Glowing Crystal",
drawtype = "mesh",
mesh = "crystal_shape01.obj",
tiles = {"crystals_"..texture,},
paramtype = "light",
paramtype2 = "facedir",
selection_box = sbox,
walkable = false,
light_source = 10,
use_texture_alpha = true,
visual_scale = 10,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_node(":crystals:"..name.."_2", {
description = "Glowing Crystal",
drawtype = "mesh",
mesh = "crystal_shape02.obj",
tiles = {"crystals_"..texture,},
paramtype = "light",
paramtype2 = "facedir",
selection_box = sbox,
walkable = false,
light_source = 10,
use_texture_alpha = true,
visual_scale = 10,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,},
sounds = default.node_sound_glass_defaults(),
})
end