Commit 470297ee authored by Milan's avatar Milan
Browse files

remove ownership from moneychanger

parent 2efeb2e0
......@@ -118,10 +118,10 @@ minetest.register_node("bitchange:moneychanger", {
return moneychanger.constructing(pos);
end,
after_place_node = function(pos, placer, itemstack)
local owner = placer:get_player_name()
--local owner = placer:get_player_name()
local meta = minetest.get_meta(pos)
meta:set_string("infotext", "Moneychanger (owned by "..owner..")")
meta:set_string("owner",owner)
--meta:set_string("infotext", "Moneychanger (owned by "..owner..")")
--meta:set_string("owner",owner)
local inv = meta:get_inventory()
inv:set_size("source", 1)
inv:set_size("rest", 1)
......@@ -132,9 +132,9 @@ minetest.register_node("bitchange:moneychanger", {
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return 0
end
--if not bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
-- return 0
--end
if listname == "source" then
local stack_name = stack:get_name()
local inv = meta:get_inventory()
......@@ -152,18 +152,18 @@ minetest.register_node("bitchange:moneychanger", {
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
--if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return moneychanger.update_fields(pos, listname, index, stack, true)
end
return 0
--end
--return 0
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
--if bitchange.has_access(meta:get_string("owner"), player:get_player_name()) then
return inv:is_empty("source") and inv:is_empty("output") and inv:is_empty("rest")
end
return 0
--end
--return 0
end
})
......@@ -174,4 +174,4 @@ minetest.register_craft({
{'default:steel_ingot', 'bitchange:minecoin', 'default:steel_ingot'},
{'default:stone', 'default:stone', 'default:stone'}
}
})
\ No newline at end of file
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment