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
52487850
Commit
52487850
authored
8 years ago
by
Rui
Committed by
Auke Kok
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Mailbox: Fix animation texture error (#53)
Fixes #51
parent
e9f6e606
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
mailbox.lua
+18
-4
18 additions, 4 deletions
mailbox.lua
with
18 additions
and
4 deletions
mailbox.lua
+
18
−
4
View file @
52487850
local
mailbox
=
{}
screwdriver
=
screwdriver
or
{}
local
function
get_img
(
img
)
local
img_name
=
img
:
match
(
"(.*)%.png"
)
if
img_name
then
return
img_name
..
".png"
end
end
local
function
img_col
(
stack
)
local
def
=
minetest
.
registered_items
[
stack
]
if
not
def
then
return
""
end
if
def
.
inventory_image
~=
""
then
return
def
.
inventory_image
:
match
(
"(.*)%.png"
)
..
".png"
local
img
=
get_img
(
def
.
inventory_image
)
if
img
then
return
img
end
end
if
def
.
tiles
and
def
.
tiles
[
1
]
then
return
def
.
tiles
[
1
]:
match
(
"(.*)%.png"
)
..
".png"
if
def
.
tiles
then
local
img
local
tile
=
def
.
tiles
[
1
]
if
type
(
tile
)
==
"table"
then
img
=
get_img
(
tile
.
name
)
elseif
type
(
tile
)
==
"string"
then
img
=
get_img
(
tile
)
end
if
img
then
return
img
end
end
return
""
...
...
@@ -136,4 +151,3 @@ xdecor.register("mailbox", {
allow_metadata_inventory_put
=
mailbox
.
put
,
after_place_node
=
mailbox
.
after_place_node
})
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