Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bitchange
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
bitchange
Commits
b49ba5dc
Commit
b49ba5dc
authored
8 years ago
by
SmallJoker
Browse files
Options
Downloads
Patches
Plain Diff
Shop: Allow server admins to open the owner formspec of shops
Clean up the position entry on leave Add wrench support
parent
498d97a8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
depends.txt
+1
-0
1 addition, 0 deletions
depends.txt
init.lua
+5
-1
5 additions, 1 deletion
init.lua
shop.lua
+19
-1
19 additions, 1 deletion
shop.lua
with
25 additions
and
2 deletions
depends.txt
+
1
−
0
View file @
b49ba5dc
default
moreores?
technic_worldgen?
wrench?
quartz?
pipeworks?
money?
...
...
This diff is collapsed.
Click to expand it.
init.lua
+
5
−
1
View file @
b49ba5dc
...
...
@@ -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."
)
This diff is collapsed.
Click to expand it.
shop.lua
+
19
−
1
View file @
b49ba5dc
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment