Aaron Suen b2f78c0daa Indexing for craft checks
By restricting the recipes we check based
on the name of the central object being
checked, we can do many fewer craft
checks per item and avoid expensive
checks.
2020-06-27 12:20:35 -04:00

42 lines
1016 B
Lua

-- LUALOCALS < ---------------------------------------------------------
local minetest, nodecore
= minetest, nodecore
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
nodecore.register_soaking_abm({
label = "lux renew",
fieldname = "lavalux",
interval = 10,
chance = 1,
nodenames = {"group:amalgam"},
neighbors = {"group:lux_fluid"},
soakrate = nodecore.lux_soak_rate,
soakcheck = function(data, pos)
if data.total < 12500 then return end
nodecore.set_loud(pos, {name = modname .. ":cobble"
.. nodecore.lux_react_qty(pos, 1)})
nodecore.witness(pos, "lux renewal")
end
})
nodecore.register_craft({
label = "lode renew",
action = "pummel",
toolgroups = {thumpy = 2},
normal = {y = 1},
indexkeys = {"nc_lode:prill_hot"},
nodes = {
{
match = "nc_lode:prill_hot",
replace = "air"
},
{
y = -1,
match = modname .. ":cobble8",
replace = "nc_lode:cobble_hot"
}
}
})