From 0306a21fb221f5f5a0616c90e3db5964db4ba6f1 Mon Sep 17 00:00:00 2001 From: BPR02 Date: Wed, 11 Dec 2024 15:23:11 -0800 Subject: [PATCH] feat: accept links for process location --- TODO.md | 1 - beet_observer/plugin.py | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/TODO.md b/TODO.md index 721cda9..4b90fe9 100644 --- a/TODO.md +++ b/TODO.md @@ -4,4 +4,3 @@ - create more tests - allow separate dp and rp default formats - restore worldgen tests once [lectern #361](https://github.com/mcbeet/lectern/issues/361) is fixed -- allow URLs for datapack/resource pack loading diff --git a/beet_observer/plugin.py b/beet_observer/plugin.py index 257a37c..f1e2b08 100644 --- a/beet_observer/plugin.py +++ b/beet_observer/plugin.py @@ -30,12 +30,14 @@ def beet_default(ctx: Context): save.append(overlay) # loop through all overlays for overlay in ctx.meta["observer"]["overlays"]: - # create relative path - path = f"{ctx.directory}/{overlay['process']}" + # get pack + if overlay["process"].startswith("https://"): + load = overlay["process"] + else: + load = f"{ctx.directory}/{overlay['process']}" # generate context for overlay pack with run_beet( - config={"data_pack": {"load": "."}, "resource_pack": {"load": "."}}, - directory=path, + config={"data_pack": {"load": load}, "resource_pack": {"load": load}} ) as ctx_overlay: if "directory" not in overlay: dp_dir = f"overlay_{ctx_overlay.data.pack_format}"