Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
omnimatter ore deblocker bobs ore fix
log("omod: "..serpent.block(mods.omod.resource))
for each_ore,_ in pairs(mods.omod.resource) do
data.raw.resource[each_ore] = table.deepcopy(mods.omod.resource[each_ore])
data.raw["autoplace-control"][each_ore] = table.deepcopy(mods.omod.autoplace[each_ore])
end
for prename,pre in pairs(data.raw["map-gen-presets"]) do
if pre.basic_settings then
if pre.basic_settings.autoplace_controls then
for _,each_ore in pairs(mods.omod.resource) do
pre.basic_settings.autoplace_controls[each_ore] = table.deepcopy(mods.omod.mgps[prename][each_ore])
pre.basic_settings.autoplace_controls["infinite-"..each_ore] = table.deepcopy(mods.omod.mgps[prename]["infinite-"..each_ore])
end
end
end
end
--code added by usafphoenix to fix bob's ore-changes made within data-updates (runs after save function stores info on ores and their results) Taken from bob's ores' data-updates.lua
if mods["bobores"] then
if bobmods.ores.settings.UnsortedGemOre == true then
bobmods.lib.resource.add_result("gem-ore", {name="gem-ore"})
else
bobmods.lib.resource.add_result("gem-ore", {name="diamond-ore", probability = bobmods.gems.DiamondRatio})
bobmods.lib.resource.add_result("gem-ore", {name="emerald-ore", probability = bobmods.gems.EmeraldRatio})
bobmods.lib.resource.add_result("gem-ore", {name="amethyst-ore", probability = bobmods.gems.AmethystRatio})
bobmods.lib.resource.add_result("gem-ore", {name="ruby-ore", probability = bobmods.gems.RubyRatio})
bobmods.lib.resource.add_result("gem-ore", {name="sapphire-ore", probability = bobmods.gems.SapphireRatio})
bobmods.lib.resource.add_result("gem-ore", {name="topaz-ore", probability = bobmods.gems.TopazRatio})
end
if bobmods.ores.settings.GemsFromOtherOres == true then
bobmods.lib.resource.add_result("coal", {name="diamond-ore", probability = bobmods.ores.settings.GemProbability * bobmods.gems.DiamondRatio})
bobmods.lib.resource.add_result("quartz", {name="emerald-ore", probability = bobmods.ores.settings.GemProbability * bobmods.gems.EmeraldRatio})
bobmods.lib.resource.add_result("quartz", {name="amethyst-ore", probability = bobmods.ores.settings.GemProbability * bobmods.gems.AmethystRatio})
bobmods.lib.resource.add_result("bauxite-ore", {name="ruby-ore", probability = bobmods.ores.settings.GemProbability * bobmods.gems.RubyRatio})
bobmods.lib.resource.add_result("bauxite-ore", {name="sapphire-ore", probability = bobmods.ores.settings.GemProbability * bobmods.gems.SapphireRatio})
bobmods.lib.resource.add_result("bauxite-ore", {name="topaz-ore", probability = bobmods.ores.settings.GemProbability * bobmods.gems.TopazRatio})
end
if bobmods.ores.settings.LeadGivesNickel == true then
bobmods.lib.resource.add_result("lead-ore", {name = "nickel-ore", probability = bobmods.ores.settings.LeadNickelRatio})
end
if bobmods.ores.settings.NickelGivesCobalt == true then
if bobmods.ores.nickel.enabled then
bobmods.lib.resource.add_result("nickel-ore", {name = "cobalt-ore", probability = bobmods.ores.settings.NickelCobaltRatio})
else
if bobmods.ores.settings.LeadGivesNickel == true then
bobmods.lib.resource.add_result("lead-ore", {name = "cobalt-ore", probability = bobmods.ores.settings.LeadNickelRatio * bobmods.ores.settings.NickelCobaltRatio})
end
end
end
end
--END bob's ore fix by usafphoenix
data.raw.resource["omnite"].autoplace.coverage = data.raw.resource["omnite"].autoplace.coverage * mods.omod.settings.omnite_multi
data.raw.resource["omnite"].autoplace.richness_base = data.raw.resource["omnite"].autoplace.richness_base * mods.omod.settings.omnite_multi
data.raw.resource["omnite"].autoplace.richness_multiplier = data.raw.resource["omnite"].autoplace.richness_multiplier * mods.omod.settings.omnite_multi
log("omod: "..serpent.block(data.raw.resource))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.