Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
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
minetest_game
Commits
172b62f8
Unverified
Commit
172b62f8
authored
3 years ago
by
An0n3m0us
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add trapdoor/door model specification (#2371)
parent
a5547a3a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game_api.txt
+5
-0
5 additions, 0 deletions
game_api.txt
mods/doors/init.lua
+16
-8
16 additions, 8 deletions
mods/doors/init.lua
with
21 additions
and
8 deletions
game_api.txt
+
5
−
0
View file @
172b62f8
...
...
@@ -218,6 +218,8 @@ The doors mod allows modders to register custom doors and trapdoors.
description = "Door description",
inventory_image = "mod_door_inv.png",
groups = {choppy = 2},
model = "mod_door", -- (optional)
-- Model name without a suffix ("big_door" not "big_door_a.obj", "big_door_b.obj")
tiles = {"mod_door.png"}, -- UV map.
-- The front and back of the door must be identical in appearence as they swap on
-- open/close.
...
...
@@ -236,6 +238,9 @@ The doors mod allows modders to register custom doors and trapdoors.
description = "Trapdoor description",
inventory_image = "mod_trapdoor_inv.png",
nodebox_closed = {} -- Nodebox for closed model
nodebox_opened = {} -- Nodebox for opened model
-- (optional) both nodeboxes must be used, not one only
groups = {choppy = 2},
tile_front = "doors_trapdoor.png", -- the texture for the front and back of the trapdoor
tile_side = "doors_trapdoor_side.png",
...
...
This diff is collapsed.
Click to expand it.
mods/doors/init.lua
+
16
−
8
View file @
172b62f8
...
...
@@ -670,10 +670,14 @@ function doors.register_trapdoor(name, def)
local
def_opened
=
table
.
copy
(
def
)
local
def_closed
=
table
.
copy
(
def
)
def_closed
.
node_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
5
,
-
0
.
5
,
-
0
.
5
,
0
.
5
,
-
6
/
16
,
0
.
5
}
}
if
def
.
nodebox_closed
and
def
.
nodebox_opened
then
def_closed
.
node_box
=
def
.
nodebox_closed
else
def_closed
.
node_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
5
,
-
0
.
5
,
-
0
.
5
,
0
.
5
,
-
6
/
16
,
0
.
5
}
}
end
def_closed
.
selection_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
5
,
-
0
.
5
,
-
0
.
5
,
0
.
5
,
-
6
/
16
,
0
.
5
}
...
...
@@ -687,10 +691,14 @@ function doors.register_trapdoor(name, def)
def
.
tile_side
}
def_opened
.
node_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
5
,
-
0
.
5
,
6
/
16
,
0
.
5
,
0
.
5
,
0
.
5
}
}
if
def
.
nodebox_opened
and
def
.
nodebox_closed
then
def_opened
.
node_box
=
def
.
nodebox_opened
else
def_opened
.
node_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
5
,
-
0
.
5
,
6
/
16
,
0
.
5
,
0
.
5
,
0
.
5
}
}
end
def_opened
.
selection_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
5
,
-
0
.
5
,
6
/
16
,
0
.
5
,
0
.
5
,
0
.
5
}
...
...
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