Factorio: update API use (#3760)

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
This commit is contained in:
Fabian Dill
2024-09-18 00:18:17 +02:00
committed by GitHub
parent debb936618
commit 6fac83b84c
5 changed files with 136 additions and 149 deletions

View File

@@ -13,12 +13,11 @@ import Utils
from . import Options
factorio_tech_id = factorio_base_id = 2 ** 17
# Factorio technologies are imported from a .json document in /data
source_folder = os.path.join(os.path.dirname(__file__), "data")
pool = ThreadPoolExecutor(1)
# Factorio technologies are imported from a .json document in /data
def load_json_data(data_name: str) -> Union[List[str], Dict[str, Any]]:
return orjson.loads(pkgutil.get_data(__name__, "data/" + data_name + ".json"))
@@ -99,7 +98,7 @@ class CustomTechnology(Technology):
and ((ingredients & {"chemical-science-pack", "production-science-pack", "utility-science-pack"})
or origin.name == "rocket-silo")
self.player = player
if origin.name not in world.worlds[player].special_nodes:
if origin.name not in world.special_nodes:
if military_allowed:
ingredients.add("military-science-pack")
ingredients = list(ingredients)