added safe version of lava and flowing lava

This commit is contained in:
Sokomine 2015-07-31 18:03:38 +02:00
parent ccf79200a2
commit 00a96fa5a0
3 changed files with 47 additions and 0 deletions

View File

@ -49,6 +49,8 @@ end
-- currently not really used; does not look as good as expected
mg_villages.medieval_subtype = false;
-- set this to true if you want to use normal lava - but beware: charachoal villages may cause bushfires!
--mg_villages.use_normal_unsafe_lava = false;
-----------------------------------------------------------------------------
-- decrese these values slightly if you want MORE trees around your villages;

View File

@ -99,3 +99,41 @@ minetest.register_node("mg_villages:plotmarker", {
end
})
-- default to safe lava
if( not( mg_villages.use_normal_unsafe_lava )) then
local lava = minetest.registered_nodes[ "default:lava_source"];
if( lava ) then
-- a deep copy for the table would be more helpful...but, well, ...
local new_def = minetest.deserialize( minetest.serialize( lava ));
-- this lava does not cause fire to spread
new_def.name = nil;
new_def.groups.lava = nil;
new_def.groups.hot = nil;
new_def.groups.igniter = nil;
new_def.groups.lava_tamed = 3;
new_def.description = "Lava Source (tame)";
new_def.liquid_alternative_flowing = "mg_villages:lava_flowing_tamed";
new_def.liquid_alternative_source = "mg_villages:lava_source_tamed";
-- we create a NEW type of lava for this
minetest.register_node( "mg_villages:lava_source_tamed", new_def );
end
-- take care of the flowing variant as well
lava = minetest.registered_nodes[ "default:lava_flowing"];
if( lava ) then
-- a deep copy for the table would be more helpful...but, well, ...
local new_def = minetest.deserialize( minetest.serialize( lava ));
-- this lava does not cause fire to spread
new_def.name = nil;
new_def.groups.lava = nil;
new_def.groups.hot = nil;
new_def.groups.igniter = nil;
new_def.groups.lava_tamed = 3;
new_def.description = "Flowing Lava (tame)";
new_def.liquid_alternative_flowing = "mg_villages:lava_flowing_tamed";
new_def.liquid_alternative_source = "mg_villages:lava_source_tamed";
-- and a NEW type of flowing lava...
minetest.register_node( "mg_villages:lava_flowing_tamed", new_def );
end
end

View File

@ -943,6 +943,13 @@ mg_villages.get_replacement_table = function( housetype, pr, replacements )
end
-- it is very problematic if the torches on houses melt snow and cause flooding; thus, we use a torch that is not hot
table.insert( replacements, {'default:torch', 'mg_villages:torch'});
-- make charachoal villages safe from spreading fire
if( not( mg_villages.use_normal_unsafe_lava )) then
table.insert( replacements, {'default:lava_source', 'mg_villages:lava_source_tamed'});
table.insert( replacements, {'default:lava_flowing', 'mg_villages:lava_flowing_tamed'});
end
for i,v in ipairs( replacements ) do
if( v and #v == 2 ) then
rtable[ v[1] ] = v[2];