forked from nalc/nalc-server
Update nalc_lib mod
This commit is contained in:
parent
547426d507
commit
5a47a08347
|
@ -22,6 +22,27 @@ local function remove_group(name, group)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Add node to group
|
||||||
|
local function add_group(name, group, value)
|
||||||
|
local node = minetest.registered_nodes[name]
|
||||||
|
|
||||||
|
if node then
|
||||||
|
local groups = node.groups
|
||||||
|
if not groups then
|
||||||
|
groups = {}
|
||||||
|
end
|
||||||
|
groups[group] = value
|
||||||
|
|
||||||
|
minetest.log("action", "[nalc_lib] Add group "..group.."="..value.." to "..name)
|
||||||
|
minetest.override_item(name, {groups = groups})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Add a node in xp group
|
||||||
|
function nalc.def_xp(name, value)
|
||||||
|
add_group(name, "xp", value)
|
||||||
|
end
|
||||||
|
|
||||||
-- Remove node from group "oddly_breakable_by_hand"
|
-- Remove node from group "oddly_breakable_by_hand"
|
||||||
function nalc.not_hand_breakable(name)
|
function nalc.not_hand_breakable(name)
|
||||||
remove_group(name, "oddly_breakable_by_hand")
|
remove_group(name, "oddly_breakable_by_hand")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user