1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-03-31 09:40:43 +02:00
server-nalc/mods/nalc/minercantile.lua
sys4-fr e32c9b72b8 Minercantile items are now craftable
Barter shop and bancomatic are craftable by anyone but to administrate the barter shop the player must have the shop privilege. (and ask to get it)
Anyway a non priviligied user can use his barter shop, but it will be limited to sell/bye objects from the General group that is administrated by players with the shop privilege.
2018-01-07 18:28:53 +01:00

40 lines
1.1 KiB
Lua

if minetest.get_modpath("minercantile") then
-- Register crafts for minercantile items
-- Barter shop
minetest.register_craft(
{ output = "minercantile:shop",
recipe = {
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
{"default:skeleton_key","maptools:silver_coin","default:steel_ingot"},
{"default:steel_ingot","default:mese_crystal","default:steel_ingot"}
}
})
-- Bancomatic
minetest.register_craft(
{ output = "minercantile:bancomatic_bottom",
recipe = {
{"default:steel_ingot","default:mese_crystal","default:steel_ingot"},
{"maptools:copper_coin","maptools:silver_coin","maptools:gold_coin"},
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"}
}
})
-- Fix bancomatic duplication item bug
local on_place = minetest.registered_items["minercantile:bancomatic_bottom"].on_place
minetest.override_item(
"minercantile:bancomatic_bottom",
{
on_place = function(itemstack, placer, pointed_thing)
if not on_place(itemstack, placer, pointed_thing) then
itemstack:take_item()
return itemstack
end
end
})
end