beet-observer 0.4.0__py3-none-any.whl → 0.6.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beet_observer/__init__.py +1 -1
- beet_observer/data_pack.py +5 -1
- beet_observer/plugin.py +12 -6
- beet_observer/resource_pack.py +5 -1
- {beet_observer-0.4.0.dist-info → beet_observer-0.6.0.dist-info}/METADATA +1 -1
- beet_observer-0.6.0.dist-info/RECORD +8 -0
- beet_observer-0.4.0.dist-info/RECORD +0 -8
- {beet_observer-0.4.0.dist-info → beet_observer-0.6.0.dist-info}/LICENSE +0 -0
- {beet_observer-0.4.0.dist-info → beet_observer-0.6.0.dist-info}/WHEEL +0 -0
beet_observer/__init__.py
CHANGED
beet_observer/data_pack.py
CHANGED
@@ -4,7 +4,9 @@ import beet.contrib.worldgen as wg
|
|
4
4
|
from beet import Context, NamespaceProxy
|
5
5
|
|
6
6
|
|
7
|
-
def gen_dp_overlays(
|
7
|
+
def gen_dp_overlays(
|
8
|
+
ctx: Context, ctx_overlay: Context, overlay_dir: str, ignore: list[str]
|
9
|
+
) -> None:
|
8
10
|
"""
|
9
11
|
Generates overlays between two datapacks.
|
10
12
|
|
@@ -118,6 +120,8 @@ def gen_dp_overlays(ctx: Context, ctx_overlay: Context, overlay_dir: str) -> Non
|
|
118
120
|
|
119
121
|
# add overlays to pack.mcmeta
|
120
122
|
for overlay in ctx.data.overlays:
|
123
|
+
if overlay in ignore:
|
124
|
+
continue
|
121
125
|
# check if it's the top-level overlay
|
122
126
|
if overlay == ctx.meta["observer"]["default_dir_dp"]:
|
123
127
|
# delete pack.mcmeta from overlay (required for tests)
|
beet_observer/plugin.py
CHANGED
@@ -24,14 +24,20 @@ def beet_default(ctx: Context):
|
|
24
24
|
ctx.meta["observer"]["default_dir_rp"] = ctx.meta["observer"]["default_dir"][
|
25
25
|
"rp"
|
26
26
|
]
|
27
|
+
# save current overlays
|
28
|
+
save: list[str] = []
|
29
|
+
for overlay in ctx.data.overlays:
|
30
|
+
save.append(overlay)
|
27
31
|
# loop through all overlays
|
28
32
|
for overlay in ctx.meta["observer"]["overlays"]:
|
29
|
-
#
|
30
|
-
|
33
|
+
# get pack
|
34
|
+
if overlay["process"].startswith("https://"):
|
35
|
+
load = overlay["process"]
|
36
|
+
else:
|
37
|
+
load = f"{ctx.directory}/{overlay['process']}"
|
31
38
|
# generate context for overlay pack
|
32
39
|
with run_beet(
|
33
|
-
config={"data_pack": {"load":
|
34
|
-
directory=path,
|
40
|
+
config={"data_pack": {"load": load}, "resource_pack": {"load": load}}
|
35
41
|
) as ctx_overlay:
|
36
42
|
if "directory" not in overlay:
|
37
43
|
dp_dir = f"overlay_{ctx_overlay.data.pack_format}"
|
@@ -40,5 +46,5 @@ def beet_default(ctx: Context):
|
|
40
46
|
dp_dir = overlay["directory"]
|
41
47
|
rp_dir = overlay["directory"]
|
42
48
|
# compare build pack and overlay pack
|
43
|
-
gen_dp_overlays(ctx, ctx_overlay, dp_dir)
|
44
|
-
gen_rp_overlays(ctx, ctx_overlay, rp_dir)
|
49
|
+
gen_dp_overlays(ctx, ctx_overlay, dp_dir, save)
|
50
|
+
gen_rp_overlays(ctx, ctx_overlay, rp_dir, save)
|
beet_observer/resource_pack.py
CHANGED
@@ -3,7 +3,9 @@ from typing import Any
|
|
3
3
|
from beet import Context, NamespaceProxy
|
4
4
|
|
5
5
|
|
6
|
-
def gen_rp_overlays(
|
6
|
+
def gen_rp_overlays(
|
7
|
+
ctx: Context, ctx_overlay: Context, overlay_dir: str, ignore: list[str]
|
8
|
+
) -> None:
|
7
9
|
"""
|
8
10
|
Generates overlays between two resource packs.
|
9
11
|
|
@@ -46,6 +48,8 @@ def gen_rp_overlays(ctx: Context, ctx_overlay: Context, overlay_dir: str) -> Non
|
|
46
48
|
|
47
49
|
# add overlays to pack.mcmeta
|
48
50
|
for overlay in ctx.assets.overlays:
|
51
|
+
if overlay in ignore:
|
52
|
+
continue
|
49
53
|
# check if it's the top-level overlay
|
50
54
|
if overlay == ctx.meta["observer"]["default_dir_rp"]:
|
51
55
|
# delete pack.mcmeta from overlay (required for tests)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
beet_observer/__init__.py,sha256=1Bu06DCGzyW6_EOuOSqpm31Fvkl_thjvyH54vN4XjZ4,45
|
2
|
+
beet_observer/data_pack.py,sha256=QqoyQYiCBpqioaKYSUKANgd3dxJJFLGka92G3Tyz_Js,9800
|
3
|
+
beet_observer/plugin.py,sha256=YBxXXzWGGVKqJHTuYi9a3KQO6-E841OS3iHcTnKXg_s,2011
|
4
|
+
beet_observer/resource_pack.py,sha256=_a4Ubx8fO7HMnIbfQlsnYEIM_Vjo3o_QjarirqbWdkc,6233
|
5
|
+
beet_observer-0.6.0.dist-info/LICENSE,sha256=oBbP6j7sgG9darFSRZxV7iO8yPR1aZiDspSK3mcLpXI,1062
|
6
|
+
beet_observer-0.6.0.dist-info/METADATA,sha256=kgd3ISGBKRueQuQvvapeouk5auWa2FB4oldNV4vKW3w,674
|
7
|
+
beet_observer-0.6.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
8
|
+
beet_observer-0.6.0.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
beet_observer/__init__.py,sha256=N7xZKu7fP_rwtJSXJ8tHQgq_qJDbu7yWOKOXnldjr04,45
|
2
|
-
beet_observer/data_pack.py,sha256=CMTZ2DdBEIj15wC_prAQv3I-0Eptk0usTP237KuxfLk,9724
|
3
|
-
beet_observer/plugin.py,sha256=DGpWvV2q6yeJ_EyBLShigZl4dutN2yCFDKzzcCGiu8o,1808
|
4
|
-
beet_observer/resource_pack.py,sha256=9dAeZXlJrcaEiIJcPYnJhU7e0qMUqYNcxhIEhLDHUF4,6157
|
5
|
-
beet_observer-0.4.0.dist-info/LICENSE,sha256=oBbP6j7sgG9darFSRZxV7iO8yPR1aZiDspSK3mcLpXI,1062
|
6
|
-
beet_observer-0.4.0.dist-info/METADATA,sha256=B2ehMsXlmntYVO4SwaAjjJChjPumJUFMUT2a5fzSJ2k,674
|
7
|
-
beet_observer-0.4.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
8
|
-
beet_observer-0.4.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|