From 7fee79f8841f41842320d0eb84ac736b5ca726e3 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 5 Sep 2019 18:38:15 +0200 Subject: [PATCH] Village: Connect well properly with road network --- mods/village/generate.lua | 14 ++++++++++++-- mods/village/schematics/village_well.mts | Bin 375 -> 373 bytes 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mods/village/generate.lua b/mods/village/generate.lua index fdadf03..b329a1d 100644 --- a/mods/village/generate.lua +++ b/mods/village/generate.lua @@ -556,6 +556,8 @@ function village.spawn_village(pos, pr) return false end + local wellpos = table.copy(pos) + built[minetest.hash_node_position(pos)] = true -- Generate a road at the well. The road tries to grow in 4 directions @@ -581,10 +583,16 @@ function village.spawn_village(pos, pr) end end + -- Add position of well to roads list to connect it properly with + -- the road network. + local hnp = minetest.hash_node_position(wellpos) + roads[hnp] = { pos = wellpos, is_well = true } + -- Connect dirt paths with other village tiles. -- The dirt path schematic uses planks and cobble for each of the 4 cardinal -- directions and it will be replaced either with a dirt path or -- the ground. + for _,road in pairs(roads) do if road ~= false then @@ -595,7 +603,9 @@ function village.spawn_village(pos, pr) ["default:planks_birch"] = "default:dirt_with_grass" -- west } - village.spawn_chunk(road.pos, "0", replaces, pr, "road") + if not road.is_well then + village.spawn_chunk(road.pos, "0", replaces, pr, "road") + end local amt_connections = 0 @@ -634,7 +644,7 @@ function village.spawn_village(pos, pr) end - if amt_connections >= 2 then + if amt_connections >= 2 and not road.is_well then village.spawn_chunk( {x = road.pos.x, y = road.pos.y+1, z = road.pos.z}, "0", diff --git a/mods/village/schematics/village_well.mts b/mods/village/schematics/village_well.mts index 45a1767ab3b3a4b8b442d58a669dba5265371080..e8d33802b2e201b210ebac3dc17a2439dcbd2268 100644 GIT binary patch delta 179 zcmV;k08Ib)0`&q7O;l4&00aOG00#gJe~}C#1Os7da*-_?kxiC=l?w`hAP@z&{8g9k z${rz+B=durA#LqEk=i6CqYWU#@Umd?9D_Jdc3R1*@7>GuuxoeZ-rV9TK$?ialYz2z z6`4-nT&{DN_uMsgo)Q)l8SSU5x9+F&jISt@?|EW*?^wPg41EbppGV-i5(M!ZvVDn2 h!tHnz`(I_nWjc8h*o4lW^y1>P*CFg6Qfv=c{fxt$RBr$P delta 204 zcmV;-05kvf0`~$8O;l4&00aOG00saIkqsgq7-VH;VRdYDI%s8KbY)~;WNC7AUvOb` zXaECYX>yTGmw%KC3V#e{cXH GD7X>r=~%!3