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
a5ad3074
Commit
a5ad3074
authored
9 years ago
by
red-001
Committed by
paramat
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add an on_burn callback.
parent
45bc0b24
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
game_api.txt
+9
-1
9 additions, 1 deletion
game_api.txt
mods/fire/init.lua
+8
-2
8 additions, 2 deletions
mods/fire/init.lua
with
17 additions
and
3 deletions
game_api.txt
+
9
−
1
View file @
a5ad3074
...
...
@@ -176,6 +176,14 @@ The farming API allows you to easily register plants and hoes.
maxlight = default.LIGHT_MAX -- Maximum light to grow
}
Fire API
--------
`on_burn(pos)`
* Called when fire attempts to remove a burning node.
* `pos` Position of the burning node.
Screwdriver API
---------------
...
...
@@ -451,4 +459,4 @@ Trees
* Grows a new design aspen tree at pos
* `default.grow_new_snowy_pine_tree(pos)`
* Grows a new design snowy pine tree at pos
\ No newline at end of file
* Grows a new design snowy pine tree at pos
This diff is collapsed.
Click to expand it.
mods/fire/init.lua
+
8
−
2
View file @
a5ad3074
...
...
@@ -235,8 +235,14 @@ else
-- remove flammable nodes around flame
local
p
=
minetest
.
find_node_near
(
p0
,
1
,
{
"group:flammable"
})
if
p
then
minetest
.
remove_node
(
p
)
nodeupdate
(
p
)
local
node
=
minetest
.
get_node
(
p
)
local
def
=
minetest
.
registered_nodes
[
node
.
name
]
if
def
.
on_burn
then
def
.
on_burn
(
p
)
else
minetest
.
remove_node
(
p
)
nodeupdate
(
p
)
end
end
end
end
,
...
...
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