Commit b49ba5dc authored by SmallJoker's avatar SmallJoker

Shop: Allow server admins to open the owner formspec of shops

Clean up the position entry on leave
Add wrench support
parent 498d97a8
default
moreores?
technic_worldgen?
wrench?
quartz?
pipeworks?
money?
......
......@@ -68,7 +68,11 @@ end
-- Privs
minetest.register_privilege("bitchange", "Can access to owned nodes of the bitchange mod")
function bitchange.has_access(owner, player_name)
return (player_name == owner or owner == "" or minetest.get_player_privs(player_name).server or minetest.get_player_privs(player_name).bitchange)
if player_name == owner or owner == "" then
return true
end
local privs = minetest.get_player_privs(player_name)
return privs.server or privs.bitchange
end
print("[BitChange] Loaded.")
......@@ -303,7 +303,7 @@ minetest.register_node("bitchange:shop", {
local player_name = clicker:get_player_name()
local view = 0
exchange_shop[player_name] = pos
if player_name == meta:get_string("owner") then
if bitchange.has_access(meta:get_string("owner"), player_name) then
if clicker:get_player_control().aux1 then
view = 1
else
......@@ -355,3 +355,21 @@ minetest.register_craft({
{"default:chest_locked"},
}
})
minetest.register_on_dieplayer(function(player)
local player_name = player:get_player_name()
exchange_shop[player_name] = nil
end)
if minetest.get_modpath("wrench") and wrench then
local STRING = wrench.META_TYPE_STRING
wrench:register_node("bitchange:shop", {
lists = {"stock", "custm", "custm_ej", "cust_ow", "cust_og", "cust_ej"},
metas = {
owner = STRING,
infotext = STRING,
title = STRING,
},
owned = true
})
end
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