diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2015-01-15 22:27:34 -0800 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2015-01-15 22:27:34 -0800 |
commit | 3a4850068f1ba2acc7a2c71c2756b88e9a007713 (patch) | |
tree | b90be501b18d15aa902340cab271856f4d448882 | |
parent | ed78d442b39510ed9a67249811914e92a18360cf (diff) |
Sand creation fixes
- don't make sand unless we should make desert_sand
- don't make sand unless there's already some form of sand around
-rw-r--r-- | init.lua | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -389,12 +389,22 @@ local function sed() return end - -- prevent dirt-to-sand outside deserts - -- FIXME should account for Biome here too + -- prevent sand-to-clay unless under water + -- FIXME should account for Biome here too (should be ocean, river, or beach-like) if (underliquid < 1) and (node.name == "default:sand" or node.name == "default:desert_sand") then return end + -- prevent sand in dirt-dominated areas + if node.name == "default:dirt" then + -- since we don't have biome information, we'll assume that if there is no sand or + -- desert sand anywhere nearby, we shouldn't degrade this block further + local fpos = minetest.find_node_near(pos, 2, {"default:sand", "default:desert_sand"}) + if not fpos then + return + end + end + if roll(hardness) then return end @@ -403,7 +413,12 @@ local function sed() local newmat = "air" if node.name == "default:dirt" then - newmat = "default:sand" + local fpos = minetest.find_node_near(pos, 2, "default:desert_sand") + if not fpos then + newmat = "default:sand" + else + newmat = "default:desert_sand" + end elseif node.name == "default:dirt_with_grass" or node.name == "default:dirt_with_grass_footsteps" or node.name == "default:dirt_with_snow" then |