Skip to content

Commit

Permalink
removed obsolete mg_villages.get_fruit_replacements (now done in hand…
Browse files Browse the repository at this point in the history
…le_schematics with replacement groups)
  • Loading branch information
Sokomine committed Oct 1, 2020
1 parent de99360 commit f5df0ed
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions replacements.lua
Expand Up @@ -744,47 +744,3 @@ mg_villages.get_replacement_table = function( housetype, pr, replacements )
end
return { table = rtable, list = replacements};
end
-- they don't all grow cotton; farming_plus fruits are far more intresting!
-- Note: This function modifies replacements.ids and replacements.table for each building
-- as far as fruits are concerned. It needs to be called before placing a building
-- which contains fruits.
-- The function might as well be a local one.
mg_villages.get_fruit_replacements = function( replacements, fruit)
if( not( fruit )) then
return;
end
for i=1,8 do
local old_name = '';
local new_name = '';
-- farming_plus plants sometimes come in 3 or 4 variants, but not in 8 as cotton does
if( minetest.registered_nodes[ 'farming_plus:'..fruit..'_'..i ]) then
old_name = "farming:cotton_"..i;
new_name = 'farming_plus:'..fruit..'_'..i;
-- "surplus" cotton variants will be replaced with the full grown fruit
elseif( minetest.registered_nodes[ 'farming_plus:'..fruit ]) then
old_name = "farming:cotton_"..i;
new_name = 'farming_plus:'..fruit;
-- and plants from farming: are supported as well
elseif( minetest.registered_nodes[ 'farming:'..fruit..'_'..i ]) then
old_name = "farming:cotton_"..i;
new_name = 'farming:'..fruit..'_'..i;
elseif( minetest.registered_nodes[ 'farming:'..fruit ]) then
old_name = "farming:cotton_"..i;
new_name = 'farming:'..fruit;
end
if( old_name ~= '' and new_name ~= '' ) then
-- this is mostly used by the voxelmanip based spawning of .we files
replacements.ids[ minetest.get_content_id( old_name )] = minetest.get_content_id( new_name );
-- this is used by the place_schematic based spawning
replacements.table[ old_name ] = new_name;
end
end
end

0 comments on commit f5df0ed

Please sign in to comment.