From 7a5d600e0c4e24c38b5f630287c040b83541b593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Brada?= Date: Sun, 3 May 2015 09:17:20 +0200 Subject: [PATCH] Added mudstone. --- rocks/gensed.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/rocks/gensed.lua b/rocks/gensed.lua index 102ee00..710ac4b 100644 --- a/rocks/gensed.lua +++ b/rocks/gensed.lua @@ -25,6 +25,19 @@ local np_sp = { seed = -1284, } +local stats={ + dirt=0, + gravel=0, + sand=0, + sandstone=0, + clay=0, + claystone=0, + slate=0, + conglomerate=0, + mudstone=0, + total=0 +} + rocksl.gensed = function (minp, maxp, seed) local t1 = os.clock() local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") @@ -52,6 +65,7 @@ rocksl.gensed = function (minp, maxp, seed) claystone={ mod="rocks" }, slate={ mod="rocks" }, conglomerate={ mod="rocks" }, + mudstone={ mod="rocks" }, } for k,v in pairs(layers) do v.ctx=minetest.get_content_id(v.mod..":"..k) @@ -70,17 +84,20 @@ rocksl.gensed = function (minp, maxp, seed) if tp==1 then -- particulates - if vcv>0.4 then + if vcv>0.46 then -- clay-(0,stone,slate) if spv>0.28 then li="slate" elseif spv>-0.31 then li="claystone" else li="clay" end + elseif spv>0.4 then + li="mudstone" elseif vcv>0.2 then -- sand-(0,stone) if spv>-0.3 then li="sandstone" else li="sand" end else -- gravel/conglomerate if spv>-0.34 then li="conglomerate" else li="gravel" end + -- breccia? end end @@ -88,6 +105,8 @@ rocksl.gensed = function (minp, maxp, seed) local di=area:index(x,y,z) if ((data[di]==c_stone) or (data[di]==c_dwg)) and li then data[di]=layers[li].ctx + --stats.total=stats.total+1 + --stats[li]=stats[li]+1 end end nixz= nixz+1 @@ -95,6 +114,7 @@ rocksl.gensed = function (minp, maxp, seed) vm:set_data(data) minetest.log("action", "rocks/gensed/ "..math.ceil((os.clock() - t1) * 1000).." ms ") vm:write_to_map(data) + --for k,v in pairs(stats) do print("stat: "..k..": "..((v/stats.total)*100).."%") end end minetest.register_node( "rocks:slate", {