1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-13 05:50:31 +01:00

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.
This commit is contained in:
sys4-fr 2018-01-07 18:28:53 +01:00
parent b5e8b52218
commit e32c9b72b8
4 changed files with 87 additions and 42 deletions

View File

@ -22,3 +22,4 @@ dye?
cherry_tree?
nether?
mobs_animal?
minercantile?

View File

@ -21,7 +21,8 @@ local mods =
"beds", "boats", "bucket",
"nyancat", "moreores", "moreblocks",
"maptools", "doors", "flowers",
"carts", "nether", "mobs_animal"
"carts", "nether", "mobs_animal",
"minercantile"
}
for _,mod in ipairs(mods) do

View File

@ -136,16 +136,18 @@ minetest.override_item(
}
})
minetest.override_item(
"default:stone_with_tin",
{
drop = {
items = {
{items = {"default:tin_lump"}},
{items = {"maptools:copper_coin 3"}}
if minetest.registered_items["default:stone_with_tin"] then
minetest.override_item(
"default:stone_with_tin",
{
drop = {
items = {
{items = {"default:tin_lump"}},
{items = {"maptools:copper_coin 3"}}
}
}
}
})
})
end
minetest.override_item(
"nalc:desert_stone_with_tin",
{
@ -157,27 +159,6 @@ minetest.override_item(
}
})
minetest.override_item(
"moreores:mineral_silver",
{
drop = {
items = {
{items = {"moreores:silver_lump"}},
{items = {"maptools:copper_coin 3"}}
}
}
})
minetest.override_item(
"nalc:desert_stone_with_silver",
{
drop = {
items = {
{items = {"moreores:silver_lump"}},
{items = {"maptools:copper_coin 3"}}
}
}
})
minetest.override_item(
"default:stone_with_mese",
{
@ -200,17 +181,6 @@ minetest.override_item(
}
})
minetest.override_item(
"moreores:mineral_mithril",
{
drop = {
items = {
{items = {"moreores:mithril_lump"}},
{items = {"maptools:silver_coin 3"}},
}
}
})
minetest.override_item(
"default:stone_with_diamond",
{
@ -221,3 +191,37 @@ minetest.override_item(
}
}
})
if minetest.get_modpath("moreores") then
minetest.override_item(
"moreores:mineral_silver",
{
drop = {
items = {
{items = {"moreores:silver_lump"}},
{items = {"maptools:copper_coin 3"}}
}
}
})
minetest.override_item(
"moreores:mineral_mithril",
{
drop = {
items = {
{items = {"moreores:mithril_lump"}},
{items = {"maptools:silver_coin 3"}},
}
}
})
minetest.override_item(
"nalc:desert_stone_with_silver",
{
drop = {
items = {
{items = {"moreores:silver_lump"}},
{items = {"maptools:copper_coin 3"}}
}
}
})
end

View File

@ -0,0 +1,39 @@
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