From f08da9d8c3dcb9de238ac1fce2f9bff1a663a318 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Mon, 24 Jul 2017 21:21:26 +0200 Subject: [PATCH] better automatic exclusion of non-groundlike nodes depending on drawtype, plant group etc --- mapgen.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mapgen.lua b/mapgen.lua index 61f0e3a..1c7c1f8 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -118,6 +118,7 @@ mg_villages.check_if_ground = function( ci ) replacements_group.node_is_ground[ minetest.get_content_id( name )] = false; end end + replacements_group.node_is_ground[ minetest.get_content_id( 'air' )] = false; local ground_nodes = {'ethereal:dry_dirt', 'default:dirt_with_dry_grass','default:stone','default:sandstone','default:desertstone', 'ethereal:grey_dirt', 'default:dirt_with_snow', 'default:dirt_with_grass', 'ethereal:grove_dirt', 'ethereal:green_dirt', 'ethereal:grove_dirt','ethereal:jungle_dirt'}; @@ -145,6 +146,15 @@ mg_villages.check_if_ground = function( ci ) replacements_group.node_is_ground[ ci ] = false; elseif( def.groups and def.groups.tree ) then replacements_group.node_is_ground[ ci ] = false; + elseif( def.groups and (def.groups.plant or def.groups.growing)) then + replacements_group.node_is_ground[ ci ] = false; + elseif( def.drawtype and (def.drawtype=="flowingliquid" or def.drawtype=="torchlike" + or def.drawtype=="signlike" or def.drawtype=="airlike" or def.drawtype=="liquid" + or def.drawtype=="plantlike" or def.drawtype=="firelike" or def.drawtype=="fencelike" + or def.drawtype=="raillike" or def.drawtype=="nodebox" or def.drawtype=="mesh" + or def.drawtype=="plantlike_rooted")) then + replacements_group.node_is_ground[ ci ] = false; + elseif( def.drop and def.drop == 'default:dirt') then replacements_group.node_is_ground[ ci ] = true; elseif( def.walkable == true and def.is_ground_content == true and not(def.node_box)) then