2017-05-05 11:24:21 -07:00
|
|
|
additional_stuff = {}
|
|
|
|
|
2013-08-11 07:01:05 -07:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "default:lava_source",
|
|
|
|
recipe = "default:stone",
|
2014-09-30 03:14:27 -07:00
|
|
|
cooktime = 20,
|
2013-08-11 07:01:05 -07:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2014-11-28 15:26:24 -08:00
|
|
|
output = "default:mossycobble",
|
|
|
|
type = "shapeless",
|
|
|
|
recipe = {"default:cobble", "group:flora"},
|
2013-08-11 07:01:05 -07:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'default:dirt',
|
|
|
|
recipe = {
|
2017-05-01 23:50:11 -07:00
|
|
|
{'nodetest:papyrus_roots', 'nodetest:papyrus_roots'},
|
|
|
|
{'nodetest:papyrus_roots', 'nodetest:papyrus_roots'},
|
2013-08-11 07:01:05 -07:00
|
|
|
}
|
|
|
|
})
|
2013-12-05 19:58:04 -08:00
|
|
|
|
2017-05-03 14:06:12 -07:00
|
|
|
if not minetest.registered_items["nodetest:papyrus_roots"] then
|
2013-12-05 19:58:04 -08:00
|
|
|
|
|
|
|
minetest.register_node(":nodetest:papyrus_roots", {
|
|
|
|
description = "Papyrus Roots",
|
|
|
|
tiles = {"nodetest_papyrus_roots.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
is_ground_content = true,
|
|
|
|
liquids_pointable = true,
|
2017-05-02 10:34:47 -07:00
|
|
|
groups = {snappy=3, flammable=2},
|
2013-12-05 19:58:04 -08:00
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'nodetest:papyrus_roots',
|
|
|
|
recipe = {
|
2017-05-03 14:06:12 -07:00
|
|
|
{'default:papyrus', 'default:papyrus', 'default:papyrus'},
|
|
|
|
{'default:papyrus', 'default:papyrus', 'default:papyrus'},
|
|
|
|
{'default:papyrus', 'default:papyrus', 'default:papyrus'},
|
2013-12-05 19:58:04 -08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2017-05-03 14:06:12 -07:00
|
|
|
output = 'default:papyrus 9',
|
2013-12-05 19:58:04 -08:00
|
|
|
recipe = {
|
|
|
|
{'nodetest:papyrus_roots'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = {"nodetest:papyrus_roots"},
|
|
|
|
neighbors = {"group:water"},
|
2017-05-02 10:34:47 -07:00
|
|
|
interval = 14,
|
|
|
|
chance = 71,
|
2013-12-05 19:58:04 -08:00
|
|
|
action = function(pos, node)
|
|
|
|
pos.y = pos.y+1
|
|
|
|
if minetest.get_node(pos).name == "air" then
|
|
|
|
minetest.set_node(pos, {name="default:papyrus"})
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2017-05-02 10:34:47 -07:00
|
|
|
local function grow_papyrus(pos, node)
|
|
|
|
pos.y = pos.y - 1
|
|
|
|
local name = minetest.get_node(pos).name
|
|
|
|
if name ~= "nodetest:papyrus_roots" then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if not minetest.find_node_near(pos, 3, {"group:water"}) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
pos.y = pos.y + 1
|
|
|
|
local height = 0
|
|
|
|
while node.name == "default:papyrus" and height < 4 do
|
|
|
|
height = height + 1
|
|
|
|
pos.y = pos.y + 1
|
|
|
|
node = minetest.get_node(pos)
|
|
|
|
end
|
|
|
|
if height == 4 or node.name ~= "air" then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if minetest.get_node_light(pos) < 13 then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
minetest.set_node(pos, {name = "default:papyrus"})
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
label = "Grow papyrus on roots",
|
|
|
|
nodenames = {"default:papyrus"},
|
|
|
|
neighbors = {"nodetest:papyrus_roots"},
|
|
|
|
interval = 14,
|
|
|
|
chance = 71,
|
|
|
|
action = function(...)
|
|
|
|
grow_papyrus(...)
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
2013-12-05 19:58:04 -08:00
|
|
|
end
|
2017-05-02 13:53:07 -07:00
|
|
|
|
|
|
|
-- Lava cooling
|
2017-05-05 11:24:21 -07:00
|
|
|
|
|
|
|
-- Exclude coal and diamond from being generated
|
|
|
|
additional_stuff.not_an_ore = {"default:stone_with_coal", "default:stone_with_diamond"}
|
|
|
|
|
|
|
|
local function is_not_an_ore(ore_name)
|
|
|
|
for _,no_ore in ipairs(additional_stuff.not_an_ore) do
|
|
|
|
if ore_name == no_ore then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Place ore just as often as they occur in mapgen.
|
|
|
|
local function choose_ore()
|
|
|
|
local cool_flowing = "default:stone"
|
|
|
|
for _, ore in pairs(minetest.registered_ores) do
|
|
|
|
if is_not_an_ore(ore.ore) then
|
|
|
|
-- Do noting, keep cycling.
|
|
|
|
elseif ore.wherein == stone and ore.ore_type == "scatter" then
|
|
|
|
local rarity = math.floor(ore.clust_scarcity / ore.clust_size)
|
|
|
|
if math.random(rarity) == 1 then
|
|
|
|
cool_flowing = ore.ore
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return cool_flowing
|
|
|
|
end
|
|
|
|
|
2017-05-02 13:53:07 -07:00
|
|
|
default.cool_lava = function(pos, node)
|
|
|
|
if node.name == "default:lava_source" then
|
2017-05-05 11:24:21 -07:00
|
|
|
local cool_source = "default:stone"
|
|
|
|
-- different for subgame used
|
2017-05-02 13:53:07 -07:00
|
|
|
if minetest.registered_items["default:molten_rock"] then
|
|
|
|
-- Voxelgarden
|
2017-05-05 11:24:21 -07:00
|
|
|
cool_source = "default:molten_rock"
|
2017-05-02 13:53:07 -07:00
|
|
|
elseif minetest.registered_items["default:obsidian"] then
|
|
|
|
-- Minetest Game
|
2017-05-05 11:24:21 -07:00
|
|
|
cool_source = "default:obsidian"
|
2017-05-02 13:53:07 -07:00
|
|
|
end
|
2017-05-05 11:24:21 -07:00
|
|
|
minetest.set_node(pos, {name = cool_source})
|
2017-05-02 13:53:07 -07:00
|
|
|
else -- Lava flowing
|
2017-05-05 11:24:21 -07:00
|
|
|
local cool_flowing = choose_ore()
|
|
|
|
minetest.set_node(pos, {name = cool_flowing})
|
2017-05-02 13:53:07 -07:00
|
|
|
end
|
|
|
|
minetest.sound_play("default_cool_lava",
|
|
|
|
{pos = pos, max_hear_distance = 16, gain = 0.25})
|
|
|
|
end
|