add wip ore system, sky bugfix

This commit is contained in:
wsor 2021-08-14 17:15:39 -04:00
parent 4cb318f7b0
commit cb2fe2a2ea
13 changed files with 162 additions and 17 deletions

View File

@ -67,7 +67,7 @@ local function logic()
for _, player in pairs(minetest.get_connected_players()) do
local pname = player:get_player_name()
local bdata = minetest.get_biome_data(player:get_pos())
local bdef = minetest.registered_biomes[minetest.get_biome_name(bdata.biome)]
local bdef = minetest.registered_biomes[minetest.get_biome_name(bdata.biome)] or {}
if bs.players[pname] and bs.players[pname].id == bdata.biome then break end

View File

@ -352,7 +352,7 @@ minetest.register_biome({
--snowy grasland
minetest.register_biome({
name = "snowy_grassland",
name = "snowygrassland",
node_dust = "fl_topsoil:snow",
node_top = "fl_topsoil:dirt_with_snow",
depth_top = 1,
@ -371,7 +371,7 @@ minetest.register_biome({
})
minetest.register_biome({
name = "snowy_grassland_ocean",
name = "snowygrassland_ocean",
node_dust = "fl_topsoil:snow",
node_top = "fl_stone:sand",
depth_top = 1,

View File

@ -1,10 +1,140 @@
--this code is a mess
-- -150 to -190 seems no ores other than mithite???
biomes = {
savannah = {"savannah"},
stone = {"grassland", "taiga", "snowygrassland", "tundra", "rainforest", "deciduousforest", "coniferousforest"},
desert_stone = {"sand", "desert", "silversand"},
ors = {"ors"},
tuff = {"tuff"},
}
for name, data in pairs(biomes) do
local temp = {}
for _, biome in pairs(data) do
table.insert(temp, biome)
table.insert(temp, biome .. "_ocean")
end
biomes[name] = table.copy(temp)
end
minetest.register_ore({
ore_type = "scatter",
ore = "fl_ores:mithite_in_stone",
wherein = "mapgen_stone",
wherein = "fl_stone:stone",
clust_scarcity = 30*30*30,
clust_num_ores = 1,
clust_size = 1,
y_min = -32,
y_max = 32,
y_min = -32,
})
minetest.register_ore({
ore_type = "scatter",
ore = "fl_ores:mithite_in_ors",
wherein = "fl_stone:ors",
clust_scarcity = 30*30*30,
clust_num_ores = 1,
clust_size = 1,
y_max = -32,
y_min = -150,
})
minetest.register_ore({
ore_type = "scatter",
ore = "fl_ores:mithite_in_tuff",
wherein = "fl_stone:tuff",
clust_scarcity = 30*30*30,
clust_num_ores = 1,
clust_size = 1,
y_max = -150,
y_min = -300,
})
local function reg_ores(ore, clust)
for name, data in pairs(biomes) do
local scr = clust[name].scr
local ost = clust[name].ost or {300,4,64,-31,3,-31}
minetest.register_ore({
ore_type = "scatter",
ore = "fl_ores:" .. ore .. "_in_" .. name,
wherein = "fl_stone:" .. name,
clust_scarcity = (scr+3) * (scr+3) * (scr+3),
clust_num_ores = clust[name].nmo+1,
clust_size = clust[name].sz+1,
biomes = biomes[name],
y_max = ost[1], --300
y_min = ost[2], --4
})
minetest.register_ore({
ore_type = "scatter",
ore = "fl_ores:" .. ore .. "_in_" .. name,
wherein = "fl_stone:" .. name,
clust_scarcity = (scr) * (scr) * (scr),
clust_num_ores = clust[name].nmo,
clust_size = clust[name].sz,
biomes = biomes[name],
y_max = ost[3], --64
y_min = ost[4], -- -31
})
minetest.register_ore({
ore_type = "scatter",
ore = "fl_ores:" .. ore .. "_in_" .. name,
wherein = "fl_stone:" .. name,
clust_scarcity = (scr+10) * (scr+10) * (scr+10),
clust_num_ores = clust[name].nmo+4,
clust_size = clust[name].sz+4,
biomes = biomes[name],
y_max = ost[5], --3
y_min = ost[6], -- -31
})
end
end
reg_ores("coal", {
stone = {scr = 7, nmo = 7, sz = 3},
savannah = {scr = 6, nmo = 8, sz = 4},
desert_stone = {scr = 8, nmo = 6, sz = 2}, ----21,45,1698
ors = {scr = 9, nmo = 4, sz = 3, ost = {-300,-300,-31,-50,-31,-100,}},
tuff = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-150,-300,-300,-300}},
})
reg_ores("iron", {
stone = {scr = 12, nmo = 7, sz = 3},
savannah = {scr = 18, nmo = 8, sz = 4},
desert_stone = {scr = 16, nmo = 6, sz = 2},
ors = {scr = 19, nmo = 4, sz = 3, ost = {-300,-300,-31,-75,-31,-125,}},
tuff = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-150,-300,-300,-300}},
})
reg_ores("copper", {
stone = {scr = 18, nmo = 8, sz = 3, ost = {-31,-31,0,-31,-20,-31}},
savannah = {scr = 14, nmo = 6, sz = 4, ost = {-31,-31,0,-31,-20,-31}},
desert_stone = {scr = 16, nmo = 6, sz = 2, ost = {-31,-31,0,-31,-20,-31}},
ors = {scr = 19, nmo = 7, sz = 3, ost = {-31,-50,-31,-100,-31,-125,}},
tuff = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-150,-300,-300,-300}},
})
reg_ores("tin", {
stone = {scr = 18, nmo = 7, sz = 3, ost = {-31,-31,-10,-31,-20,-31}},
savannah = {scr = 20, nmo = 8, sz = 4, ost = {-31,-31,-10,-31,-20,-31}},
desert_stone = {scr = 16, nmo = 6, sz = 2, ost = {-31,-31,-10,-31,-20,-31}},
ors = {scr = 21, nmo = 7, sz = 3, ost = {-31,-50,-31,-100,-31,-150,}},
tuff = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-150,-300,-300,-300}},
})
reg_ores("gold", {
stone = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-10,-31,-300,-300}},
savannah = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-10,-31,-300,-300}},
desert_stone = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-10,-31,-300,-300}},
ors = {scr = 18, nmo = 7, sz = 3, ost = {-75,-150,-31,-150,-50,-150,}},
tuff = {scr = 18, nmo = 7, sz = 3, ost = {-150,-250,-150,-300,-150,-275}},
})
reg_ores("diamond", {
stone = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-10,-31,-300,-300}},
savannah = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-10,-31,-300,-300}},
desert_stone = {scr = 30, nmo = 1, sz = 1, ost = {-300,-300,-10,-31,-300,-300}},
ors = {scr = 18, nmo = 7, sz = 3, ost = {-75,-150,-31,-150,-50,-150,}},
tuff = {scr = 18, nmo = 7, sz = 3, ost = {-150,-300,-150,-300,-150,-300}},
})

View File

@ -1,10 +1,16 @@
local function register_ore(name, block_groups)
local function register_ore(name, ingot_toggle, block_groups)
local gp = block_groups or {oddly_breakable_by_hand = 3}
minetest.register_craftitem("fl_ores:" .. name .. "_ore", {
description = name .. " ore",
inventory_image = "farlands_" .. name .. "_ore.png",
})
if ingot_toggle ~= false then
minetest.register_craftitem("fl_ores:" .. name .. "_ingot", {
description = name .. " ingot",
inventory_image = "farlands_" .. name .. "_ingot.png",
})
end
minetest.register_node("fl_ores:" .. name .. "_block", {
description = name .. " block",
tiles = {"farlands_" .. name .. "_block.png"},
@ -18,7 +24,8 @@ local function register_ore(name, block_groups)
"stone",
"ors",
"tuff",
"desert_stone"
"desert_stone",
"savannah"
}
for _, bm in pairs(base_material) do
local sgp = table.copy(minetest.registered_nodes["fl_stone:" .. bm]["groups"])
@ -35,17 +42,25 @@ local function register_ore(name, block_groups)
end
end
register_ore("mithite")
register_ore("coal")
register_ore("iron")
register_ore("gold")
register_ore("diamond")
register_ore("copper")
--replace gold, dia? block textures
--what to do with oher ore blocks?
--deal with iron being on stone background
--change mithire ore overlay
register_ore("coal", false)
register_ore("iron")
register_ore("copper")
register_ore("tin")
register_ore("gold")
register_ore("diamond", false)
register_ore("mithite", false)
--bronze block+ingot
minetest.register_craftitem("fl_ores:bronze_ingot", {
description = "bronze ingot",
inventory_image = "farlands_bronze_ingot.png"
})
minetest.register_node("fl_ores:bronze_block", {
description = "bronze block",
tiles = {"farlands_bronze_block.png"},
groups = {oddly_breakable_by_hand = 3},
})
--crafts
minetest.register_craft({

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B