Fix issue #188 (make lava optionally placeable above sea level)

This commit is contained in:
Joachim Stolberg 2025-01-03 17:01:36 +01:00
parent 5425e10e91
commit 7700d43f88
3 changed files with 15 additions and 8 deletions

View File

@ -57,6 +57,7 @@ techage.modified_recipes_enabled = minetest.settings:get_bool("techage_modified_
techage.collider_min_depth = tonumber(minetest.settings:get("techage_collider_min_depth")) or -28
techage.recipe_checker_enabled = minetest.settings:get_bool("techage_recipe_checker_enabled") ~= false
techage.stair_aliases_enabled = minetest.settings:get_bool("techage_stair_aliases_enabled") ~= false
techage.disable_lava_above_sea_level = minetest.settings:get_bool("techage_disable_lava_above_sea_level") ~= false
-- allow to load marshal and sqlite3
techage.IE = minetest.request_insecure_environment()

View File

@ -3,7 +3,7 @@
TechAge
=======
Copyright (C) 2019 Joachim Stolberg
Copyright (C) 2019-2025 Joachim Stolberg
AGPL v3
See LICENSE.txt for more information
@ -118,13 +118,16 @@ local function register_liquid(source, flowing, itemname, inventory_image, name,
end
-------------------------------- Start Modification
-- minetest.set_node(lpos, {name = source})
if source == "default:lava_source" and lpos.y > 0 and not minetest.is_singleplayer() then
minetest.chat_send_player(user:get_player_name(), S("[Bucket] Lava can only be placed below sea level!"))
return
if techage.disable_lava_above_sea_level then
if source == "default:lava_source" and lpos.y > 0 and not minetest.is_singleplayer() then
minetest.chat_send_player(user:get_player_name(), S("[Bucket] Lava can only be placed below sea level!"))
return
else
-- see "basis/lib.lua" techage.is_ocean(pos)
minetest.set_node(lpos, {name = source, param2 = 1})
end
else
-- see "basis/lib.lua" techage.is_ocean(pos)
minetest.set_node(lpos, {name = source, param2 = 1})
minetest.set_node(lpos, {name = source, param2 = 1})
end
-------------------------------- End Modification
return ItemStack("bucket:bucket_empty")

View File

@ -40,4 +40,7 @@ techage_expoint_rate_in_min (average waiting time for one expoint) int 40
techage_recipe_checker_enabled (test techage recipes) bool false
# Enables stair aliases (to prevent unknown nodes)
techage_stair_aliases_enabled (Enable stair aliases) bool false
techage_stair_aliases_enabled (Enable stair aliases) bool false
# Disable lava above sea level (to prevent griefing)
techage_disable_lava_above_sea_level (Disable lava above sea level) bool true