-
Notifications
You must be signed in to change notification settings - Fork 1
/
nodes.lua
61 lines (50 loc) · 1.98 KB
/
nodes.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
function fire_realism.generate_drops(drops, n)
if type(drops) == "string" then
drops = {items={{items={"fire_realism:charcoal_lump"}, rarity = 4},{items={drops}}}}
return drops
end
if type(drops) == "nil" then
drops = {items={{items={"fire_realism:charcoal_lump"}, rarity = 4},{items={n}}}}
return drops
end
drops.max_items = drops.max_items or 1
drops.items = drops.items or {}
local charcoal = {items = {"fire_realism:charcoal_lump"}, rarity = 4}
table.insert(drops.items,1,charcoal)
return drops
end
for i,v in ipairs(fire_realism.soil_nodes()) do
local node = minetest.registered_nodes[v]
local node_names = fire_realism.split_string(v,":")
local drops = fire_realism.generate_drops(node.drop,v)
if minetest.get_item_group(v,"ash") < 1 then
local underlay = "default_dirt.png"
if type(node.tiles) == "string" then
underlay = node.tiles
elseif type(node.tiles) == "table" then
underlay = node.tiles[2] or node.tiles[1]
end
minetest.register_node("fire_realism:ash_and_"..node_names[2], {
description = "Ash and "..node.description,
tiles = {"fire_realism_ash.png", underlay,
{name = underlay.."^fire_realism_ash_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1, ash = 1, cooled_ash = 1, not_in_creative_inventory = 1},
ash_type = v,
drop = drops,
sounds = default.node_sound_dirt_defaults()
})
minetest.register_node("fire_realism:hot_ash_and_"..node_names[2], {
description = "Hot Ash and "..node.description,
tiles = {"fire_realism_ash_hot.png", underlay,
{name = underlay.."^fire_realism_ash_hot_side.png",
tileable_vertical = false}},
paramtype = "light",
light_source = 4,
groups = {crumbly = 3, soil = 1, ash = 1, hot_ash = 1, igniter = 1, not_in_creative_inventory = 1},
ash_type = v,
drop = drops,
sounds = default.node_sound_dirt_defaults()
})
end
end