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
6f6d46dd
Commit
6f6d46dd
authored
9 years ago
by
paramat
Browse files
Options
Downloads
Patches
Plain Diff
Fire: Add 'permanent flame' node
Update 'disable fire' documentation in conf.example
parent
7c0abe93
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
minetest.conf.example
+2
-1
2 additions, 1 deletion
minetest.conf.example
mods/fire/init.lua
+65
-29
65 additions, 29 deletions
mods/fire/init.lua
with
67 additions
and
30 deletions
minetest.conf.example
+
2
−
1
View file @
6f6d46dd
...
...
@@ -9,7 +9,8 @@
# 0 to disable
#share_bones_time = 1200
# Whether fire should be disabled (all fire nodes will instantly disappear)
# Whether standard fire should be disabled ('basic flame' nodes will disappear)
# 'permanent flame' nodes will remain with either setting
#disable_fire = false
# Whether steel tools, torches and cobblestone should be given to new players
...
...
This diff is collapsed.
Click to expand it.
mods/fire/init.lua
+
65
−
29
View file @
6f6d46dd
...
...
@@ -5,25 +5,31 @@
fire
=
{}
-- Register flame node
-- Register flame node
s
minetest
.
register_node
(
"fire:basic_flame"
,
{
description
=
"
Fir
e"
,
description
=
"
Basic Flam
e"
,
drawtype
=
"firelike"
,
tiles
=
{{
name
=
"fire_basic_flame_animated.png"
,
animation
=
{
type
=
"vertical_frames"
,
aspect_w
=
16
,
aspect_h
=
16
,
length
=
1
},
}},
tiles
=
{
{
name
=
"fire_basic_flame_animated.png"
,
animation
=
{
type
=
"vertical_frames"
,
aspect_w
=
16
,
aspect_h
=
16
,
length
=
1
},
},
},
inventory_image
=
"fire_basic_flame.png"
,
paramtype
=
"light"
,
light_source
=
14
,
groups
=
{
igniter
=
2
,
dig_immediate
=
3
},
drop
=
''
,
walkable
=
false
,
buildable_to
=
true
,
sunlight_propagates
=
true
,
damage_per_second
=
4
,
groups
=
{
igniter
=
2
,
dig_immediate
=
3
},
drop
=
""
,
on_construct
=
function
(
pos
)
minetest
.
after
(
0
,
fire
.
on_flame_add_at
,
pos
)
...
...
@@ -33,7 +39,36 @@ minetest.register_node("fire:basic_flame", {
minetest
.
after
(
0
,
fire
.
on_flame_remove_at
,
pos
)
end
,
on_blast
=
function
()
end
,
-- unaffected by explosions
on_blast
=
function
()
end
,
-- unaffected by explosions
})
minetest
.
register_node
(
"fire:permanent_flame"
,
{
description
=
"Permanent Flame"
,
drawtype
=
"firelike"
,
tiles
=
{
{
name
=
"fire_basic_flame_animated.png"
,
animation
=
{
type
=
"vertical_frames"
,
aspect_w
=
16
,
aspect_h
=
16
,
length
=
1
},
},
},
inventory_image
=
"fire_basic_flame.png"
,
paramtype
=
"light"
,
light_source
=
14
,
walkable
=
false
,
buildable_to
=
true
,
sunlight_propagates
=
true
,
damage_per_second
=
4
,
groups
=
{
igniter
=
2
,
dig_immediate
=
3
},
drop
=
""
,
on_blast
=
function
()
end
,
})
...
...
@@ -129,38 +164,39 @@ function fire.flame_should_extinguish(pos)
end
-- E
nable ABMs according to 'disable fire' setting
-- E
xtinguish all flames quickly with water, snow, ice
if
minetest
.
setting_getbool
(
"disable_fire"
)
then
minetest
.
register_abm
({
nodenames
=
{
"fire:basic_flame"
,
"fire:permanent_flame"
},
neighbors
=
{
"group:puts_out_fire"
},
interval
=
3
,
chance
=
2
,
action
=
function
(
p0
,
node
,
_
,
_
)
minetest
.
remove_node
(
p0
)
minetest
.
sound_play
(
"fire_extinguish_flame"
,
{
pos
=
p0
,
max_hear_distance
=
16
,
gain
=
0
.
25
})
end
,
})
-- Extinguish flames quickly with dedicated ABM
minetest
.
register_abm
({
nodenames
=
{
"fire:basic_flame"
},
interval
=
3
,
chance
=
2
,
action
=
function
(
p0
,
node
,
_
,
_
)
minetest
.
remove_node
(
p0
)
end
,
})
-- Enable the following ABMs according to 'disable fire' setting
else
if
minetest
.
setting_getbool
(
"disable_fire"
)
then
--
Extinguish flames quickly with water, snow, ice
--
Remove basic flames only
minetest
.
register_abm
({
nodenames
=
{
"fire:basic_flame"
},
neighbors
=
{
"group:puts_out_fire"
},
interval
=
3
,
interval
=
7
,
chance
=
2
,
action
=
function
(
p0
,
node
,
_
,
_
)
minetest
.
remove_node
(
p0
)
minetest
.
sound_play
(
"fire_extinguish_flame"
,
{
pos
=
p0
,
max_hear_distance
=
16
,
gain
=
0
.
25
})
end
,
})
-- Ignite neighboring nodes
else
-- Ignite neighboring nodes, add basic flames
minetest
.
register_abm
({
nodenames
=
{
"group:flammable"
},
...
...
@@ -179,7 +215,7 @@ else
end
,
})
-- Remove flames and flammable nodes
-- Remove
basic
flames and flammable nodes
minetest
.
register_abm
({
nodenames
=
{
"fire:basic_flame"
},
...
...
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