change configuration to json files

master
ademant 2019-07-15 12:15:07 +02:00
parent ce5878cafa
commit 6dddfa34db
43 changed files with 749 additions and 46 deletions

View File

@ -0,0 +1,17 @@
{"clust_size":3,
"color":"AA2435D0",
"crack":5,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_metall":6},
"lump_cooking_time":58,
"name":"adamantite",
"num_ores":4,
"scarcity":14,
"tier":6,
"y_max":-2300,
"y_min":-31000}

View File

@ -0,0 +1,13 @@
{"clust_size":1,
"crack":4,
"groups":{"has_block":1,
"has_brick":3,
"is_lump_gemstone":1,
"is_mineral":5},
"name":"amethyst",
"num_ores":1,
"scarcity":15,
"stackmax":"200",
"tier":5,
"y_max":-650,
"y_min":-31000}

View File

@ -0,0 +1,13 @@
{"clust_size":1,
"crack":5,
"groups":{"has_block":1,
"has_brick":3,
"is_gemstone":1,
"is_lump_gemstone":1},
"name":"aquamarine",
"num_ores":1,
"scarcity":16,
"stackmax":"200",
"tier":6,
"y_max":-1700,
"y_min":-31000}

View File

@ -0,0 +1,9 @@
{"clust_size":3,
"crack":4,
"groups":{"has_lump":1},
"name":"bituminous_coal",
"num_ores":10,
"scarcity":13,
"tier":5,
"y_max":-500,
"y_min":-31000}

View File

@ -0,0 +1,5 @@
{"color":"baa52c",
"groups":{"has_bar_block":3,
"has_block":3,
"has_brick":3},
"name":"brass"}

View File

@ -0,0 +1,20 @@
{"clust_size":2,
"color":"87A9AFD0",
"crack":2,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_brick":3,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_metall":1},
"lump_cooking_time":2,
"name":"calcium",
"num_ores":5,
"scarcity":12,
"tier":1,
"y_max":420,
"y_min":-31000}

View File

@ -0,0 +1,33 @@
{"clust_size":3,
"color":"3F7390D0",
"crack":4,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_boots":1,
"has_bow":1,
"has_brick":3,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":3,
"has_pick":1,
"has_shield":1,
"has_shovel":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":5},
"lump_cooking_time":32,
"name":"cobalt",
"num_ores":3,
"scarcity":15,
"tier":5,
"tool_cotton":"steel_wire",
"tool_stick":"minerdream:steelstick",
"y_max":-500,
"y_min":-31000}

View File

@ -0,0 +1,8 @@
{"groups":{"has_bar_block":3,
"has_bow":1,
"has_brick":3,
"has_nugget":3,
"is_metall":2},
"name":"copper",
"orig_mod":"default",
"tier":2}

View File

@ -0,0 +1,6 @@
{"groups":{"has_bow":1,
"has_nugget":3,
"has_spear":1,
"is_metall":3},
"name":"diamond",
"tier":3}

View File

@ -0,0 +1,13 @@
{"groups":{"has_axe":1,
"has_boots":1,
"has_chestplate":1,
"has_helmet":1,
"has_leggings":1,
"has_pick":1,
"has_shield":1,
"has_shovel":1,
"has_spear":1,
"has_sword":1},
"name":"flint",
"orig_mod":"default",
"tier":1}

View File

@ -0,0 +1,13 @@
{"clust_size":1,
"crack":4,
"groups":{"has_block":1,
"has_brick":3,
"is_lump_gemstone":1,
"is_mineral":5},
"name":"garnet",
"num_ores":1,
"scarcity":15,
"stackmax":"200",
"tier":5,
"y_max":-650,
"y_min":-31000}

View File

@ -0,0 +1,9 @@
{"groups":{"has_bar_block":3,
"has_bow":1,
"has_brick":3,
"has_nugget":3,
"has_spear":1,
"is_metall":3},
"name":"gold",
"orig_mod":"default",
"tier":3}

View File

@ -0,0 +1,5 @@
{"groups":{"has_nugget":3,
"is_metall":2},
"name":"iron",
"orig_mod":"default",
"tier":2}

View File

@ -0,0 +1,13 @@
{"clust_size":1,
"crack":4,
"groups":{"has_block":1,
"has_brick":3,
"is_lump_gemstone":1,
"is_mineral":5},
"name":"jade",
"num_ores":1,
"scarcity":15,
"stackmax":"200",
"tier":5,
"y_max":-650,
"y_min":-31000}

View File

@ -0,0 +1,10 @@
{"crack":3,
"groups":{"has_block":3,
"has_brick":3,
"has_lump":1,
"in_desert":1,
"is_lump_gemstone":1,
"is_mineral":2},
"name":"lapislazuli",
"stackmax":"200",
"tier":2}

View File

@ -0,0 +1,32 @@
{"clust_size":3,
"color":"2f3743D0",
"crack":2,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_boots":1,
"has_bow":1,
"has_brick":3,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":5,
"has_pick":1,
"has_shield":1,
"has_shovel":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":3},
"lump_cooking_time":4,
"name":"lead",
"num_ores":7,
"overrides":"technic:mineral_lead",
"scarcity":13,
"tier":3,
"y_max":-70,
"y_min":-31000}

View File

@ -0,0 +1,18 @@
{"clust_size":3,
"color":"c4b16ed0",
"crack":1,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_block":1,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_metall":2},
"lump_cooking_time":5,
"name":"lithium",
"num_ores":5,
"scarcity":14,
"tier":2,
"y_max":-100,
"y_min":-31000}

View File

@ -0,0 +1,4 @@
{"groups":{"has_bow":1,
"has_spear":1},
"name":"mese",
"tier":3}

View File

@ -0,0 +1,18 @@
{"clust_size":5,
"color":"33ad30d0",
"crack":2,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_metall":3},
"lump_cooking_time":5,
"name":"mithril",
"num_ores":1,
"overrides":"moreores:mineral_mithril",
"scarcity":14,
"tier":3,
"y_max":-512,
"y_min":-31000}

View File

@ -0,0 +1,31 @@
{"clust_size":3,
"color":"A5AA8CD0",
"crack":2,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_boots":1,
"has_bow":1,
"has_brick":3,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":2,
"has_pick":1,
"has_shield":1,
"has_shovel":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":2},
"lump_cooking_time":4,
"name":"nickel",
"num_ores":7,
"scarcity":13,
"tier":2,
"y_max":-40,
"y_min":-31000}

View File

@ -0,0 +1,13 @@
{"clust_size":1,
"crack":5,
"groups":{"has_block":1,
"has_brick":3,
"is_lump_gemstone":1,
"is_mineral":6},
"name":"onyx",
"num_ores":1,
"scarcity":16,
"stackmax":"200",
"tier":6,
"y_max":-1700,
"y_min":-31000}

View File

@ -0,0 +1,29 @@
{"clust_size":3,
"color":"903F86D0",
"crack":6,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_block":1,
"has_boots":1,
"has_brick":1,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":3,
"has_pick":1,
"has_shield":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":8},
"lump_cooking_time":86,
"name":"orichalcum",
"num_ores":3,
"scarcity":17,
"tier":8,
"tool_stick":"minerdream:expensivestick",
"y_max":-6500,
"y_min":-31000}

View File

@ -0,0 +1,29 @@
{"clust_size":3,
"color":"1D4144D0",
"crack":6,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_block":1,
"has_boots":1,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":3,
"has_pick":1,
"has_shield":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":7},
"lump_cooking_time":64,
"name":"osmium",
"num_ores":3,
"scarcity":16,
"tier":7,
"tool_cotton":"steel_wire",
"tool_stick":"minerdream:expensivestick",
"y_max":-2500,
"y_min":-31000}

View File

@ -0,0 +1,27 @@
{"clust_size":4,
"color":"AC976FD0",
"crack":5,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_block":1,
"has_boots":1,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":3,
"has_pick":1,
"has_shield":1,
"has_sword":1,
"in_desert":1,
"is_metall":6},
"lump_cooking_time":58,
"name":"palladium",
"num_ores":5,
"scarcity":14,
"tier":6,
"tool_stick":"minerdream:expensivestick",
"y_max":-3700,
"y_min":-31000}

View File

@ -0,0 +1,31 @@
{"clust_size":3,
"color":"A5B49DD0",
"crack":1,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_boots":1,
"has_bow":1,
"has_brick":3,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":3,
"has_pick":1,
"has_shield":1,
"has_shovel":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":4},
"lump_cooking_time":16,
"name":"platinum",
"num_ores":4,
"scarcity":14,
"tier":4,
"y_max":-300,
"y_min":-31000}

View File

@ -0,0 +1,21 @@
{"clust_size":3,
"color":"9b9b9bD0",
"crack":3,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_bow":1,
"has_brick":3,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_mineral":1},
"lump_cooking_time":2,
"name":"potassium",
"num_ores":7,
"scarcity":12,
"tier":1,
"y_max":420,
"y_min":-31000}

View File

@ -0,0 +1,29 @@
{"clust_size":3,
"color":"D95000D0",
"crack":6,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_block":1,
"has_boots":1,
"has_brick":1,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":3,
"has_pick":1,
"has_shield":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":7},
"lump_cooking_time":72,
"name":"rarium",
"num_ores":2,
"scarcity":16,
"tier":7,
"tool_stick":"minerdream:expensivestick",
"y_max":-5000,
"y_min":-31000}

View File

@ -0,0 +1,32 @@
{"clust_size":3,
"color":"A4987DD0",
"crack":5,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_boots":1,
"has_bow":1,
"has_brick":3,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":3,
"has_pick":1,
"has_shield":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":6},
"lump_cooking_time":64,
"name":"rhodium",
"num_ores":3,
"scarcity":16,
"tier":6,
"tool_cotton":"steel_wire",
"tool_stick":"minerdream:expensivestick",
"y_max":-1500,
"y_min":-31000}

View File

@ -0,0 +1,33 @@
{"clust_size":3,
"color":"835749D0",
"crack":4,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_boots":1,
"has_bow":1,
"has_brick":3,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":3,
"has_pick":1,
"has_shield":1,
"has_shovel":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":5},
"lump_cooking_time":32,
"name":"ruthenium",
"num_ores":3,
"scarcity":15,
"tier":5,
"tool_cotton":"steel_wire",
"tool_stick":"minerdream:steelstick",
"y_max":-500,
"y_min":-31000}

View File

@ -0,0 +1,16 @@
{"clust_size":2,
"color":"FFC90ED0",
"crack":3,
"groups":{"drop_as_lump":1,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_mineral":2},
"name":"saltpeter",
"num_ores":5,
"scarcity":15,
"stackmax":"200",
"tier":2,
"y_max":420,
"y_min":-31000}

View File

@ -0,0 +1,23 @@
{"clust_size":2,
"color":"A9BEC2D0",
"crack":2,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_bow":1,
"has_brick":3,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"has_spear":1,
"in_desert":1,
"is_metall":3},
"lump_cooking_time":8,
"name":"silver",
"num_ores":3,
"overrides":"moreores:mineral_silver",
"scarcity":14,
"tier":3,
"y_max":-64,
"y_min":-31000}

View File

@ -0,0 +1,13 @@
{"clust_size":1,
"crack":5,
"groups":{"has_block":1,
"has_brick":3,
"is_lump_gemstone":1,
"is_mineral":6},
"name":"spinel",
"num_ores":1,
"scarcity":16,
"stackmax":"200",
"tier":6,
"y_max":-1700,
"y_min":-31000}

View File

@ -0,0 +1,14 @@
{"groups":{"has_axe":1,
"has_boots":1,
"has_bow":1,
"has_chestplate":1,
"has_helmet":1,
"has_leggings":1,
"has_pick":1,
"has_shield":1,
"has_shovel":1,
"has_spear":1,
"has_sword":1,
"is_metall":2},
"name":"stainlesssteel",
"tier":2}

View File

@ -0,0 +1,7 @@
{"groups":{"has_bar_block":3,
"has_bow":1,
"has_spear":1,
"is_metall":2},
"name":"steel",
"orig_mod":"default",
"tier":2}

View File

@ -0,0 +1,10 @@
{"color":"E89700D0",
"crack":3,
"groups":{"drop_as_lump":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_mineral":2},
"name":"sulfur",
"overrides":"technic:mineral_sulfur",
"tier":2}

View File

@ -0,0 +1,32 @@
{"clust_size":3,
"color":"594967D0",
"crack":5,
"groups":{"drop_as_lump":1,
"has_axe":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_boots":1,
"has_bow":1,
"has_brick":3,
"has_chestplate":1,
"has_dust":1,
"has_helmet":1,
"has_leggings":1,
"has_lump":1,
"has_nugget":3,
"has_pick":1,
"has_shield":1,
"has_spear":1,
"has_sword":1,
"in_desert":1,
"is_metall":6},
"lump_cooking_time":64,
"name":"tantalum",
"num_ores":3,
"scarcity":16,
"tier":6,
"tool_cotton":"steel_wire",
"tool_stick":"minerdream:expensivestick",
"y_max":-1500,
"y_min":-31000}

View File

@ -0,0 +1,7 @@
{"groups":{"has_bar_block":3,
"has_brick":3,
"has_nugget":3,
"is_metall":2},
"name":"tin",
"orig_mod":"technic",
"tier":2}

View File

@ -0,0 +1,18 @@
{"clust_size":5,
"color":"a82f32d0",
"crack":1,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_block":1,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_metall":4},
"lump_cooking_time":8,
"name":"titanium",
"num_ores":3,
"scarcity":14,
"tier":4,
"y_max":-225,
"y_min":-31000}

View File

@ -0,0 +1,13 @@
{"clust_size":1,
"crack":5,
"groups":{"has_block":1,
"has_brick":3,
"is_gemstone":1,
"is_lump_gemstone":1},
"name":"topaz",
"num_ores":1,
"scarcity":15,
"stackmax":"200",
"tier":6,
"y_max":-1700,
"y_min":-31000}

View File

@ -0,0 +1,17 @@
{"clust_size":4,
"color":"7C9871D0",
"crack":4,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_metall":5},
"lump_cooking_time":42,
"name":"tungsten",
"num_ores":4,
"scarcity":14,
"tier":5,
"y_max":-750,
"y_min":-31000}

View File

@ -0,0 +1,17 @@
{"clust_size":3,
"color":"0B2108C0",
"crack":6,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_metall":8},
"lump_cooking_time":96,
"name":"unobtanium",
"num_ores":3,
"scarcity":17,
"tier":8,
"y_max":-8700,
"y_min":-31000}

View File

@ -0,0 +1,22 @@
{"clust_size":3,
"color":"ADAD8ED0",
"crack":1,
"groups":{"drop_as_lump":1,
"has_bar":1,
"has_bar_block":3,
"has_block":1,
"has_bow":1,
"has_brick":3,
"has_dust":1,
"has_lump":1,
"has_nugget":3,
"in_desert":1,
"is_metall":2},
"lump_cooking_time":4,
"name":"zinc",
"num_ores":7,
"overrides":"technic:mineral_zinc",
"scarcity":14,
"tier":2,
"y_max":-50,
"y_min":-31000}

View File

@ -4,51 +4,11 @@ local has_value = basic_functions.has_value
local tier_cols={
col_num={"name"},}
local tier_definition = basic_functions.import_csv(minerdream.path.."/tiers.txt",tier_cols)
local ore_cols={
col_num={"crack","scarcity","num_ores","clust_size","y_min","y_max","tier","lump_cooking_time"},
groups_num={"has_dust","has_block","in_desert","has_block","has_brick","is_metall","is_mineral",
"has_bar","has_lump","has_bar_block","has_dust","has_spear","has_bow","has_arrow","has_pick",
"has_axe","has_shovel","has_sword","has_helmet","has_chestplate","has_shield","has_leggings",
"has_boots","drop_as_lump","is_gemstone","is_lump_gemstone","has_no_drop","has_no_lump","has_nugget",
"in_desertstone"}}
local miner_definition = basic_functions.import_csv(minerdream.path.."/ores.txt",ore_cols)
if miner_definition["default"] ~= nil then
default_ore = miner_definition["default"]
local test_values = {}
-- check, which numeric columns exist in default entry
for i,d in pairs(ore_cols.col_num) do
if default_ore[d] ~= nil then
table.insert(test_values,1,d)
end
end
-- check for each ore, if value can be copied from default entry
for i,tdef in pairs(miner_definition) do
if tdef.name ~= default_ore.name then
for j,colu in pairs(test_values) do
if tdef[colu] == nil then
miner_definition[tdef.name][colu] = default_ore[colu]
end
end
end
end
local ore_configs=minetest.get_dir_list(minerdream.path..'/config')
for i,oc in pairs(ore_configs) do
ore=string.split(oc,'.')[1]
local inconfig=basic_functions.read_file(minerdream.path..'/config/'..oc)
local json_conf=minetest.parse_json(inconfig)
minerdream.register_ore(ore,json_conf)
end
for i,tdef in pairs(miner_definition) do
local is_enabled = true
if tdef.disabled_by_mod ~= nil then
if basic_functions.has_value(minetest.get_modnames(),tdef.disabled_by_mod) then
is_enabled=false
end
end
if (i ~= "default") and (is_enabled) then
local starttime=os.clock()
minerdream.register_ore(i,tdef)
print("minerdream registering "..i.." in "..(math.floor(1000000*(os.clock()-starttime))/1000).." milliseconds")
else
print("minerdream: "..i.." not enabled")
end
end