carbon, se fix

This commit is contained in:
Brevven 2021-12-28 01:54:30 -08:00
parent 68b5b93438
commit a04aa198b2
5 changed files with 39 additions and 4 deletions

View file

@ -1,4 +1,10 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 0.4.2
Date: 2021-12-31
Changes:
- SE Void probe recipe
- Graphite compatibility
---------------------------------------------------------------------------------------------------
Version: 0.4.1 Version: 0.4.1
Date: 2021-12-05 Date: 2021-12-05
Changes: Changes:

View file

@ -109,7 +109,7 @@ end
-- Add a given quantity of product to a given recipe. -- Add a given quantity of product to a given recipe.
-- Only works for recipes with multiple products -- Only works for recipes with multiple products
function util.add_product(recipe_name, product) function util.add_product(recipe_name, product)
if data.raw.recipe[recipe_name] and data.raw.item[product] then if data.raw.recipe[recipe_name] and (data.raw.item[product[1]] or data.raw.item[product.name]) then
add_product(data.raw.recipe[recipe_name], product) add_product(data.raw.recipe[recipe_name], product)
add_product(data.raw.recipe[recipe_name].normal, product) add_product(data.raw.recipe[recipe_name].normal, product)
add_product(data.raw.recipe[recipe_name].expensive, product) add_product(data.raw.recipe[recipe_name].expensive, product)
@ -274,6 +274,31 @@ function has_ingredient(recipe, ingredient)
return false return false
end end
-- Remove a product from a recipe, WILL NOT remove the only product
function util.remove_product(recipe_name, old)
if me.bypass[recipe_name] then return end
if data.raw.recipe[recipe_name] then
remove_product(data.raw.recipe[recipe_name], old)
remove_product(data.raw.recipe[recipe_name].normal, old)
remove_product(data.raw.recipe[recipe_name].expensive, old)
end
end
function remove_product(recipe, old)
index = -1
if recipe ~= nil and recipe.results ~= nil then
for i, result in pairs(recipe.results) do
if result.name == old or result[1] == old then
index = i
break
end
end
if index > -1 then
table.remove(recipe.results, index)
end
end
end
-- Replace one product with another in a recipe -- Replace one product with another in a recipe
function util.replace_product(recipe_name, old, new) function util.replace_product(recipe_name, old, new)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then

View file

@ -1,5 +1,5 @@
{ "name": "bztungsten", { "name": "bztungsten",
"version": "0.4.1", "version": "0.4.2",
"factorio_version": "1.1", "factorio_version": "1.1",
"title": "Tungsten", "title": "Tungsten",
"author": "Brevven", "author": "Brevven",
@ -13,6 +13,6 @@
"? DeadlockCrating", "? DeadlockCrating",
"? bzlead" "? bzlead"
], ],
"description": "Adds tungsten ore (wolframite), tungsten plates, tungsten carbide and rocket engine nozzles to the base game.\n\nAvailable after green science, tungsten and the various intermediates are used throughout the vanilla game.\nClampompatible with RSO, Space Exploration and Krastorio 2, and several other mods. Part of BZ Mods." "description": "Adds tungsten ore (wolframite), tungsten plates, tungsten carbide and rocket engine nozzles to the base game.\n\nCompatible with RSO, Space Exploration, Krastorio 2, and several other mods. Part of BZ Mods."
} }

View file

@ -164,6 +164,7 @@ if mods["space-exploration"] then
util.add_ingredient("se-spaceship-rocket-engine", "rocket-engine-nozzle", 4) util.add_ingredient("se-spaceship-rocket-engine", "rocket-engine-nozzle", 4)
util.add_ingredient("se-cargo-rocket-section", "rocket-engine-nozzle", 5) util.add_ingredient("se-cargo-rocket-section", "rocket-engine-nozzle", 5)
util.add_ingredient("se-cargo-rocket-section-beryllium", "rocket-engine-nozzle", 5) util.add_ingredient("se-cargo-rocket-section-beryllium", "rocket-engine-nozzle", 5)
util.add_ingredient("se-void-probe", "rocket-engine-nozzle", 1)
--Tooling --Tooling
util.add_ingredient("se-space-assembling-machine", "tungsten-carbide", 8) util.add_ingredient("se-space-assembling-machine", "tungsten-carbide", 8)
@ -271,7 +272,7 @@ if mods["zombiesextended-core"] then
util.add_ingredient("heat-pipe-mk1", "tungsten-plate", 1) util.add_ingredient("heat-pipe-mk1", "tungsten-plate", 1)
end end
util.add_ingredient("electric-mining-drill-mk2", "tungsten-carbide", tcamount) util.add_ingredient("electric-mining-drill-mk2", "tungsten-carbide", tcamount)
util.add_ingredient("edrill-1to2", "tungsten-carbide", 10) util.add_ingredient("edrill-1to2", "tungsten-carbide", tcamount)
util.add_ingredient("electric-mining-drill-mk3", "tungsten-carbide", tcamount) util.add_ingredient("electric-mining-drill-mk3", "tungsten-carbide", tcamount)
util.add_ingredient("electric-mining-drill-mk4", "tungsten-carbide", tcamount) util.add_ingredient("electric-mining-drill-mk4", "tungsten-carbide", tcamount)
util.add_ingredient("electric-mining-drill-mk5", "tungsten-carbide", tcamount) util.add_ingredient("electric-mining-drill-mk5", "tungsten-carbide", tcamount)

View file

@ -173,6 +173,9 @@ local nozzle_i = {{"tungsten-plate", 2}}
if mods.bzzirconium then if mods.bzzirconium then
table.insert(nozzle_i, {"zirconium-plate", 1}) table.insert(nozzle_i, {"zirconium-plate", 1})
end end
if mods.bzcarbon then
table.insert(nozzle_i, {"graphite", 1})
end
data:extend({ data:extend({
{ {