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
584718a2
Commit
584718a2
authored
10 years ago
by
BlockMen
Browse files
Options
Downloads
Patches
Plain Diff
Rename functions, update API
parent
46b6cee1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
game_api.txt
+2
-3
2 additions, 3 deletions
game_api.txt
mods/boats/init.lua
+5
-5
5 additions, 5 deletions
mods/boats/init.lua
mods/doors/init.lua
+5
-5
5 additions, 5 deletions
mods/doors/init.lua
with
12 additions
and
13 deletions
game_api.txt
+
2
−
3
View file @
584718a2
minetest_game API
======================
GitHub Repo: https://github.com/
BlockMen
/minetest_game
GitHub Repo: https://github.com/
minetest
/minetest_game
Introduction
------------
...
...
@@ -28,8 +28,7 @@ Doors API
---------
The doors mod allows modders to register custom doors.
doors:register_door(name, def)
^ Notice the ":" instaed of "."!
doors.register_door(name, def)
^ name: "Door name"
^ def: See [#Door definition]
...
...
This diff is collapsed.
Click to expand it.
mods/boats/init.lua
+
5
−
5
View file @
584718a2
...
...
@@ -42,7 +42,7 @@ local boat = {
last_v
=
0
,
}
function
boat
:
on_rightclick
(
clicker
)
function
boat
.
on_rightclick
(
self
,
clicker
)
if
not
clicker
or
not
clicker
:
is_player
()
then
return
end
...
...
@@ -63,7 +63,7 @@ function boat:on_rightclick(clicker)
end
end
function
boat
:
on_activate
(
staticdata
,
dtime_s
)
function
boat
.
on_activate
(
self
,
staticdata
,
dtime_s
)
self
.
object
:
set_armor_groups
({
immortal
=
1
})
if
staticdata
then
self
.
v
=
tonumber
(
staticdata
)
...
...
@@ -71,11 +71,11 @@ function boat:on_activate(staticdata, dtime_s)
self
.
last_v
=
self
.
v
end
function
boat
:
get_staticdata
()
function
boat
.
get_staticdata
()
return
tostring
(
v
)
end
function
boat
:
on_punch
(
puncher
,
time_from_last_punch
,
tool_capabilities
,
direction
)
function
boat
.
on_punch
(
self
,
puncher
,
time_from_last_punch
,
tool_capabilities
,
direction
)
puncher
:
set_detach
()
self
.
object
:
remove
()
if
puncher
and
puncher
:
is_player
()
and
not
minetest
.
setting_getbool
(
"creative_mode"
)
then
...
...
@@ -83,7 +83,7 @@ function boat:on_punch(puncher, time_from_last_punch, tool_capabilities, directi
end
end
function
boat
:
on_step
(
dtime
)
function
boat
.
on_step
(
self
,
dtime
)
self
.
v
=
get_v
(
self
.
object
:
getvelocity
())
*
get_sign
(
self
.
v
)
if
self
.
driver
then
local
ctrl
=
self
.
driver
:
get_player_control
()
...
...
This diff is collapsed.
Click to expand it.
mods/doors/init.lua
+
5
−
5
View file @
584718a2
...
...
@@ -28,7 +28,7 @@ local function is_right(pos)
end
end
function
doors
:
register_door
(
name
,
def
)
function
doors
.
register_door
(
name
,
def
)
def
.
groups
.
not_in_creative_inventory
=
1
local
box
=
{{
-
0
.
5
,
-
0
.
5
,
-
0
.
5
,
0
.
5
,
0
.
5
,
-
0
.
5
+
1
.
5
/
16
}}
...
...
@@ -291,7 +291,7 @@ function doors:register_door(name, def)
end
doors
:
register_door
(
"doors:door_wood"
,
{
doors
.
register_door
(
"doors:door_wood"
,
{
description
=
"Wooden Door"
,
inventory_image
=
"door_wood.png"
,
groups
=
{
snappy
=
1
,
choppy
=
2
,
oddly_breakable_by_hand
=
2
,
flammable
=
2
,
door
=
1
},
...
...
@@ -310,7 +310,7 @@ minetest.register_craft({
}
})
doors
:
register_door
(
"doors:door_steel"
,
{
doors
.
register_door
(
"doors:door_steel"
,
{
description
=
"Steel Door"
,
inventory_image
=
"door_steel.png"
,
groups
=
{
snappy
=
1
,
bendy
=
2
,
cracky
=
1
,
melty
=
2
,
level
=
2
,
door
=
1
},
...
...
@@ -330,7 +330,7 @@ minetest.register_craft({
}
})
doors
:
register_door
(
"doors:door_glass"
,
{
doors
.
register_door
(
"doors:door_glass"
,
{
description
=
"Glass Door"
,
inventory_image
=
"door_glass.png"
,
groups
=
{
snappy
=
1
,
cracky
=
1
,
oddly_breakable_by_hand
=
3
,
door
=
1
},
...
...
@@ -349,7 +349,7 @@ minetest.register_craft({
}
})
doors
:
register_door
(
"doors:door_obsidian_glass"
,
{
doors
.
register_door
(
"doors:door_obsidian_glass"
,
{
description
=
"Obsidian Glass Door"
,
inventory_image
=
"door_obsidian_glass.png"
,
groups
=
{
snappy
=
1
,
cracky
=
1
,
oddly_breakable_by_hand
=
3
,
door
=
1
},
...
...
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