beet-observer 0.4.0__tar.gz → 0.6.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {beet_observer-0.4.0 → beet_observer-0.6.0}/PKG-INFO +1 -1
- {beet_observer-0.4.0 → beet_observer-0.6.0}/beet_observer/__init__.py +1 -1
- {beet_observer-0.4.0 → beet_observer-0.6.0}/beet_observer/data_pack.py +5 -1
- {beet_observer-0.4.0 → beet_observer-0.6.0}/beet_observer/plugin.py +12 -6
- {beet_observer-0.4.0 → beet_observer-0.6.0}/beet_observer/resource_pack.py +5 -1
- {beet_observer-0.4.0 → beet_observer-0.6.0}/pyproject.toml +2 -1
- {beet_observer-0.4.0 → beet_observer-0.6.0}/LICENSE +0 -0
- {beet_observer-0.4.0 → beet_observer-0.6.0}/README.md +0 -0
@@ -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)
|
@@ -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)
|
@@ -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)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "beet-observer"
|
3
|
-
version = "0.
|
3
|
+
version = "0.6.0"
|
4
4
|
description = "A beet plugin to automatically generate overlays from previous datapacks"
|
5
5
|
authors = ["BPR02 <dev@bpr02.com>"]
|
6
6
|
license = "MIT"
|
@@ -38,6 +38,7 @@ typeCheckingMode = "strict"
|
|
38
38
|
[tool.poe.tasks]
|
39
39
|
format = {shell = "isort beet_observer & black beet_observer"}
|
40
40
|
check = {shell = "isort --check-only beet_observer & black --check beet_observer"}
|
41
|
+
typing = {shell = "pyright"}
|
41
42
|
|
42
43
|
[build-system]
|
43
44
|
requires = ["poetry-core"]
|
File without changes
|
File without changes
|