Skip to content

Commit

Permalink
Fixing crashes with QoL Crafting Tweaks mod
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwiHawk committed Dec 8, 2023
1 parent d9036ef commit b08c804
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bobplates/data-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ if settings.startup["bobmods-colorupdate"].value == true then
data.raw.item["battery"].icon = "__bobplates__/graphics/icons/battery-red.png"
data.raw.item["battery"].icon_size = 64
data.raw.item["battery"].icon_mipmaps = nil
data.raw.recipe["battery"].crafting_machine_tint = data.raw.recipe["battery"].crafting_machine_tint or {}
data.raw.recipe["battery"].crafting_machine_tint.primary = { r = 1.0, g = 0.2, b = 0.1, a = 1.000 }

data.raw.item["lithium-ion-battery"].icon = "__bobplates__/graphics/icons/battery-blue.png"
data.raw.item["lithium-ion-battery"].icon_size = 64
data.raw.recipe["lithium-ion-battery"].crafting_machine_tint = data.raw.recipe["lithium-ion-battery"].crafting_machine_tint or {}
data.raw.recipe["lithium-ion-battery"].crafting_machine_tint.primary = { r = 0.1, g = 0.5, b = 1.0, a = 1.000 }

data.raw.item["silver-zinc-battery"].icon = "__bobplates__/graphics/icons/battery-purple.png"
data.raw.item["silver-zinc-battery"].icon_size = 64
data.raw.recipe["silver-zinc-battery"].crafting_machine_tint = data.raw.recipe["silver-zinc-battery"].crafting_machine_tint or {}
data.raw.recipe["silver-zinc-battery"].crafting_machine_tint.primary = { r = 0.7, g = 0.9, b = 1.0, a = 1.000 }
else
data.raw.item["battery"].icon = "__bobplates__/graphics/icons/battery.png"
Expand Down Expand Up @@ -114,10 +117,15 @@ end

if settings.startup["bobmods-plates-batteryupdate"].value == true then
data.raw.technology["battery"].prerequisites = { "sulfur-processing", "plastics" }
data.raw.recipe["battery"].normal.ingredients =
{ { "lead-plate", 2 }, { type = "fluid", name = "sulfuric-acid", amount = 20 }, { "plastic-bar", 1 } }
data.raw.recipe["battery"].expensive.ingredients =
{ { "lead-plate", 2 }, { type = "fluid", name = "sulfuric-acid", amount = 40 }, { "plastic-bar", 2 } }
bobmods.lib.recipe.clear_ingredients("battery")

bobmods.lib.recipe.add_difficulty_ingredient("battery", "normal", { "lead-plate", 2 })
bobmods.lib.recipe.add_difficulty_ingredient("battery", "normal", { type = "fluid", name = "sulfuric-acid", amount = 20 })
bobmods.lib.recipe.add_difficulty_ingredient("battery", "normal", { "plastic-bar", 1 })

bobmods.lib.recipe.add_difficulty_ingredient("battery", "expensive", { "lead-plate", 2 })
bobmods.lib.recipe.add_difficulty_ingredient("battery", "expensive", { type = "fluid", name = "sulfuric-acid", amount = 40 })
bobmods.lib.recipe.add_difficulty_ingredient("battery", "expensive", { "plastic-bar", 2 })
end

data.raw.recipe["steel-plate"].category = "chemical-furnace"
Expand Down
1 change: 1 addition & 0 deletions bobplates/prototypes/recipe/nuclear-recipe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ else
end

if settings.startup["bobmods-plates-bluedeuterium"].value == true then
data.raw.recipe["deuterium-fuel-reprocessing"].crafting_machine_tint = data.raw.recipe["deuterium-fuel-reprocessing"].crafting_machine_tint or {}
data.raw.recipe["deuterium-fuel-reprocessing"].crafting_machine_tint.primary = { r = 0, g = 0.7, b = 1 }
data.raw.recipe["deuterium-fuel-reprocessing"].crafting_machine_tint.tertiary = { r = 0, g = 0.7, b = 1 }
if settings.startup["bobmods-plates-nuclearupdate"].value == true then
Expand Down

0 comments on commit b08c804

Please sign in to comment.