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
9b95401a
Commit
9b95401a
authored
9 years ago
by
kilbith
Browse files
Options
Downloads
Patches
Plain Diff
Minor style cleaning in handlers
parent
d3bdb95c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
handlers/nodeboxes.lua
+18
-6
18 additions, 6 deletions
handlers/nodeboxes.lua
handlers/registration.lua
+1
-1
1 addition, 1 deletion
handlers/registration.lua
with
19 additions
and
7 deletions
handlers/nodeboxes.lua
+
18
−
6
View file @
9b95401a
xdecor
.
box
=
{
slab_y
=
function
(
height
,
shift
)
return
{
-
0
.
5
,
-
0
.
5
+
(
shift
or
0
),
-
0
.
5
,
0
.
5
,
-
0
.
5
+
height
+
(
shift
or
0
),
0
.
5
}
end
,
slab_z
=
function
(
depth
)
return
{
-
0
.
5
,
-
0
.
5
,
-
0
.
5
+
depth
,
0
.
5
,
0
.
5
,
0
.
5
}
end
,
bar_y
=
function
(
radius
)
return
{
-
radius
,
-
0
.
5
,
-
radius
,
radius
,
0
.
5
,
radius
}
end
,
cuboid
=
function
(
radius_x
,
radius_y
,
radius_z
)
return
{
-
radius_x
,
-
radius_y
,
-
radius_z
,
radius_x
,
radius_y
,
radius_z
}
end
slab_y
=
function
(
height
,
shift
)
return
{
-
0
.
5
,
-
0
.
5
+
(
shift
or
0
),
-
0
.
5
,
0
.
5
,
-
0
.
5
+
height
+
(
shift
or
0
),
0
.
5
}
end
,
slab_z
=
function
(
depth
)
return
{
-
0
.
5
,
-
0
.
5
,
-
0
.
5
+
depth
,
0
.
5
,
0
.
5
,
0
.
5
}
end
,
bar_y
=
function
(
radius
)
return
{
-
radius
,
-
0
.
5
,
-
radius
,
radius
,
0
.
5
,
radius
}
end
,
cuboid
=
function
(
radius_x
,
radius_y
,
radius_z
)
return
{
-
radius_x
,
-
radius_y
,
-
radius_z
,
radius_x
,
radius_y
,
radius_z
}
end
}
xdecor
.
nodebox
=
{
...
...
@@ -14,6 +22,7 @@ local mt = {}
mt
.
__index
=
function
(
table
,
key
)
local
ref
=
xdecor
.
box
[
key
]
local
ref_type
=
type
(
ref
)
if
ref_type
==
"function"
then
return
function
(
...
)
return
{
type
=
"fixed"
,
fixed
=
ref
(
...
)
}
...
...
@@ -21,8 +30,11 @@ mt.__index = function(table, key)
elseif
ref_type
==
"table"
then
return
{
type
=
"fixed"
,
fixed
=
ref
}
elseif
ref_type
==
"nil"
then
error
(
key
..
"could not be found among nodebox presets and functions"
)
error
(
key
..
"could not be found among nodebox presets and functions"
)
end
error
(
"unexpected datatype "
..
tostring
(
type
(
ref
))
..
" while looking for "
..
key
)
error
(
"unexpected datatype "
..
tostring
(
type
(
ref
))
..
" while looking for "
..
key
)
end
setmetatable
(
xdecor
.
nodebox
,
mt
)
This diff is collapsed.
Click to expand it.
handlers/registration.lua
+
1
−
1
View file @
9b95401a
...
...
@@ -44,7 +44,7 @@ local function get_formspec_by_size(size)
return
formspec
or
default_inventory_formspecs
end
local
function
drop_stuff
()
-- thanks to LNJplus for this function
local
function
drop_stuff
()
return
function
(
pos
,
oldnode
,
oldmetadata
,
digger
)
local
meta
=
minetest
.
get_meta
(
pos
)
meta
:
from_table
(
oldmetadata
)
...
...
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