diff --git a/mapgen.lua b/mapgen.lua index 97fed21..29c32fc 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -48,20 +48,20 @@ end -- if you change any of the 3 constants below, also change them in the function -- mg_villages.village_area_mark_inside_village_area mg_villages.inside_village = function(x, z, village, vnoise) - return mg_villages.get_vn(x, z, vnoise:get2d({x = x, y = z}), village) <= 40 + return mg_villages.get_vn(x, z, vnoise:get_2d({x = x, y = z}), village) <= 40 end mg_villages.inside_village_area = function(x, z, village, vnoise) - return mg_villages.get_vn(x, z, vnoise:get2d({x = x, y = z}), village) <= 80 + return mg_villages.get_vn(x, z, vnoise:get_2d({x = x, y = z}), village) <= 80 end mg_villages.inside_village_terrain_blend_area = function(x, z, village, vnoise) - return mg_villages.get_vn(x, z, vnoise:get2d({x = x, y = z}), village) <= 160 + return mg_villages.get_vn(x, z, vnoise:get_2d({x = x, y = z}), village) <= 160 end mg_villages.get_vnoise = function(x, z, village, vnoise) -- PM v - return mg_villages.get_vn(x, z, vnoise:get2d({x = x, y = z}), village) + return mg_villages.get_vn(x, z, vnoise:get_2d({x = x, y = z}), village) end -- PM ^ mg_villages.get_vn = function(x, z, noise, village) @@ -593,7 +593,7 @@ mg_villages.village_area_mark_inside_village_area = function( village_area, vill if( not( village_area[ x ][ z ] )) then village_area[ x ][ z ] = { 0, 0 }; - local n_rawnoise = village_noise:get2d({x = x, y = z}) -- create new blended terrain + local n_rawnoise = village_noise:get_2d({x = x, y = z}) -- create new blended terrain for village_nr, village in ipairs(villages) do local vn = mg_villages.get_vn(x, z, n_rawnoise, village); if( village.is_single_house ) then diff --git a/nodes.lua b/nodes.lua index b63ba01..61d28ce 100644 --- a/nodes.lua +++ b/nodes.lua @@ -21,7 +21,7 @@ minetest.register_node("mg_villages:road", { mg_villages.road_node = minetest.get_content_id( 'mg_villages:road' ); -- do not drop snow on roads -if( moresnow ) then +if( minetest.get_modpath("moresnow")) then moresnow.snow_cover[ mg_villages.road_node ] = moresnow.c_air; end diff --git a/spawn_player.lua b/spawn_player.lua index ecba312..af502cb 100644 --- a/spawn_player.lua +++ b/spawn_player.lua @@ -33,7 +33,7 @@ mg_villages.spawnplayer = function(player) end end end - player:setpos(min_pos) + player:set_pos(min_pos) end minetest.register_on_newplayer(function(player) diff --git a/villages.lua b/villages.lua index f0370ce..11a49a5 100644 --- a/villages.lua +++ b/villages.lua @@ -24,7 +24,7 @@ mg_villages.villages_at_point = function(minp, noise1) local s = pi:next(1, 400) local x = pi:next(mp.x, mp.x + 79) local z = pi:next(mp.z, mp.z + 79) - if s <= mg_villages.VILLAGE_CHANCE and noise1:get2d({x = x, y = z}) >= -0.3 then return {} end + if s <= mg_villages.VILLAGE_CHANCE and noise1:get_2d({x = x, y = z}) >= -0.3 then return {} end end end end @@ -32,7 +32,7 @@ mg_villages.villages_at_point = function(minp, noise1) if pr:next(1, 400) > mg_villages.VILLAGE_CHANCE then return {} end -- No village here local x = pr:next(minp.x, minp.x + 79) local z = pr:next(minp.z, minp.z + 79) - if noise1:get2d({x = x, y = z}) < -0.3 then return {} end -- Deep in the ocean + if noise1:get_2d({x = x, y = z}) < -0.3 then return {} end -- Deep in the ocean -- fallback: type "nore" (that is what the mod originally came with) local village_type = 'nore'; @@ -604,7 +604,7 @@ end local function generate_walls(bpos, data, a, minp, maxp, vh, vx, vz, vs, vnoise) for x = minp.x, maxp.x do for z = minp.z, maxp.z do - local xx = (vnoise:get2d({x=x, y=z})-2)*20+(40/(vs*vs))*((x-vx)*(x-vx)+(z-vz)*(z-vz)) + local xx = (vnoise:get_2d({x=x, y=z})-2)*20+(40/(vs*vs))*((x-vx)*(x-vx)+(z-vz)*(z-vz)) if xx>=40 and xx <= 44 then bpos[#bpos+1] = {x=x, z=z, y=vh, btype="wall", bsizex=1, bsizez=1, brotate=0} end