forked from mtcontrib/locks
Change recipes when basic_materials mod is detected
This commit is contained in:
parent
4d3a7e51df
commit
f0e4b2012e
@ -1,2 +1,3 @@
|
|||||||
default
|
default
|
||||||
pipeworks?
|
pipeworks?
|
||||||
|
basic_materials?
|
||||||
|
31
init.lua
31
init.lua
@ -750,22 +750,25 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
return false;
|
return false;
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- craftitem; that can be used to craft shared locked objects
|
if minetest.get_modpath("basic_materials") then
|
||||||
minetest.register_craftitem("locks:lock", {
|
minetest.register_alias("locks:lock", "basic_materials:padlock")
|
||||||
description = "Lock to lock and share objects",
|
else
|
||||||
image = "locks_lock16.png",
|
-- craftitem; that can be used to craft shared locked objects
|
||||||
});
|
minetest.register_craftitem("locks:lock", {
|
||||||
|
description = "Lock to lock and share objects",
|
||||||
|
image = "locks_lock16.png",
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "locks:lock 2",
|
output = "locks:lock 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:steel_ingot', 'default:steel_ingot','default:steel_ingot'},
|
{'default:steel_ingot', 'default:steel_ingot','default:steel_ingot'},
|
||||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||||
{'', 'default:steel_ingot',''},
|
{'', 'default:steel_ingot',''},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
end
|
||||||
|
|
||||||
-- a key allowes to open your own shared locked objects
|
-- a key allowes to open your own shared locked objects
|
||||||
minetest.register_craftitem("locks:key", {
|
minetest.register_craftitem("locks:key", {
|
||||||
|
3
mod.conf
Normal file
3
mod.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
name = locks
|
||||||
|
depends=default
|
||||||
|
optional_depends = pipeworks,basic_materials
|
@ -38,7 +38,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
minetest.register_node("locks:shared_locked_chest", {
|
minetest.register_node("locks:shared_locked_chest", {
|
||||||
description = "Shared locked chest",
|
description = "Advanced shared locked chest",
|
||||||
tiles = locks.chest_add.tiles,
|
tiles = locks.chest_add.tiles,
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = locks.chest_add.groups,
|
groups = locks.chest_add.groups,
|
||||||
@ -140,7 +140,7 @@ minetest.register_node("locks:shared_locked_chest", {
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'locks:shared_locked_chest',
|
output = 'locks:shared_locked_chest',
|
||||||
recipe = {
|
recipe = {
|
||||||
{ 'default:chest', 'locks:lock', '' },
|
{ 'locks:lock', 'default:chest', minetest.get_modpath("basic_materials") and 'basic_materials:ic' or ''},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ minetest.register_abm({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'locks:shared_locked_furnace',
|
output = 'locks:shared_locked_furnace',
|
||||||
recipe = {
|
recipe = {
|
||||||
{ 'default:furnace', 'locks:lock', '' },
|
{ 'locks:lock', 'default:furnace', minetest.get_modpath("basic_materials") and 'basic_materials:ic' or ''},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
-- a sign
|
-- a sign
|
||||||
minetest.register_node("locks:shared_locked_sign_wall", {
|
minetest.register_node("locks:shared_locked_sign_wall", {
|
||||||
description = "Shared locked sign",
|
description = "Advanced shared locked sign",
|
||||||
drawtype = "signlike",
|
drawtype = "signlike",
|
||||||
tiles = {"locks_lock16.png^default_sign_wood.png"},
|
tiles = {"locks_lock16.png^default_sign_wood.png"},
|
||||||
inventory_image = "locks_lock16.png^default_sign_wood.png",
|
inventory_image = "locks_lock16.png^default_sign_wood.png",
|
||||||
@ -71,7 +71,7 @@ minetest.register_node("locks:shared_locked_sign_wall", {
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'locks:shared_locked_sign_wall',
|
output = 'locks:shared_locked_sign_wall',
|
||||||
recipe = {
|
recipe = {
|
||||||
{ 'default:sign_wall', 'locks:lock', '' },
|
{ 'locks:lock', 'default:sign_wall', minetest.get_modpath("basic_materials") and 'basic_materials:ic' or ''},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ local delta = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
minetest.register_node("locks:door", {
|
minetest.register_node("locks:door", {
|
||||||
description = "Shared locked Wooden Door",
|
description = "Advanced shared locked Wooden Door",
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
inventory_image = 'locks_xdoors2_door.png',
|
inventory_image = 'locks_xdoors2_door.png',
|
||||||
wield_image = 'locks_xdoors2_door.png',
|
wield_image = 'locks_xdoors2_door.png',
|
||||||
@ -180,12 +180,13 @@ minetest.register_node("locks:door", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local ing = minetest.get_modpath("basic_materials") and 'basic_materials:ic' or ''
|
||||||
-- if xdoors2 is installed
|
-- if xdoors2 is installed
|
||||||
if( minetest.get_modpath("xdoors2") ~= nil ) then
|
if( minetest.get_modpath("xdoors2") ~= nil ) then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'locks:door',
|
output = 'locks:door',
|
||||||
recipe = {
|
recipe = {
|
||||||
{ 'xdoors2:door', 'locks:lock', '' },
|
{ 'locks: lock', 'xdoors2:door', ing},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -195,7 +196,7 @@ elseif( minetest.get_modpath("doors") ~= nil ) then
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'locks:door',
|
output = 'locks:door',
|
||||||
recipe = {
|
recipe = {
|
||||||
{ 'doors:door_wood', 'locks:lock', '' },
|
{ 'locks:lock', 'doors:door_wood', ing},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -206,7 +207,7 @@ else
|
|||||||
recipe = {
|
recipe = {
|
||||||
{ 'default:wood', 'default:wood', '' },
|
{ 'default:wood', 'default:wood', '' },
|
||||||
{ 'default:wood', 'default:wood', 'locks:lock' },
|
{ 'default:wood', 'default:wood', 'locks:lock' },
|
||||||
{ 'default:wood', 'default:wood', '' },
|
{ 'default:wood', 'default:wood', ing },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user