2020-06-06 08:23:29 -04:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
2020-06-24 08:21:43 -04:00
|
|
|
local math, minetest, nodecore, vector
|
|
|
|
= math, minetest, nodecore, vector
|
2020-06-06 08:23:29 -04:00
|
|
|
local math_random
|
|
|
|
= math.random
|
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
|
|
|
local pumname = modname .. ":pumice"
|
|
|
|
|
|
|
|
local pumdef
|
|
|
|
pumdef = {
|
|
|
|
description = "Pumice",
|
|
|
|
tiles = {"nc_igneous_pumice.png"},
|
|
|
|
groups = {
|
2020-09-06 17:09:43 -04:00
|
|
|
snappy = 2,
|
2020-06-06 08:23:29 -04:00
|
|
|
cracky = 2,
|
|
|
|
stack_as_node = 1
|
|
|
|
},
|
|
|
|
drop = "",
|
2021-07-01 21:32:04 -04:00
|
|
|
destroy_on_dig = true,
|
2020-06-06 08:23:29 -04:00
|
|
|
silktouch = false,
|
|
|
|
sounds = nodecore.sounds("nc_optics_glassy", nil, 0.8),
|
|
|
|
}
|
|
|
|
minetest.register_node(pumname, pumdef)
|
|
|
|
|
2020-06-24 08:21:43 -04:00
|
|
|
do
|
|
|
|
local dirs = nodecore.dirs()
|
2021-07-10 11:09:44 -04:00
|
|
|
minetest.register_abm({
|
2020-06-24 08:21:43 -04:00
|
|
|
label = "lava pumice",
|
|
|
|
interval = 1,
|
|
|
|
chance = 2,
|
|
|
|
nodenames = {"nc_terrain:lava_flowing"},
|
|
|
|
neighbors = {"group:coolant"},
|
|
|
|
action = function(pos)
|
|
|
|
if math_random() < 0.5 then
|
|
|
|
local p = vector.add(pos, dirs[math_random(1, #dirs)])
|
|
|
|
local n = minetest.get_node(p)
|
|
|
|
if minetest.get_item_group(n.name, "water") > 0 then
|
|
|
|
return nodecore.set_loud(p, {name = pumname})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return nodecore.set_loud(pos, {name = pumname})
|
|
|
|
end
|
|
|
|
})
|
|
|
|
end
|
2020-06-06 08:23:29 -04:00
|
|
|
|
2021-07-10 11:09:44 -04:00
|
|
|
minetest.register_abm({
|
2020-06-17 07:09:20 -04:00
|
|
|
label = "pumice melt",
|
2020-06-06 08:23:29 -04:00
|
|
|
interval = 1,
|
|
|
|
chance = 2,
|
|
|
|
nodenames = {pumname},
|
|
|
|
neighbors = {"group:lava"},
|
|
|
|
action = function(pos)
|
|
|
|
if math_random() < 0.95 and nodecore.quenched(pos) then return end
|
2020-09-07 21:34:36 -04:00
|
|
|
nodecore.set_loud(pos, {name = "nc_terrain:lava_flowing", param2 = 7})
|
|
|
|
pos.y = pos.y + 1
|
|
|
|
return nodecore.fallcheck(pos)
|
2020-06-06 08:23:29 -04:00
|
|
|
end
|
|
|
|
})
|