make cooled lava flowing into stone, plus the chance of ore, and add obsidian

This commit is contained in:
Jordach 2017-12-05 01:00:47 +00:00
parent 164293920c
commit 43d15e538b
5 changed files with 109 additions and 9 deletions

View File

@ -63,7 +63,7 @@ minetest.register_node("atvomat:breaker_1", {
if meta:get_string("active") == "false" then
meta:set_string("active", "true")
minetest.get_node_timer(pos):start(1.125)
minetest.get_node_timer(pos):start(3)
meta:set_string("infotext", "Auto Block Breaker, Enabled.")
@ -147,7 +147,7 @@ minetest.register_node("atvomat:breaker_2", {
if meta:get_string("active") == "false" then
meta:set_string("active", "true")
minetest.get_node_timer(pos):start(1.125)
minetest.get_node_timer(pos):start(3)
meta:set_string("infotext", "Auto Block Collector (Gently collects blocks), Enabled.")

View File

@ -10,13 +10,6 @@ rdir[3] = minetest.dir_to_facedir({x= 0,y=-1,z= 0},true)
rdir[4] = minetest.dir_to_facedir({x= 1,y= 0,z= 0},true)
rdir[5] = minetest.dir_to_facedir({x= 0,y= 0,z= 1},true)
print(dump(rdir[0]))
print(dump(rdir[1]))
print(dump(rdir[2]))
print(dump(rdir[3]))
print(dump(rdir[4]))
print(dump(rdir[5]))
minetest.register_craftitem("atvomat:convincer", {
description = "Engineer's Convincer",

View File

@ -229,6 +229,10 @@ function beds.wake_specific_player(player) -- for those sleepy people (or leavin
if pos == nil then return end -- unlikely, but this is Minetest
if player_bed_swap[pname] == nil then return end
if player_bed_param[pname] == nil then return end
local pname = player:get_player_name()
player_sleeping[pname] = false

View File

@ -134,3 +134,97 @@ minetest.register_abm({
end,
})
-- lava cooling and obsidian;
function mcore.freeze_lava(pos, node)
if node.name == "core:lava_source" then
minetest.set_node(pos, {name="core:obsidian"})
return true
else -- we know it's not the source block.
if math.random(1, 64) == 18 then
minetest.set_node(pos, {name="core:diamond_ore"})
elseif math.random(1, 48) == 16 then
minetest.set_node(pos, {name="core:gold_ore"})
elseif math.random(1, 32) == 12 then
minetest.set_node(pos, {name="core:silver_ore"})
elseif math.random(1, 24) == 8 then
minetest.set_node(pos, {name="core:iron_ore"})
elseif math.random(1, 16) == 6 then
minetest.set_node(pos, {name="core:copper_ore"})
elseif math.random(1, 12) == 5 then
minetest.set_node(pos, {name="core:coal_ore"})
else
minetest.set_node(pos, {name="core:stone"})
end
return true
end
end
minetest.register_abm({
nodenames = {"core:lava_source", "core:lava_flowing"},
neighbors = {"core:water_source", "core:ice", "core:water_flowing"},
interval = 2,
chance = 1,
catch_up = false,
action = function(pos, node)
mcore.freeze_lava(pos, node)
end,
})
-- make lava cool down once exposed to ambient air
minetest.register_abm({
nodenames = {"core:lava_source"},
neighnors = {"air"},
interval = 180,
chance = 6,
catch_up = false,
action = function(pos, node)
minetest.set_node(pos, {name="core:obsidian"})
end,
})
-- util func for resetting the math.random seed.
local function randseed()
math.randomseed( os.time())
minetest.after(math.random(15,45), randseed)
end
minetest.after(math.random(15,45), randseed)

View File

@ -45,6 +45,15 @@ minetest.register_node("core:stone", {
sounds = mcore.sound_stone,
})
minetest.register_node("core:obsidian", {
tiles = {"core_stone.png"},
description = "Stone",
is_ground_content = true,
drop = "core:cobble",
groups = {cracky=1, solid=1},
sounds = mcore.sound_stone,
})
minetest.register_node("core:firestone", {
tiles = {"core_firestone.png"},
description = "Fire Stone",