1
0
mirror of git://repo.or.cz/rocks.git synced 2024-11-16 07:20:40 +01:00

Added mudstone.

This commit is contained in:
Tomáš Brada 2015-05-03 09:17:20 +02:00
parent 75c1cfa108
commit 7a5d600e0c

View File

@ -25,6 +25,19 @@ local np_sp = {
seed = -1284, 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) rocksl.gensed = function (minp, maxp, seed)
local t1 = os.clock() local t1 = os.clock()
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
@ -52,6 +65,7 @@ rocksl.gensed = function (minp, maxp, seed)
claystone={ mod="rocks" }, claystone={ mod="rocks" },
slate={ mod="rocks" }, slate={ mod="rocks" },
conglomerate={ mod="rocks" }, conglomerate={ mod="rocks" },
mudstone={ mod="rocks" },
} }
for k,v in pairs(layers) do for k,v in pairs(layers) do
v.ctx=minetest.get_content_id(v.mod..":"..k) v.ctx=minetest.get_content_id(v.mod..":"..k)
@ -70,17 +84,20 @@ rocksl.gensed = function (minp, maxp, seed)
if tp==1 then if tp==1 then
-- particulates -- particulates
if vcv>0.4 then if vcv>0.46 then
-- clay-(0,stone,slate) -- clay-(0,stone,slate)
if spv>0.28 then li="slate" if spv>0.28 then li="slate"
elseif spv>-0.31 then li="claystone" elseif spv>-0.31 then li="claystone"
else li="clay" end else li="clay" end
elseif spv>0.4 then
li="mudstone"
elseif vcv>0.2 then elseif vcv>0.2 then
-- sand-(0,stone) -- sand-(0,stone)
if spv>-0.3 then li="sandstone" else li="sand" end if spv>-0.3 then li="sandstone" else li="sand" end
else else
-- gravel/conglomerate -- gravel/conglomerate
if spv>-0.34 then li="conglomerate" else li="gravel" end if spv>-0.34 then li="conglomerate" else li="gravel" end
-- breccia?
end end
end end
@ -88,6 +105,8 @@ rocksl.gensed = function (minp, maxp, seed)
local di=area:index(x,y,z) local di=area:index(x,y,z)
if ((data[di]==c_stone) or (data[di]==c_dwg)) and li then if ((data[di]==c_stone) or (data[di]==c_dwg)) and li then
data[di]=layers[li].ctx data[di]=layers[li].ctx
--stats.total=stats.total+1
--stats[li]=stats[li]+1
end end
end end
nixz= nixz+1 nixz= nixz+1
@ -95,6 +114,7 @@ rocksl.gensed = function (minp, maxp, seed)
vm:set_data(data) vm:set_data(data)
minetest.log("action", "rocks/gensed/ "..math.ceil((os.clock() - t1) * 1000).." ms ") minetest.log("action", "rocks/gensed/ "..math.ceil((os.clock() - t1) * 1000).." ms ")
vm:write_to_map(data) vm:write_to_map(data)
--for k,v in pairs(stats) do print("stat: "..k..": "..((v/stats.total)*100).."%") end
end end
minetest.register_node( "rocks:slate", { minetest.register_node( "rocks:slate", {