forked from nalc/nalc-server
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:
0
custom/mods/nalc/modpack.txt
Normal file
0
custom/mods/nalc/modpack.txt
Normal file
2
custom/mods/nalc/nalc_hardtrees/depends.txt
Normal file
2
custom/mods/nalc/nalc_hardtrees/depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
nalc_lib
|
||||
default
|
46
custom/mods/nalc/nalc_hardtrees/init.lua
Normal file
46
custom/mods/nalc/nalc_hardtrees/init.lua
Normal file
@ -0,0 +1,46 @@
|
||||
--[[ Auteur : sys4
|
||||
|
||||
Ce mod permet de :
|
||||
- Ne plus casser les arbres à la main
|
||||
- Supprimer haches et pioches en bois.
|
||||
- Fabriquer les outils en pierre avec du silex trouvé dans le gravier
|
||||
|
||||
Remarque : Les sticks sont obtenables grâce au mod youngtrees de plantlife_modpack
|
||||
]]
|
||||
|
||||
-- Suppression des haches et pioches en bois
|
||||
minetest.unregister_item("default:axe_wood")
|
||||
minetest.unregister_item("default:pick_wood")
|
||||
|
||||
-- Suppression du groupe oddly_breakable_by_hand pour les nodes en bois du mod default
|
||||
local wood_nodes = {}
|
||||
wood_nodes["default"] = {
|
||||
"tree", "pine_tree", "jungletree", "acacia_tree", "aspen_tree",
|
||||
"bush_stem", "acacia_bush_stem",
|
||||
"wood", "pine_wood", "junglewood", "acacia_wood", "aspen_wood",
|
||||
}
|
||||
|
||||
for mod, nodes in pairs(wood_nodes) do
|
||||
for _,name in ipairs(nodes) do
|
||||
nalc.not_hand_breakable(mod..":"..name)
|
||||
end
|
||||
end
|
||||
|
||||
-- Recette de craft pour pioche et hache avec du silex
|
||||
minetest.register_craft({
|
||||
output = "default:axe_stone",
|
||||
recipe = {
|
||||
{"default:flint", "default:flint", ""},
|
||||
{"default:flint", "default:stick", ""},
|
||||
{"", "default:stick", ""},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:pick_stone",
|
||||
recipe = {
|
||||
{"default:flint", "default:flint", "default:flint"},
|
||||
{"", "default:stick", ""},
|
||||
{"", "default:stick", ""},
|
||||
}
|
||||
})
|
0
custom/mods/nalc/nalc_lib/depends.txt
Normal file
0
custom/mods/nalc/nalc_lib/depends.txt
Normal file
28
custom/mods/nalc/nalc_lib/init.lua
Normal file
28
custom/mods/nalc/nalc_lib/init.lua
Normal 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
|
Reference in New Issue
Block a user