Hi again. I was also investigating the balance of gem production with Bob's Ores installed and the relevant setting enabled, and the diamond yield for the charcoal recipe does not seem to be calculated the way that you intended. The diamond-to-coal ratio is only 0.5% (instead of 1%) at default settings, but more importantly, the calculations don't actually account for the amount of coal produced nor the setting for the ratio of diamonds, and no more than 1 diamond (equal to 10%) can be produced at a time, regardless of settings.
If we look at Bob's Ores v3.0.0 in data-updates.lua line 38-44, the default 1% diamond yield for coal mining is calculated by multiplying the values from TWO settings in settings.lua: The gem chance (default: 5%, line 56) and the diamond ratio (default: 20%, line 103). For your mod to produce a similar amount and update according to both settings, you could write something like this in mod-compat\data-updates\bobores.lua, line 122+:
if settings.startup["bobmods-ores-gemsfromotherores"].value then
local wood_to_coal = data.raw.recipe["wood-to-coal"]
local coalAmount = 10
local gemChance = settings.startup["bobmods-ores-gemprobability"].value
local diamondRatio = settings.startup["bobmods-gems-diamondratio"].value
local diamondAvgOutput = gemChance * diamondRatio * coalAmount
if diamondAvgOutput > 0 and diamondAvgOutput <= 1 then
wood_to_coal.results = {
{type = "item", name = "coal", amount = coalAmount},
{type = "item", name = "bob-diamond-ore", amount = 1, independent_probability = diamondAvgOutput}
}
elseif diamondAvgOutput > 1 then
local diamond_integer = math.floor(diamondAvgOutput)
local diamond_fraction = diamondAvgOutput - diamond_integer
wood_to_coal.results = {
{type = "item", name = "coal", amount = coalAmount},
{type = "item", name = "bob-diamond-ore", amount = diamond_integer, extra_count_fraction = diamond_fraction}
}
end
-- etc.
end
There should be no issues with any of the settings or properties such as amount or extra_count_fraction having a value of 0.