From ab433775777c4f5055bcf4d2a1cffc506c4f9961 Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 25 May 2013 00:51:02 +0200 Subject: Move scriptapi to separate folder (by sapier) On the lua side, notably minetest.env:() should now be replaced by minetest.(). The old way is and will stay supported for a long time. Also: Update and clean up lua_api.txt (by celeron55) Move EnvRef to lua and remove add_rat and add_firefly (by kahrl) Add separate src/util/CMakeLists.txt, other minor fixes (by kahrl) --- games/minimal/mods/default/mapgen.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'games/minimal/mods/default/mapgen.lua') diff --git a/games/minimal/mods/default/mapgen.lua b/games/minimal/mods/default/mapgen.lua index 478567d0a..7209cb6b3 100644 --- a/games/minimal/mods/default/mapgen.lua +++ b/games/minimal/mods/default/mapgen.lua @@ -104,17 +104,17 @@ minetest.register_on_generated(function(minp, maxp, seed) for divz=0+1,divs-1-1 do local cx = minp.x + math.floor((divx+0.5)*divlen) local cz = minp.z + math.floor((divz+0.5)*divlen) - if minetest.env:get_node({x=cx,y=1,z=cz}).name == "default:water_source" and - minetest.env:get_node({x=cx,y=0,z=cz}).name == "default:sand" then + if minetest.get_node({x=cx,y=1,z=cz}).name == "default:water_source" and + minetest.get_node({x=cx,y=0,z=cz}).name == "default:sand" then local is_shallow = true local num_water_around = 0 - if minetest.env:get_node({x=cx-divlen*2,y=1,z=cz+0}).name == "default:water_source" then + if minetest.get_node({x=cx-divlen*2,y=1,z=cz+0}).name == "default:water_source" then num_water_around = num_water_around + 1 end - if minetest.env:get_node({x=cx+divlen*2,y=1,z=cz+0}).name == "default:water_source" then + if minetest.get_node({x=cx+divlen*2,y=1,z=cz+0}).name == "default:water_source" then num_water_around = num_water_around + 1 end - if minetest.env:get_node({x=cx+0,y=1,z=cz-divlen*2}).name == "default:water_source" then + if minetest.get_node({x=cx+0,y=1,z=cz-divlen*2}).name == "default:water_source" then num_water_around = num_water_around + 1 end - if minetest.env:get_node({x=cx+0,y=1,z=cz+divlen*2}).name == "default:water_source" then + if minetest.get_node({x=cx+0,y=1,z=cz+divlen*2}).name == "default:water_source" then num_water_around = num_water_around + 1 end if num_water_around >= 2 then is_shallow = false @@ -122,8 +122,8 @@ minetest.register_on_generated(function(minp, maxp, seed) if is_shallow then for x1=-divlen,divlen do for z1=-divlen,divlen do - if minetest.env:get_node({x=cx+x1,y=0,z=cz+z1}).name == "default:sand" then - minetest.env:set_node({x=cx+x1,y=0,z=cz+z1}, {name="default:clay"}) + if minetest.get_node({x=cx+x1,y=0,z=cz+z1}).name == "default:sand" then + minetest.set_node({x=cx+x1,y=0,z=cz+z1}, {name="default:clay"}) end end end -- cgit v1.2.3