diff options
author | sapier <Sapier at GMX dot net> | 2013-05-25 00:51:02 +0200 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2013-05-25 00:51:02 +0200 |
commit | ab433775777c4f5055bcf4d2a1cffc506c4f9961 (patch) | |
tree | 9f80c74c95cbb1efa15c0c36df8d5e35235e5554 /games/minimal/mods/default/mapgen.lua | |
parent | 865f380c91ced850d1a499c91aa2ab5489624802 (diff) | |
download | minetest-ab433775777c4f5055bcf4d2a1cffc506c4f9961.tar.gz minetest-ab433775777c4f5055bcf4d2a1cffc506c4f9961.tar.bz2 minetest-ab433775777c4f5055bcf4d2a1cffc506c4f9961.zip |
Move scriptapi to separate folder (by sapier)
On the lua side, notably minetest.env:<function>(<args>) should now
be replaced by minetest.<function>(<args>).
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)
Diffstat (limited to 'games/minimal/mods/default/mapgen.lua')
-rw-r--r-- | games/minimal/mods/default/mapgen.lua | 16 |
1 files changed, 8 insertions, 8 deletions
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 |