1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-26 02:30:38 +01:00

Reorganized ores code

This commit is contained in:
Gael-de-Sailly 2015-08-28 13:44:23 +02:00
parent f846a29c2c
commit dd8e8e755c
4 changed files with 108 additions and 125 deletions

View File

@ -171,6 +171,17 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 32 * 32 * 32,
clust_num_ores = 40,
clust_size = 4,
y_max = 64,
y_min = -30000,
})
-- Iron -- Iron
minetest.register_ore({ minetest.register_ore({
@ -219,6 +230,17 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 48 * 48 * 48,
clust_num_ores = 40,
clust_size = 4,
y_max = 64,
y_min = -30000,
})
-- Mese -- Mese
minetest.register_ore({ minetest.register_ore({
@ -269,18 +291,6 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
minetest.register_ore({
ore_type = "scatter",
ore = "default:meze",
wherein = "default:stone",
clust_scarcity = 40 * 40 * 40,
clust_num_ores = 3,
clust_size = 2,
y_min = 0,
y_max = 64,
flags = "absheight",
})
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:mese", ore = "default:mese",
@ -293,6 +303,20 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
-- Beware of Meze
minetest.register_ore({
ore_type = "scatter",
ore = "default:meze",
wherein = "default:stone",
clust_scarcity = 40 * 40 * 40,
clust_num_ores = 3,
clust_size = 2,
y_min = 0,
y_max = 64,
flags = "absheight",
})
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:meze", ore = "default:meze",
@ -305,39 +329,6 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
minetest.register_ore({
ore_type = "scatter",
ore = "maptools:superapple",
wherein = "default:apple",
clust_scarcity = 6 * 6 * 6,
clust_num_ores = 5,
clust_size = 2,
y_min = 0,
y_max = 64,
})
minetest.register_ore({
ore_type = "scatter",
ore = "maptools:superapple",
wherein = "default:jungleleaves",
clust_scarcity = 16 * 16 * 16,
clust_num_ores = 5,
clust_size = 2,
y_min = 0,
y_max = 64,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coin",
wherein = "default:stone",
clust_scarcity = 26 * 26 * 26,
clust_num_ores = 1,
clust_size = 1,
y_min = -30000,
y_max = 0,
flags = "absheight",
})
-- Gold -- Gold
@ -391,6 +382,17 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_diamond",
wherein = "default:stone",
clust_scarcity = 30 * 30 * 30,
clust_num_ores = 64,
clust_size = 5,
y_max = -1024,
y_min = -30000,
})
-- Copper -- Copper
minetest.register_ore({ minetest.register_ore({
@ -427,36 +429,42 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
-- Gold Coins
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_coal", ore = "default:stone_with_coin",
wherein = "default:stone", wherein = "default:stone",
clust_scarcity = 32 * 32 * 32, clust_scarcity = 26 * 26 * 26,
clust_num_ores = 40, clust_num_ores = 1,
clust_size = 4, clust_size = 1,
y_max = 64,
y_min = -30000, y_min = -30000,
y_max = 0,
flags = "absheight",
}) })
-- Super Apples
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_iron", ore = "maptools:superapple",
wherein = "default:stone", wherein = "default:apple",
clust_scarcity = 48 * 48 * 48, clust_scarcity = 6 * 6 * 6,
clust_num_ores = 40, clust_num_ores = 5,
clust_size = 4, clust_size = 2,
y_min = 0,
y_max = 64, y_max = 64,
y_min = -30000,
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_diamond", ore = "maptools:superapple",
wherein = "default:stone", wherein = "default:jungleleaves",
clust_scarcity = 30 * 30 * 30, clust_scarcity = 16 * 16 * 16,
clust_num_ores = 64, clust_num_ores = 5,
clust_size = 5, clust_size = 2,
y_max = -1024, y_min = 0,
y_min = -30000, y_max = 64,
}) })
if minetest.setting_get("mg_name") == "indev" then if minetest.setting_get("mg_name") == "indev" then

View File

@ -1,35 +0,0 @@
------------------------------------------------------------------------------
------------------------------ CONFIGURATION ---------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-------- Change settings by changing the values after the "=". ---------------
------------------------------------------------------------------------------
-- Chunk sizes for ore generation (bigger = ore deposits are more scattered around)
moreores_copper_chunk_size = 8
moreores_tin_chunk_size = 7
moreores_silver_chunk_size = 11
moreores_gold_chunk_size = 14
moreores_mithril_chunk_size = 11
-- Amount of ore per chunk (higher = bigger ore deposits)
moreores_copper_ore_per_chunk = 6
moreores_tin_ore_per_chunk = 3
moreores_silver_ore_per_chunk = 4
moreores_gold_ore_per_chunk = 4
moreores_mithril_ore_per_chunk = 1
-- Minimal depths of ore generation (Y coordinate, 0 being sea level by default)
moreores_copper_min_depth = -31000
moreores_tin_min_depth = -31000
moreores_silver_min_depth = -31000
moreores_gold_min_depth = -31000
moreores_mithril_min_depth = -31000
-- Maximal depths of ore generation (Y coordinate, 0 being sea level by default)
moreores_copper_max_depth = 64
moreores_tin_max_depth = 12
moreores_silver_max_depth = -12
moreores_gold_max_depth = -128
moreores_mithril_max_depth = -1024

View File

@ -17,8 +17,6 @@ end
local modpath = minetest.get_modpath("moreores") local modpath = minetest.get_modpath("moreores")
dofile(modpath .. "/_config.txt")
-- `mg` support: -- `mg` support:
if minetest.get_modpath("mg") then if minetest.get_modpath("mg") then
dofile(modpath .. "/mg.lua") dofile(modpath .. "/mg.lua")
@ -165,12 +163,6 @@ local function add_ore(modname, description, mineral_name, oredef)
}) })
end end
oredef.oredef.ore_type = "scatter"
oredef.oredef.ore = modname .. ":mineral_" .. mineral_name
oredef.oredef.wherein = "default:stone"
minetest.register_ore(oredef.oredef)
for tool_name, tooldef in pairs(oredef.tools) do for tool_name, tooldef in pairs(oredef.tools) do
local tdef = { local tdef = {
description = "", description = "",
@ -232,12 +224,6 @@ local oredefs = {
silver = { silver = {
description = "Silver", description = "Silver",
makes = {ore = true, block = true, lump = true, ingot = true, chest = true}, makes = {ore = true, block = true, lump = true, ingot = true, chest = true},
oredef = {clust_scarcity = moreores_silver_chunk_size * moreores_silver_chunk_size * moreores_silver_chunk_size,
clust_num_ores = moreores_silver_ore_per_chunk,
clust_size = moreores_silver_chunk_size,
height_min = moreores_silver_min_depth,
height_max = moreores_silver_max_depth
},
tools = { tools = {
pick = { pick = {
groupcaps = { groupcaps = {
@ -278,23 +264,11 @@ local oredefs = {
tin = { tin = {
description = "Tin", description = "Tin",
makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
oredef = {clust_scarcity = moreores_tin_chunk_size * moreores_tin_chunk_size * moreores_tin_chunk_size,
clust_num_ores = moreores_tin_ore_per_chunk,
clust_size = moreores_tin_chunk_size,
height_min = moreores_tin_min_depth,
height_max = moreores_tin_max_depth
},
tools = {} tools = {}
}, },
mithril = { mithril = {
description = "Mithril", description = "Mithril",
makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
oredef = {clust_scarcity = moreores_mithril_chunk_size * moreores_mithril_chunk_size * moreores_mithril_chunk_size,
clust_num_ores = moreores_mithril_ore_per_chunk,
clust_size = moreores_mithril_chunk_size,
height_min = moreores_mithril_min_depth,
height_max = moreores_mithril_max_depth
},
tools = { tools = {
pick = { pick = {
groupcaps = { groupcaps = {
@ -338,6 +312,8 @@ for orename,def in pairs(oredefs) do
add_ore(modname, def.description, orename, def) add_ore(modname, def.description, orename, def)
end end
dofile(modpath .. "/ores.lua")
--[[ --[[
-- Copper rail (special node): -- Copper rail (special node):
minetest.register_craft({ minetest.register_craft({

34
mods/moreores/ores.lua Normal file
View File

@ -0,0 +1,34 @@
-- Register ores
minetest.register_ore({
ore_type = "scatter",
ore = "moreores:mineral_silver",
wherein = "default:stone",
clust_scarcity = 11 * 11 * 11,
clust_num_ores = 4,
clust_size = 11,
y_min = -31000,
y_max = -12,
})
minetest.register_ore({
ore_type = "scatter",
ore = "moreores:mineral_tin",
wherein = "default:stone",
clust_scarcity = 7 * 7 * 7,
clust_num_ores = 3,
clust_size = 7,
y_min = -31000,
y_max = 12,
})
minetest.register_ore({
ore_type = "scatter",
ore = "moreores:mineral_mithril",
wherein = "default:stone",
clust_scarcity = 11 * 11 * 11,
clust_num_ores = 1,
clust_size = 1,
y_min = -31000,
y_max = -1024,
})