This commit is contained in:
Christian Sirolli 2022-01-22 17:50:54 -05:00
parent d0e38f341b
commit 130118efbe
5 changed files with 1707 additions and 0 deletions

27
.luacheckrc Normal file
View File

@ -0,0 +1,27 @@
unused_args = false
allow_defined_top = true
read_globals = {
"DIR_DELIM",
"minetest",
"dump",
"vector",
"VoxelManip", "VoxelArea",
"PseudoRandom", "PcgRandom",
"ItemStack",
"Settings",
"unpack",
-- Silence errors about custom table methods.
table = { fields = { "copy", "indexof" } },
-- Silence warnings about accessing undefined fields of global 'math'
math = { fields = { "sign" } }
}
-- Overwrites minetest.handle_node_drops
files["mods/creative/init.lua"].globals = { "minetest" }
-- Overwrites minetest.calculate_knockback
files["mods/player_api/api.lua"].globals = { "minetest" }
-- Don't report on legacy definitions of globals.
files["mods/default/legacy.lua"].global = false

11
.travis.yml Normal file
View File

@ -0,0 +1,11 @@
language: generic
addons:
apt:
packages:
- luarocks
before_install:
- luarocks install --local luacheck
script:
- $HOME/.luarocks/bin/luacheck ./mods
notifications:
email: false

1170
mods/mapgen/crust.lua Normal file

File diff suppressed because it is too large Load Diff

View File

View File

@ -0,0 +1,499 @@
--
-- Ores
--
minetest.register_node("default:stone_with_coal", {
description = S("Coal Ore"),
tiles = {"default_stone.png^default_mineral_coal.png"},
groups = {cracky = 3},
drop = "default:coal_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_with_iron", {
description = S("Iron Ore"),
tiles = {"default_stone.png^default_mineral_iron.png"},
groups = {cracky = 2},
drop = "default:iron_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:steelblock", {
description = S("Steel Block"),
tiles = {"default_steel_block.png"},
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
})
minetest.register_node("default:stone_with_copper", {
description = S("Copper Ore"),
tiles = {"default_stone.png^default_mineral_copper.png"},
groups = {cracky = 2},
drop = "default:copper_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:copperblock", {
description = S("Copper Block"),
tiles = {"default_copper_block.png"},
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
})
minetest.register_node("default:stone_with_tin", {
description = S("Tin Ore"),
tiles = {"default_stone.png^default_mineral_tin.png"},
groups = {cracky = 2},
drop = "default:tin_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:tinblock", {
description = S("Tin Block"),
tiles = {"default_tin_block.png"},
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
})
minetest.register_node("default:bronzeblock", {
description = S("Bronze Block"),
tiles = {"default_bronze_block.png"},
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
})
minetest.register_node("default:stone_with_gold", {
description = S("Gold Ore"),
tiles = {"default_stone.png^default_mineral_gold.png"},
groups = {cracky = 2},
drop = "default:gold_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:goldblock", {
description = S("Gold Block"),
tiles = {"default_gold_block.png"},
is_ground_content = false,
groups = {cracky = 1},
sounds = default.node_sound_metal_defaults(),
})
minetest.register_node("default:stone_with_diamond", {
description = S("Diamond Ore"),
tiles = {"default_stone.png^default_mineral_diamond.png"},
groups = {cracky = 1},
drop = "default:diamond",
sounds = default.node_sound_stone_defaults(),
})
function default.register_ores()
-- Stratum ores.
-- These obviously first.
-- Silver sandstone
minetest.register_ore({
ore_type = "stratum",
ore = "default:silver_sandstone",
wherein = {"default:stone"},
clust_scarcity = 1,
y_max = 46,
y_min = 10,
noise_params = {
offset = 28,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 4,
biomes = {"cold_desert"},
})
minetest.register_ore({
ore_type = "stratum",
ore = "default:silver_sandstone",
wherein = {"default:stone"},
clust_scarcity = 1,
y_max = 42,
y_min = 6,
noise_params = {
offset = 24,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 2,
biomes = {"cold_desert"},
})
-- Desert sandstone
minetest.register_ore({
ore_type = "stratum",
ore = "default:desert_sandstone",
wherein = {"default:desert_stone"},
clust_scarcity = 1,
y_max = 46,
y_min = 10,
noise_params = {
offset = 28,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 4,
biomes = {"desert"},
})
minetest.register_ore({
ore_type = "stratum",
ore = "default:desert_sandstone",
wherein = {"default:desert_stone"},
clust_scarcity = 1,
y_max = 42,
y_min = 6,
noise_params = {
offset = 24,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 2,
biomes = {"desert"},
})
-- Sandstone
minetest.register_ore({
ore_type = "stratum",
ore = "default:sandstone",
wherein = {"default:desert_stone"},
clust_scarcity = 1,
y_max = 39,
y_min = 3,
noise_params = {
offset = 21,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 2,
biomes = {"desert"},
})
-- Blob ore.
-- These before scatter ores to avoid other ores in blobs.
-- Clay
minetest.register_ore({
ore_type = "blob",
ore = "default:clay",
wherein = {"default:sand"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 0,
y_min = -15,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = -316,
octaves = 1,
persist = 0.0
},
})
-- Silver sand
minetest.register_ore({
ore_type = "blob",
ore = "default:silver_sand",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 31000,
y_min = -31000,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 2316,
octaves = 1,
persist = 0.0
},
})
-- Dirt
minetest.register_ore({
ore_type = "blob",
ore = "default:dirt",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 31000,
y_min = -31,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 17676,
octaves = 1,
persist = 0.0
},
-- Only where default:dirt is present as surface material
biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest",
"deciduous_forest", "deciduous_forest_shore", "rainforest",
"rainforest_swamp"}
})
-- Gravel
minetest.register_ore({
ore_type = "blob",
ore = "default:gravel",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 31000,
y_min = -31000,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 766,
octaves = 1,
persist = 0.0
},
})
-- Scatter ores
-- Coal
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 9,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 8,
clust_size = 3,
y_max = 64,
y_min = -127,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 12 * 12 * 12,
clust_num_ores = 30,
clust_size = 5,
y_max = -128,
y_min = -31000,
})
-- Tin
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 10 * 10 * 10,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 13 * 13 * 13,
clust_num_ores = 4,
clust_size = 3,
y_max = -64,
y_min = -127,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 10 * 10 * 10,
clust_num_ores = 5,
clust_size = 3,
y_max = -128,
y_min = -31000,
})
-- Copper
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 12 * 12 * 12,
clust_num_ores = 4,
clust_size = 3,
y_max = -64,
y_min = -127,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 5,
clust_size = 3,
y_max = -128,
y_min = -31000,
})
-- Iron
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 12,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 7 * 7 * 7,
clust_num_ores = 5,
clust_size = 3,
y_max = -128,
y_min = -255,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 12 * 12 * 12,
clust_num_ores = 29,
clust_size = 5,
y_max = -256,
y_min = -31000,
})
-- Gold
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 13 * 13 * 13,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 3,
clust_size = 2,
y_max = -256,
y_min = -511,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 13 * 13 * 13,
clust_num_ores = 5,
clust_size = 3,
y_max = -512,
y_min = -31000,
})
-- Diamond
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_diamond",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 4,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_diamond",
wherein = "default:stone",
clust_scarcity = 17 * 17 * 17,
clust_num_ores = 4,
clust_size = 3,
y_max = -1024,
y_min = -2047,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_diamond",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 4,
clust_size = 3,
y_max = -2048,
y_min = -31000,
})
end