1
0
mirror of git://repo.or.cz/rocks.git synced 2025-07-15 06:50:33 +02:00

This is now a modpack.

This commit is contained in:
Tomáš Brada
2015-04-19 20:31:54 +02:00
parent d1b9fb7183
commit 8a1bf6d522
42 changed files with 1 additions and 0 deletions

1
rocks/depends.txt Normal file
View File

@ -0,0 +1 @@
default

99
rocks/ign.lua Normal file
View File

@ -0,0 +1,99 @@
--
-- Igneous Layer
--
-- Basalt Ex/Mafic hard same as diorite, byt limit=0.5
minetest.register_node( "rocks:basalt", {
description = S("Basalt"),
tiles = { "rocks_Basalt.png" },
groups = {cracky=3, stone=1},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
minetest.register_alias("mapgen_stone", "rocks:basalt")
-- ^ does not work. Seems we can not overwrite an alias.
-- If the alias in default/mapgen.lua is deleted, this works.
-- more rock defs
minetest.register_node( "rocks:granite", {
description = S("Granite"),
tiles = { "rocks_Granite.png" },
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, stone=1},
})
minetest.register_node( "rocks:diorite", {
description = S("Diorite"),
tiles = { "rocks_Diorite.png" },
groups = {cracky=3, stone=1},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "rocks:gabbro", {
description = S("Gabbro"),
tiles = { "rocks_Gabbro.png" },
groups = {cracky=3, stone=1},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
local reg=function(name,param)
minetest.register_ore({
ore = name,
wherein= { "mapgen_stone" },
ore_type = "scatter",
clust_scarcity = 10^3,
clust_num_ores = 20^3,
clust_size = 20,
height_min = -31000,
height_max = -5,
noise_treshhold=param.treshold,
noise_params={
offset = 0, scale = 1, octaves = 3, persist = 0.5,
spread = {x=param.spread, y=param.height, z=param.spread},
seed=rocksl.GetNextSeed(),
},
})
end
rocks.register_igneous_stratus=reg
-- rock registration
reg("rocks:granite", { spread=40, height=32, treshold=0.06})
reg("rocks:diorite", { spread=40, height=32, treshold=0.23})
reg("rocks:gabbro", { spread=40, height=32, treshold=0.36})
-- vein stuff
local regv=function(name,param)
minetest.log("error","stub called, rocks.register_vein")
minetest.register_ore({
ore = name,
wherein= param.wherein,
ore_type = "blob",
clust_scarcity = param.rarity^3,
clust_num_ores = 8,
clust_size = 10*2,
height_min = -31000,
height_max = 50,
noise_threshhold = 0.5, --< determined experimentally
noise_params={
offset = 1-param.radius.amplitude, scale = param.radius.amplitude, octaves = 3, persist = 0.5,
spread = {x=param.radius.frequency, y=param.radius.frequency, z=param.radius.frequency},
seed=rocksl.GetNextSeed(),
},
})
end
rocks.register_vein=regv
rocks.register_vein("default:nyancat",{
wherein={"rocks:granite", "air"},
miny=-160, maxy=20,
radius={ average=10, amplitude=0.1, frequency=8 },
density=100,
rarity=70, -- this^3*mapblock_volume veins per mapblock
ores={
{ ore="default:sand", percent=30 },
{ ore="default:dirt", percent=30 },
}
})
-- ~ Tomas Brod

33
rocks/init.lua Normal file
View File

@ -0,0 +1,33 @@
minetest.log("info","[rocks] mod initializing")
-- Load translation library if intllib is installed
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
rocks={}
rocksl={}
rocksl.print=function(text)
minetest.log("info","/rocks "..text)
end
rocksl.seedseq=0
rocksl.GetNextSeed=function()
rocksl.seedseq=rocksl.seedseq+20
return rocksl.seedseq
end
local modpath=minetest.get_modpath(minetest.get_current_modname())
dofile(modpath.."/sed.lua")
dofile(modpath.."/ign.lua")
dofile(modpath.."/skarn.lua")
minetest.register_on_mapgen_init(function(mapgen_params)
-- todo: disable caves and ores
end)

160
rocks/sed.lua Normal file
View File

@ -0,0 +1,160 @@
--
-- Sedimentary Layer
--
-- Mudstone Sed soft Ocean, beach, river, glaciers
minetest.register_node( "rocks:mudstone", {
description = S("Mudstone"),
tiles = { "rocks_Mudstone.png" },
groups = {cracky=1, crumbly=3},
is_ground_content = true, sounds = default.node_sound_dirt_defaults(),
})
-- more rock defs
minetest.register_node( "rocks:limestone", {
description = S("Limestone"),
tiles = { "rocks_Limestone.png" },
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
groups = {cracky=2},
})
local beach_max=4
local lowland_max=27
local highland_max=200
local beach_min=-7
local lowland_min=5
local highland_min=28
do
-- Modify default grassland biome
local grassland=minetest.registered_biomes["default:grassland"] or
{ -- default biome, if no biome mod is installed
name = "rocks:grassland",
node_top = "air",
depth_top = 1,
y_min = lowland_min,
y_max = lowland_max,
heat_point = 50,
humidity_point = 50,
}
local mountains={ -- default mountain biome
name = "rocks:mountain",
node_top = "default:dirt_with_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 2,
node_stone = nil,
y_min = highland_min,
y_max = highland_max,
heat_point = 50,
humidity_point = 50,
}
-- The biome layers are: dust, top, filler, stone
-- On beach: dust, shore_top, shore_filler, underwater
-- coastside: dust, top, filler, shore_filler, underwater, stone
if #minetest.registered_biomes > 1 then
minetest.log("error","Biomes registered before [rocks] discarded, please depend the mod on 'rocks' to fix this.")
-- can't just re-register them here, cause clear_biomes also clears decorations
end
minetest.clear_registered_biomes()
-- hook to inject our sedimentary stone to new biomes
local old_register_biome=minetest.register_biome
minetest.register_biome=function(def)
--print("[rocks] register_biome .name="..def.name)
for n,v in pairs(def) do
--if type(v)~="table" then print(" "..n.."="..v) end
end
local cor=false -- was the biomeheight patched?
local tl=3 -- tolerance in determining biome type based on y_min/max values
local btype -- biome type (:string)
if (def.y_max>3000) and (def.y_min<=highland_min) then
-- correct upper boundary of registered bimes
if (def.y_min<10) and (def.y_min>0) then def.y_max=lowland_max cor=true end
if (def.y_min<30) and (def.y_min>10) then def.y_max=highland_max cor=true end
minetest.log("action","/rocks correcting upper bound on biome "..def.name.." to "..def.y_max)
end
-- actual detection code
if def.node_stone=="default:desert_stone" then btype="desert"
elseif (def.y_min>beach_min-tl) and (def.y_max<beach_max+tl) then btype="beach"
elseif (def.y_min>0) and (def.y_max<lowland_max+tl) then btype="lowland"
elseif (def.y_min>highland_min-tl) and (def.y_max<highland_max+tl) then btype="highland"
elseif (def.y_min<-3000) and (def.y_max<lowland_min+tl) then btype="ocean"
else minetest.log("error", "/rocks could not guess elevation type for biome "..def.name) end
rocksl.print("register_biome .name="..def.name.." -> btype="..btype)
-- patch the new biomes with our rocks
if btype=="lowland" then
def.node_filler="rocks:mudstone"
def.depth_filler=11
elseif btype=="highland" then
def.node_filler="rocks:limestone"
def.node_stone="rocks:limestone"
def.depth_filler=15
end
if (def.node_stone=="default:stone") or (not def.node_stone) then def.node_stone="mapgen_stone" end
-- deactivate the added and removed shore-thing of MGv7
-- to fix weirid sand layers underground
if btype=="lowland" then -- fixme: does this affect beach/ocean too?
def.node_shore_top=def.node_top
def.node_shore_filler=def.node_filler
def.node_underwater=def.node_filler
end
-- and call the saved method to actually do the registration
old_register_biome(def)
end
--now register the default grassland
minetest.register_biome(grassland)
-- create a default mountain biome...
minetest.register_biome(mountains)
-- hook the clear callback (fix biomesdev)
local old_clear=minetest.clear_registered_biomes
minetest.clear_registered_biomes=function()
old_clear()
minetest.log("action","/rocks re-registering default mountain biome!")
minetest.register_biome(mountains)
end
end
-- more biomes
-- todo: mountains, alps, volcanos
local reg=function(name,param)
minetest.register_ore({
ore=name,
wherein= {
"rocks:mudstone",
},
ore_type = "scatter",
clust_scarcity = 8^3,
clust_size = 10,
clust_num_ores = 10^3,
y_min = -20,
y_max = 40,
noise_threshhold = param.treshold,
noise_params = {
offset=0, scale=1, octaves=1, persist=0.3,
spread={x=param.spread, y=param.height, z=param.spread},
seed=rocksl.GetNextSeed(),
},
})
end
-- this does register a new sedimentary vein.
rocks.register_sedimentary=reg
-- follows the only thing remaining from old ver :)
-- Sedimentary rock hardness and distribution
-- Rock Hard Distribution
--Breccia Weak Localized continental, folded
-->Claystone Weak Localized continental, folded, oceanic
--Conglomerate Weak Localized continental, folded
-->Limestone Medium Localized continental, folded; primary oceanic, hills
-->Coal - Large beds, twice as common in swamps
--reg("rocks:limestone", { spread=64, height=32, treshold=0.35 })
--reg("rocks:breccia", { spread=64, height=32, treshold=0.6 })
--reg("rocks:conglomerate", { spread=64, height=32, treshold=0.6 })
reg("default:stone_with_coal", { spread=64, height=14, treshold=0.58 })
reg("default:clay",{ spread=48, height=14, treshold=0.55 })
-- ~ Tomas Brod

157
rocks/skarn.lua Normal file
View File

@ -0,0 +1,157 @@
--
-- Skarn deposit
--
local CommonRarity=40 --too high... should be like 76
local CommonRadius=10
local CommonWherein={ "rocks:granite", "rocks:limestone" }
minetest.register_node( "rocks:skarn", {
description = S("Skarn"),
tiles = { "rocks_Skarn.png" },
groups = {cracky=3, stone=1},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
-- skarn deposit
rocks.register_vein("rocks:skarn",{
wherein=CommonWherein,
miny=-320, maxy=300,
radius={ average=CommonRadius, amplitude=0.16, frequency=8 },
density=80, rarity=CommonRarity,
})
local function GetNoiseParams()
return {
scale=1, offset=0, seed=rocksl.GetNextSeed(), octaves=1, persist=1,
spread={ x=100, y=100, z=100 } }
end
-- ores have to be redefined for skarn background
-- Todo:
-- There is also a chance of isolated lapis crystals, Gold
-- Molybdenite with Cu
-- wollastonite with Fe
-- enrichments: scheelite and wollastonite
-- Chalcopyrite
minetest.register_node( "rocks:skarn_chalcopyrite", {
description = S("Chalcopyrite"),
tiles = { "rocks_Skarn.png^rocks_Chalcopyrite.png" },
groups = {cracky=3},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
-- Malachyte
minetest.register_node( "rocks:skarn_malachyte", {
description = S("Malachyte"),
tiles = { "rocks_Skarn.png^rocks_Chalcopyrite.png" },
groups = {cracky=3},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
-- Chalcopyrite/Malachyte skarn mix
rocksl.CopperNoise=GetNoiseParams()
minetest.register_ore({
wherein="rocks:skarn",
ore="rocks:skarn_chalcopyrite",
clust_size=3,
clust_num_ores=12,
clust_scarcity=4^3,
noise_treshold=0.333,
noise_params=rocksl.CopperNoise
})
minetest.register_ore({
wherein="rocks:skarn",
ore="rocks:skarn_malachyte",
clust_size=3,
clust_num_ores=11,
clust_scarcity=4^3,
noise_treshold=0.333,
noise_params=rocksl.CopperNoise
})
-- Sphalerite
minetest.register_node( "rocks:skarn_sphalerite", {
description = S("Sphalerite"),
tiles = { "rocks_Skarn.png^rocks_sphalerite.png" },
groups = {cracky=3},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
-- Galena
minetest.register_node( "rocks:skarn_galena", {
description = S("Galena"),
tiles = { "rocks_Skarn.png^rocks_galena.png" },
groups = {cracky=3},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
-- Pb Zn skarn mix
rocksl.PbZnNoise=GetNoiseParams()
minetest.register_ore({
wherein="rocks:skarn",
ore="rocks:skarn_sphalerite",
clust_size=3,
clust_num_ores=9,
clust_scarcity=4^3,
noise_treshold=0.38,
noise_params=rocksl.PbZnNoise
})
minetest.register_ore({
wherein="rocks:skarn",
ore="rocks:skarn_galena",
clust_size=3,
clust_num_ores=10,
clust_scarcity=4^3,
noise_treshold=0.38,
noise_params=rocksl.PbZnNoise
})
-- marble and hornfels, as well as unchanged limestone.
-- { ore="rocks:marble", percent=10 },
-- { ore="rocks:hornfels", percent=10 },
-- { ore="rocks:skarn_galena", percent=25 },
-- { ore="rocks:skarn_sphalerite", percent=25 },
-- Magnetite
minetest.register_node( "rocks:skarn_magnetite", {
description = S("Magnetite"),
tiles = { "rocks_Skarn.png^rocks_Magnetite.png" },
groups = {cracky=3},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
-- Fe skarn mix
rocksl.IronNoise=GetNoiseParams()
minetest.register_ore({
wherein="rocks:skarn",
ore="rocks:skarn_magnetite",
clust_size=3,
clust_num_ores=13,
clust_scarcity=4^3,
noise_treshold=0.3,
noise_params=rocksl.IronNoise
})
-- marble and hornfels, as well as unchanged limestone.
-- { ore="rocks:marble", percent=10 },
-- { ore="rocks:hornfels", percent=10 },
-- { ore="rocks:skarn_magnetite", percent=40 },
-- Magnesite
minetest.register_node( "rocks:skarn_magnesite", {
description = S("Magnesite"),
tiles = { "rocks_Skarn.png^rocks_Magnesite.png" },
groups = {cracky=3},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
-- Vermiculite (fixme: move to CommonRocks)
minetest.register_node( "rocks:vermiculite", {
description = S("Vermiculite"),
tiles = { "rocks_Vermiculite.png" },
groups = {crumbly=3},
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
-- magnesite/vermiculite skarn mix
-- marble and hornfels, as well as unchanged limestone.
-- { ore="rocks:marble", percent=10 },
-- { ore="rocks:hornfels", percent=10 },
-- { ore="rocks:skarn_magnesite", percent=30 },
-- { ore="rocks:vermiculite", percent=20 },
-- ~ Tomas Brod

View File

@ -0,0 +1,17 @@
Theese files were copied from minetest decoblocks mod. Original files were
in "default/textures" and with "default_" prefix instead of "rocks_".
rocks_bb.png
rocks_blkgr.png
rocks_brgr.png
rocks_gls.png
rocks_mrbrownstone.png
rocks_obs.png
rocks_pgr.png
rocks_rss.png
rocks_serp.png
rocks_sod.png
rocks_trav.png
rocks_wgr.png
rocks_wm.png
rocks_yss.png

View File

@ -0,0 +1,14 @@
Theese files were copied from minecraft PFAA Geologica mod.
rocks_Andesite.png
rocks_Basalt.png
rocks_Diorite.png
rocks_Gabbro.png
rocks_Gneiss.png
rocks_Granite.png
rocks_Mudstone.png
rocks_Peridotite.png
rocks_Rhyolite.png
rocks_Schist.png
rocks_Slate.png
rocks_Skarn.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

BIN
rocks/textures/rocks_bb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
rocks/textures/rocks_wm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB