pulling ores and metals out of realtest

This commit is contained in:
FaceDeer 2017-04-24 23:45:17 -06:00
parent a823edd421
commit 9421ecd3c2
131 changed files with 382 additions and 0 deletions

3
README.txt Normal file
View File

@ -0,0 +1,3 @@
According to the Wayback Machine, RealTest is licensed under the GPLv3:
https://web.archive.org/web/20140331041644/https://forum.minetest.net/viewtopic.php?id=7573
https://web.archive.org/web/20140801020023/https://forum.minetest.net/viewtopic.php?id=2671

379
init.lua Normal file
View File

@ -0,0 +1,379 @@
---------------------------------------------------------------------------------------------------
-- Metals
local metals_list = {
{[name]='bismuth', [level]=0, [desc]=S('Bismuth'),},
{[name]='zinc', [level]=0, [desc]=S('Zinc'),},
{[name]='tin', [level]=0, [desc]=S('Tin'),},
{[name]='copper', [level]=1, [desc]=S('Copper'),},
{[name]='lead', [level]=2, [desc]=S('Lead'),},
{[name]='silver', [level]=2, [desc]=S('Silver'),},
{[name]='gold', [level]=2, [desc]=S('Gold'),},
{[name]='brass', [level]=2, [desc]=S('Brass'), [recipe]={"copper","copper","copper","zinc"},},
{[name]='sterling_silver', [level]=2, [desc]=S('Sterling Silver'), [recipe]={"silver","silver","silver","copper"},},
{[name]='rose_gold', [level]=2, [desc]=S('Rose Gold'), [recipe]={"gold","gold","gold","brass"},},
{[name]='oroide', [level]=2, [desc]=S('Oroide'), [recipe]={"copper","copper","tin","zinc"},},
{[name]='black_bronze', [level]=2, [desc]=S('Black Bronze'), [recipe]={"copper","copper","gold","silver"},},
{[name]='bismuth_bronze', [level]=2, [desc]=S('Bismuth Bronze'), [recipe]={"copper","copper","bismuth","tin"},},
{[name]='tumbaga', [level]=2, [desc]=S('Tumbaga'), [recipe]={"copper","gold"},},
{[name]='bronze', [level]=2, [desc]=S('Bronze'), [recipe]={"copper","copper","copper","tin"},},
{[name]='aluminium', [level]=2, [desc]=S('Aluminium'),},
{[name]='platinum', [level]=3, [desc]=S('Platinum'),},
{[name]='pig_iron', [level]=3, [desc]=S('Pig Iron'),},
{[name]='wrought_iron', [level]=3, [desc]=S('Wrought Iron'),},
{[name]='german_silver', [level]=4, [desc]=S('German Silver'), [recipe]={"copper","copper","copper","nickel"},},
{[name]='albata', [level]=4, [desc]=S('Albata'), [recipe]={"copper","nickel","zinc","zinc"},},
{[name]='nickel', [level]=4, [desc]=S('Nickel'),},
{[name]='steel', [level]=4, [desc]=S('Steel'), [recipe]={"wrought_iron","wrought_iron","wrought_iron","pig_iron",},},
{[name]='monel', [level]=4, [desc]=S('Monel'), [recipe]={"nickel","nickel","nickel","copper"},},
{[name]='black_steel' [level]=5, [desc]=S('Black Steel'), [recipe]={"steel","steel","nickel","black_bronze"},},
}
for i, metal in pairs(metals_list) do
--
-- Craftitems
--
minetest.register_craftitem("real_minerals:"..metal.name.."_ingot", {
description = S('@1 Ingot', metal.desc),
inventory_image = "real_minerals_metal_"..metal.name.."_ingot.png",
})
if metal.recipe then
--
-- Alloy
--
local quantity = #metal.recipe
local recipe_list = {}
for _, input in pairs(metal.recipe) do
table.insert(recipe_list, "real_minerals:"..input.."_ingot")
end
minetest.register_craft({
type = "shapeless",
output = "real_minerals:"..metal.name.."_ingot "..tostring(quantity),
recipe = recipe_list,
})
end
-- minetest.register_craftitem("real_minerals:"..metal.."_lock", {
-- description = metals.desc_list[i].." Lock",
-- inventory_image = "metals_"..metal.."_lock.png",
-- groups = {lock=1}
-- })
--
-- Nodes
--
minetest.register_node("real_minerals:"..metal.name.."_block", {
description = S("Block of @1", metal.desc),
tiles = {"real_minerals_metal_"..metal.name.."_block.png"},
particle_image = {"real_minerals_metal_"..metal.name.."_block.png"},
is_ground_content = true,
groups = {snappy=1,bendy=2,cracky=2,melty=2,level=metal.level,drop_on_dig=1},
sounds = default.node_sound_metal_defaults(),
})
minetest.register_craft({
output = "real_minerals:"..metal.name.."_block",
recipe = {
{"real_minerals:"..metal.name.."_ingot", "real_minerals:"..metal.name.."_ingot", "real_minerals:"..metal.name.."_ingot",},
{"real_minerals:"..metal.name.."_ingot", "real_minerals:"..metal.name.."_ingot", "real_minerals:"..metal.name.."_ingot",},
{"real_minerals:"..metal.name.."_ingot", "real_minerals:"..metal.name.."_ingot", "real_minerals:"..metal.name.."_ingot",},
}
})
end
--
-- Smelting
--
--
--minetest.register_craftitem("real_minerals:molding_sand_lump", {
-- description = S("Molding Sand"),
-- inventory_image = "metals_molding_sand.png"
--})
--
--minetest.register_craft({
-- type = "shapeless",
-- output = "real_minerals:molding_sand_lump 5",
-- recipe = {"grounds:clay_lump", "default:sand", "default:desert_sand"}
--})
--
--minetest.register_craftitem("real_minerals:molding_sand_mold", {
-- description = S("Molding Sand Mold"),
-- inventory_image = "metals_molding_sand_mold.png",
--})
--
--minetest.register_craftitem("real_minerals:clay_mold", {
-- description = S("Clay Mold"),
-- inventory_image = "metals_clay_mold.png",
--})
--
--minetest.register_craftitem("real_minerals:ceramic_mold", {
-- description = S("Ceramic mold"),
-- inventory_image = "metals_ceramic_mold.png",
--})
--
--minetest.register_craft({
-- output = "real_minerals:molding_sand_mold 5",
-- recipe = {
-- {"real_minerals:molding_sand_lump", "", "real_minerals:molding_sand_lump"},
-- {"real_minerals:molding_sand_lump", "real_minerals:molding_sand_lump", "real_minerals:molding_sand_lump"},
-- }
--})
--
--minetest.register_craft({
-- output = "real_minerals:clay_mold 5",
-- recipe = {
-- {"grounds:clay_lump", "", "grounds:clay_lump"},
-- {"grounds:clay_lump", "grounds:clay_lump", "grounds:clay_lump"},
-- }
--})
--
--minetest.register_craft({
-- type = "cooking",
-- output = "real_minerals:ceramic_mold",
-- recipe = "real_minerals:clay_mold",
-- cooktime = 5,
--})
--
--minetest.register_craft({
-- type = "cooking",
-- output = "real_minerals:ceramic_mold",
-- recipe = "real_minerals:molding_sand_mold",
--})
-------------------------------------------------------
-- Ores
local ore_list = {
[name]="lignite", [def]={[desc]=S("Lignite"), },},
[name]="anthracite", [def]={[desc]=S("Anthracite"), },},
[name]="bituminous_coal", [def]={[desc]=S("Bituminous Coal"), },},
[name]="magnetite", [def]={[desc]=S("Magnetite"), [product]='pig_iron', },},
[name]="hematite", [def]={[desc]=S("Hematite"), [product]='pig_iron', },},
[name]="limonite", [def]={[desc]=S("Limonite"), [product]='pig_iron', },},
[name]="bismuthinite", [def]={[desc]=S("Bismuthinite"), [product]='bismuth', },},
[name]="cassiterite", [def]={[desc]=S("Cassiterite"), [product]='tin', },},
[name]="galena", [def]={[desc]=S("Galena"), [product]='lead', },},
[name]="garnierite", [def]={[desc]=S("Garnierite"), [product]='nickel' },},
[name]="malachite", [def]={[desc]=S("Malachite"), [product]='copper', },},
[name]="native_copper", [def]={[desc]=S("Native Copper"), [product]='copper', [wherein] = {"default:stone", "default:desert_stone"}, },},
[name]="native_gold", [def]={[desc]=S("Native Gold"), [product]='gold', [wherein] = {"default:stone", "default:desert_stone"}, },},
[name]="native_silver", [def]={[desc]=S("Native Silver"), [product]='silver', },},
[name]="native_platinum", [def]={[desc]=S("Native Platinum"), [product]='platinum', },},
[name]="sphalerite", [def]={[desc]=S("Sphalerite"), [product]='zinc', },},
[name]="tetrahedrite", [def]={[desc]=S("Tetrahedrite"), [product]='copper', },},
[name]="lazurite", [def]={[desc]=S("Lazurite"), },},
[name]="bauxite", [def]={[desc]=S("Bauxite"), [product]='aluminium', },},
[name]="cinnabar", [def]={[desc]=S('Cinnabar'), },},
[name]="cryolite", [def]={[desc]=S('Cryolite'), },},
[name]="graphite", [def]={[desc]=S('Graphite'), },},
[name]="gypsum", [def]={[desc]=S('Gypsum'), },},
[name]="jet", [def]={[desc]=S('Jet'), },},
[name]="kaolinite", [def]={[desc]=S('Kaolinite'), },},
[name]="kimberlite", [def]={[desc]=S('Kimberlite'), },},
[name]="olivine", [def]={[desc]=S('Olivine'), },},
[name]="petrified_wood", [def]={[desc]=S('Petrified wood'), },},
[name]="pitchblende", [def]={[desc]=S('Pitchblende'), },},
[name]="saltpeter", [def]={[desc]=S('Saltpeter'), },},
[name]="satin_spar", [def]={[desc]=S('Satin Spar'), },},
[name]="selenite", [def]={[desc]=S('Selenite'), },},
[name]="serpentine", [def]={[desc]=S('Serpentine'), },},
[name]="sylvite", [def]={[desc]=S('Sylvite'), },},
[name]="tenorite", [def]={[desc]=S('Tenorite'), },},
}
realtest.registered_ores = {}
realtest.registered_ores_list = {}
local d_seed = 0
local function copytable(t)
t2 = {}
for k,i in pairs(t) do
t2[k] = i
end
return t2
end
local function register_ore(name, OreDef)
local ore = {
name = name,
description = OreDef.description or S("Ore"),
mineral = OreDef.mineral or "minerals:"..name:remove_modname_prefix(),
wherein = OreDef.wherein or {"default:stone"},
clust_scarcity = 1/(OreDef.chunks_per_volume or 1/3/3/3/2),
clust_size = OreDef.chunk_size or 3,
clust_num_ores = OreDef.ore_per_chunk or 10,
height_min = OreDef.height_min or -30912,
height_max = OreDef.height_max or 30912,
noise_threshhold = OreDef.noise_min or 1.2,
noise_params = {offset=0, scale=1, spread={x=100, y=100, z=100}, octaves=3, persist=0.70, seed = OreDef.delta_seed or d_seed},
generate = true
}
minetest.register_craftitem("real_minerals:"..name, {
description = ore.description,
inventory_image = "real_minerals_"..name.."_mineral.png",
})
if OreDef.product then
minetest.register_craft({
type = "cooking",
output = "real_minerals:"..OreDef.product.."_ingot",
recipe = "real_minerals:"..name,
cooktime = 5,
})
end
d_seed = d_seed + 1
if OreDef.generate == false then
ore.generate = false
end
ore.particle_image = OreDef.particle_image or ore.mineral:gsub(":","_")..".png"
realtest.registered_ores[name] = ore
table.insert(realtest.registered_ores_list, name)
local name_ = name:gsub(":","_")
for i, wherein in ipairs(ore.wherein) do
local wherein_ = wherein:gsub(":","_")
local wherein_textures = {}
if minetest.registered_nodes[wherein].tiles or minetest.registered_nodes[wherein].tile_images then
for _, texture in ipairs(minetest.registered_nodes[wherein].tiles) do
table.insert(wherein_textures, texture.."^"..name_..".png")
end
else
wherein_textures = {name_..".png"}
end
minetest.register_node("real_minerals:"..name.."_in_"..wherein_, {
description = S("@1 Ore", ore.description),
tiles = wherein_textures,
particle_image = {ore.particle_image},
groups = {cracky=3,drop_on_dig=1,ore=1,dropping_like_stone=1},
drop = {
max_items = 1,
items = {
{
items = {ore.mineral.." 2"},
rarity = 2
},
{
items = {ore.mineral}
}
}
},
sounds = default.node_sound_stone_defaults()
})
if ore.generate then
local oredef = copytable(ore)
oredef.ore = name.."_in_"..wherein_
oredef.ore_type = "scatter"
oredef.wherein = wherein
minetest.register_ore(oredef)
end
end
end
for _, ore in pairs(ore_list) do
register_ore("real_minerals:"..ore.name, ore.def)
end
-----------------------------------------------------------------------------------
-- Miscellaney
local mineral_list= {
{[name]='sulfur', [desc]=S('Sulfur'), },
{[name]='charcoal', [desc]=S('Charcoal') },
{[name]='flux', [desc]=S('Flux') },
{[name]='borax', [desc]=S('Borax') },
}
for i, mineral in pairs(mineral_list) do
minetest.register_craftitem("real_minerals:"..mineral.name, {
description = mineral.desc,
inventory_image = "real_minerals_"..mineral.name.."_mineral.png",
})
end
minetest.register_node("real_minerals:sulfur_in_stone", {
description = S('Sulfur'),
tile_images = {"default_stone.png^ores_sulfur.png"},
particle_image = {"minerals_sulfur.png"},
paramtype = "light",
groups = {cracky=3,drop_on_dig=1,dig_immediate=2},
drop = {
max_items = 1,
items = {
{
items = {"minerals:sulfur 3"},
rarity = 15,
},
{
items = {"minerals:sulfur 2"},
}
}
},
})
minetest.register_node("real_minerals:peat", {
description = S("Peat"),
tile_images = {"ores_peat.png"},
particle_image = {"ores_peat.png"},
groups = {crumbly=3,drop_on_dig=1,falling_node=1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_ore({
ore_type = "scatter",
ore = "real_minerals:peat",
wherein = "default:dirt",
clust_scarcity = 20*20*20,
clust_num_ores = 343,
clust_size = 7,
height_min = -31000,
height_max = 0,
})
-------------------------------------------------
-- Fuels
minetest.register_craft({
type = "fuel",
recipe = "real_minerals:charcoal",
burntime = 20,
})
minetest.register_craft({
type = "fuel",
recipe = "real_minerals:graphite",
burntime = 20,
})
minetest.register_craft({
type = "fuel",
recipe = "real_minerals:lignite",
burntime = 25,
})
minetest.register_craft({
type = "fuel",
recipe = "real_minerals:bituminous_coal",
burntime = 35,
})
minetest.register_craft({
type = "fuel",
recipe = "real_minerals:anthracite",
burntime = 50,
})
minetest.register_craft({
type = "fuel",
recipe = "real_minerals:peat",
burntime = 15
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Some files were not shown because too many files have changed in this diff Show More