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 CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = "0.4.0"
1
+ __version__ = "0.6.0"
2
2
 
3
3
  from .plugin import *
@@ -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(ctx: Context, ctx_overlay: Context, overlay_dir: str) -> None:
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
- # create relative path
30
- path = f"{ctx.directory}/{overlay['process']}"
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": "."}, "resource_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(ctx: Context, ctx_overlay: Context, overlay_dir: str) -> None:
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
  Metadata-Version: 2.1
2
2
  Name: beet-observer
3
- Version: 0.4.0
3
+ Version: 0.6.0
4
4
  Summary: A beet plugin to automatically generate overlays from previous datapacks
5
5
  License: MIT
6
6
  Author: BPR02
@@ -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,,