Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xdecor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
xdecor
Commits
6c7a75ed
Commit
6c7a75ed
authored
7 years ago
by
JP Guerrero
Browse files
Options
Downloads
Patches
Plain Diff
Fix a few issues with itemframe #85
parent
3c46a5dd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/itemframe.lua
+11
-6
11 additions, 6 deletions
src/itemframe.lua
with
11 additions
and
6 deletions
src/itemframe.lua
+
11
−
6
View file @
6c7a75ed
...
...
@@ -69,9 +69,11 @@ end
function
itemframe
.
rightclick
(
pos
,
node
,
clicker
,
itemstack
)
local
meta
=
minetest
.
get_meta
(
pos
)
local
player
=
clicker
:
get_player_name
()
local
player
_name
=
clicker
:
get_player_name
()
local
owner
=
meta
:
get_string
(
"owner"
)
if
player
~=
owner
or
not
itemstack
then
local
admin
=
minetest
.
check_player_privs
(
player_name
,
"protection_bypass"
)
if
not
admin
and
(
player_name
~=
owner
or
not
itemstack
)
then
return
itemstack
end
...
...
@@ -85,19 +87,22 @@ end
function
itemframe
.
punch
(
pos
,
node
,
puncher
)
local
meta
=
minetest
.
get_meta
(
pos
)
local
player
=
puncher
:
get_player_name
()
local
player
_name
=
puncher
:
get_player_name
()
local
owner
=
meta
:
get_string
(
"owner"
)
local
admin
=
minetest
.
check_player_privs
(
player_name
,
"protection_bypass"
)
if
player
~=
owner
then
return
end
if
not
admin
and
player
_name
~=
owner
then
return
end
drop_item
(
pos
,
node
)
end
function
itemframe
.
dig
(
pos
,
player
)
if
not
player
then
return
end
local
meta
=
minetest
.
get_meta
(
pos
)
local
pname
=
player
and
player
:
get_player_name
()
local
p
layer_
name
=
player
and
player
:
get_player_name
()
local
owner
=
meta
:
get_string
(
"owner"
)
local
admin
=
minetest
.
check_player_privs
(
player_name
,
"protection_bypass"
)
return
p
name
==
owner
return
admin
or
player_
name
==
owner
end
xdecor
.
register
(
"itemframe"
,
{
...
...
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