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
|
||||
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;
|
||||
end)
|
||||
|
||||
-- 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",
|
||||
});
|
||||
if minetest.get_modpath("basic_materials") then
|
||||
minetest.register_alias("locks:lock", "basic_materials:padlock")
|
||||
else
|
||||
-- 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({
|
||||
output = "locks:lock 2",
|
||||
recipe = {
|
||||
{'default:steel_ingot', 'default:steel_ingot','default:steel_ingot'},
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
{'', 'default:steel_ingot',''},
|
||||
}
|
||||
});
|
||||
|
||||
minetest.register_craft({
|
||||
output = "locks:lock 2",
|
||||
recipe = {
|
||||
{'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
|
||||
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", {
|
||||
description = "Shared locked chest",
|
||||
description = "Advanced shared locked chest",
|
||||
tiles = locks.chest_add.tiles,
|
||||
paramtype2 = "facedir",
|
||||
groups = locks.chest_add.groups,
|
||||
@ -140,7 +140,7 @@ minetest.register_node("locks:shared_locked_chest", {
|
||||
minetest.register_craft({
|
||||
output = 'locks:shared_locked_chest',
|
||||
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({
|
||||
output = 'locks:shared_locked_furnace',
|
||||
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
|
||||
minetest.register_node("locks:shared_locked_sign_wall", {
|
||||
description = "Shared locked sign",
|
||||
description = "Advanced shared locked sign",
|
||||
drawtype = "signlike",
|
||||
tiles = {"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({
|
||||
output = 'locks:shared_locked_sign_wall',
|
||||
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", {
|
||||
description = "Shared locked Wooden Door",
|
||||
description = "Advanced shared locked Wooden Door",
|
||||
node_placement_prediction = "",
|
||||
inventory_image = 'locks_xdoors2_door.png',
|
||||
wield_image = 'locks_xdoors2_door.png',
|
||||
@ -180,12 +180,13 @@ minetest.register_node("locks:door", {
|
||||
end
|
||||
})
|
||||
|
||||
local ing = minetest.get_modpath("basic_materials") and 'basic_materials:ic' or ''
|
||||
-- if xdoors2 is installed
|
||||
if( minetest.get_modpath("xdoors2") ~= nil ) then
|
||||
minetest.register_craft({
|
||||
output = 'locks:door',
|
||||
recipe = {
|
||||
{ 'xdoors2:door', 'locks:lock', '' },
|
||||
{ 'locks: lock', 'xdoors2:door', ing},
|
||||
},
|
||||
})
|
||||
|
||||
@ -195,7 +196,7 @@ elseif( minetest.get_modpath("doors") ~= nil ) then
|
||||
minetest.register_craft({
|
||||
output = 'locks:door',
|
||||
recipe = {
|
||||
{ 'doors:door_wood', 'locks:lock', '' },
|
||||
{ 'locks:lock', 'doors:door_wood', ing},
|
||||
},
|
||||
})
|
||||
|
||||
@ -206,7 +207,7 @@ else
|
||||
recipe = {
|
||||
{ 'default:wood', 'default:wood', '' },
|
||||
{ 'default:wood', 'default:wood', 'locks:lock' },
|
||||
{ 'default:wood', 'default:wood', '' },
|
||||
{ 'default:wood', 'default:wood', ing },
|
||||
},
|
||||
})
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user