nc_skyrealm-cd2025/rule_aggscorch.lua
2020-02-27 19:05:23 -05:00

26 lines
812 B
Lua

-- LUALOCALS < ---------------------------------------------------------
local minetest, nodecore
= minetest, nodecore
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
local api = _G[modname]
local cooksto = {
{name = "nc_terrain:hard_stone_1", weight = 18},
{name = "nc_lux:stone", weight = 1},
{name = "nc_terrain:hard_stone_2", weight = 1}
}
nodecore.register_limited_abm({
label = "aggregate insta-cooking",
interval = 1,
chance = 1,
nodenames = {"nc_concrete:wet_source"},
neighbors = {"group:lava"},
action = function(pos)
if not api.in_sky_realm(pos) then return end
local picked = nodecore.pickrand(cooksto, function(v) return v.weight end)
return nodecore.set_loud(pos, {name = picked.name})
end
})