Skip to content

Commit

Permalink
Add option to disable lavacooling (#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezhh authored and SmallJoker committed May 7, 2017
1 parent 6737952 commit 0870631
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions minetest.conf.example
Expand Up @@ -27,6 +27,9 @@
# Enable flame sound.
#flame_sound = true

# Whether lavacooling should be enabled.
#enable_lavacooling = true

# Whether the stuff in initial_stuff should be given to new players
#give_initial_stuff = false
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,default:torch 99,default:cobble 99
Expand Down
25 changes: 13 additions & 12 deletions mods/default/functions.lua
Expand Up @@ -131,18 +131,19 @@ default.cool_lava = function(pos, node)
{pos = pos, max_hear_distance = 16, gain = 0.25})
end

minetest.register_abm({
label = "Lava cooling",
nodenames = {"default:lava_source", "default:lava_flowing"},
neighbors = {"group:cools_lava", "group:water"},
interval = 1,
chance = 2,
catch_up = false,
action = function(...)
default.cool_lava(...)
end,
})

if minetest.setting_getbool("enable_lavacooling") ~= false then
minetest.register_abm({
label = "Lava cooling",
nodenames = {"default:lava_source", "default:lava_flowing"},
neighbors = {"group:cools_lava", "group:water"},
interval = 1,
chance = 2,
catch_up = false,
action = function(...)
default.cool_lava(...)
end,
})
end

--
-- optimized helper to put all items in an inventory into a drops list
Expand Down
3 changes: 3 additions & 0 deletions settingtypes.txt
Expand Up @@ -16,6 +16,9 @@ enable_fire (Fire) bool true
# Enable flame sound.
flame_sound (Flame sound) bool true

# Enable lavacooling.
enable_lavacooling (Lavacooling) bool true

# If enabled, steel tools, torches and cobblestone will be given to new
# players.
give_initial_stuff (Give initial items) bool false
Expand Down

1 comment on commit 0870631

@HybridDog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a on_flood field for the nodedef, which can be used for proper lavacooling?

Please sign in to comment.