Aaron Suen 6e0d5a0778 Strata overhaul
- Apply stratification last in shared mapgens, so it can see all
  already-placed ores.
- Support stratification for nodes other than plain stone.
- Register lode stone and lode ore for stratification.
2019-02-24 10:19:22 -05:00

25 lines
667 B
Lua

-- LUALOCALS < ---------------------------------------------------------
local math, minetest, nodecore
= math, minetest, nodecore
local math_floor, math_sqrt
= math.floor, math.sqrt
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
nodecore.hard_stone_strata = 7
function nodecore.hard_stone_tile(n)
local o = math_floor(math_sqrt(n or 0) * 96)
if o <= 0 then
return modname .. "_stone.png"
end
if o >= 255 then
return modname .. "_stone.png^"
.. modname .. "_stone_hard.png"
end
return modname .. "_stone.png^("
.. modname .. "_stone_hard.png^[opacity:"
.. o .. ")"
end