Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
ORES = {
{ "ores:ore_antimony", "default:stone", 16*16*16, 6, 2, -24576, -4096 },
{ "ores:ore_manganese", "default:stone", 17*17*17, 6, 2, -16384, -8192 },
{ "ores:ore_molybdenum", "default:stone", 18*18*18, 6, 2, -16384, -4096 },
}
for _, row in ipairs(ORES) do
local ore_id = row[1]
local ore_wherein = row[2]
local ore_clust_scarcity = row[3]
local ore_clust_num_ores = row[4]
local ore_clust_size = row[5]
local ore_hmin = row[6]
local ore_hmax = row[7]
minetest.register_ore({
ore_type = "scatter",
ore = ore_id,
wherein = ore_wherein,
clust_scarcity = ore_clust_scarcity,
clust_num_ores = ore_clust_num_ores,
clust_size = ore_clust_size,
height_min = ore_hmin,
height_max = ore_hmax,
})
end
Before the recent updates, it was possible to use such code without problems, but now all of a sudden this error is thrown, because someone changed something very important within the core (which should never be modified by anyone who doesn't know what they are doing with the pretty lines of code on their screen or has not used minetest long enough to understand what they are doing when they change critically important parts of the engine). Until this is fixed, you now have to convert all entries within those tables to string values, and use tonumber() at the minetest.register_ore() call in order to convert those string values back into number values.
Is anyone else experiencing this kind of problem? Or have mods simply not yet advanced far enough to iterate through a table of entries (instead of repeating minetest.register_ore() and the other registry function calls for every single registry entry, which appears to be used profusely)