Add custom mods

- nalc modpack containing:
- nalc_lib: functions accessible by other mods
- nalc_hardtrees: Trees and other nodes becomes not hand breakable
This commit is contained in:
sys4-fr
2018-03-21 01:28:29 +01:00
parent a4aa16083e
commit 193d900a7b
7 changed files with 270 additions and 54 deletions

View File

View File

@ -0,0 +1,28 @@
nalc = {}
-- Remove node from a group
local function remove_group(name, group)
local node = minetest.registered_nodes[name]
if node then
local groups = node.groups
if groups then
for g in pairs(groups) do
if g == group then
groups[g] = 0
minetest.log("action", "[nalc_lib] "..name.." removed from group "..group..".")
end
end
minetest.override_item(name, {groups = groups})
else
minetest.log("warning", "[nalc_lib] "..name.." has no groups, could not remove group "..group..".")
end
else
minetest.log("warning", "[nalc_lib] "..name.." not registered, could not remove group "..group..".")
end
end
-- Remove node from group "oddly_breakable_by_hand"
function nalc.not_hand_breakable(name)
remove_group(name, "oddly_breakable_by_hand")
end