mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-09-12 00:56:53 +02:00
Fix villages generating with incorrect water
This commit fixes an issue where villages would generate with water which wasn't of the correct biome. The new function simply looks for water source nodes around the entire village and replaces any it finds with the same node, except with blank params so that the `on_construct` of the newly placed water source node gets called.
This commit is contained in:
parent
ecfbb1ae07
commit
693d40b6c4
@ -224,6 +224,14 @@ local function spawn_villagers(minp,maxp)
|
||||
end
|
||||
end
|
||||
|
||||
local function fix_village_water(minp,maxp)
|
||||
local palettenodes = minetest.find_nodes_in_area(vector.offset(minp,-20,-20,-20),vector.offset(maxp,20,20,20), "group:water_palette")
|
||||
for _, palettenodepos in pairs(palettenodes) do
|
||||
local palettenode = minetest.get_node(palettenodepos)
|
||||
minetest.set_node(palettenodepos, {name = palettenode.name})
|
||||
end
|
||||
end
|
||||
|
||||
local function init_nodes(p1, p2, size, rotation, pr)
|
||||
construct_node(p1, p2, "mcl_itemframes:item_frame")
|
||||
construct_node(p1, p2, "mcl_furnaces:furnace")
|
||||
@ -327,6 +335,7 @@ function settlements.place_schematics(settlement_info, pr)
|
||||
else
|
||||
init_nodes(p1, p2, size, rotation, pr)
|
||||
spawn_villagers(p1,p2)
|
||||
fix_village_water(p1,p2)
|
||||
end
|
||||
end,
|
||||
pr
|
||||
|
Loading…
Reference in New Issue
Block a user