Skip to content

Commit 7fb09e7

Browse files
committed
feat: merge overlays from target pack
1 parent 9e7c7e5 commit 7fb09e7

File tree

13 files changed

+156
-1
lines changed

13 files changed

+156
-1
lines changed

TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
## TODO:
2-
- merge nested overlays (overlays in the target pack)
32
- create more tests
43
- allow separate dp and rp default formats
54
- restore worldgen tests once [lectern #361](https://github.com/mcbeet/lectern/issues/361) is fixed

beet_observer/data_pack.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ def gen_dp_overlays(
110110
for registry, registry_overlay in file_types:
111111
check_registry(ctx, ctx_overlay, overlay_dir, registry, registry_overlay)
112112

113+
# add current overlays to pack
114+
ctx.data.overlays.merge(ctx_overlay.data.overlays)
115+
113116
# get pack.mcmeta overlay entries
114117
mcmeta: dict[str, dict[str, list[dict[str, Any]]]] = ctx.data.mcmeta.data.copy()
115118
if "overlays" not in mcmeta:

beet_observer/resource_pack.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ def gen_rp_overlays(
3838
for registry, registry_overlay in file_types:
3939
check_registry(ctx, ctx_overlay, overlay_dir, registry, registry_overlay)
4040

41+
# add current overlays to pack
42+
ctx.assets.overlays.merge(ctx_overlay.assets.overlays)
43+
4144
# get pack.mcmeta overlay entries
4245
mcmeta: dict[str, dict[str, list[dict[str, Any]]]] = ctx.assets.mcmeta.data.copy()
4346
if "overlays" not in mcmeta:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
data_pack:
2+
load: src
3+
pack_format: 57
4+
supported_formats: [48,57]
5+
overlays:
6+
- formats:
7+
min_inclusive: 47
8+
max_inclusive: 47
9+
directory: overlay_47
10+
11+
resource_pack:
12+
load: src
13+
pack_format: 57
14+
supported_formats: [48,57]
15+
overlays:
16+
- formats:
17+
min_inclusive: 47
18+
max_inclusive: 47
19+
directory: overlay_47
20+
21+
pipeline:
22+
- beet_observer
23+
24+
meta:
25+
observer:
26+
overlays:
27+
- process: proc
669 Bytes
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
say this only exists in the overlay
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
say this is the same in both
971 Bytes
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
say this is in an overlay that exists already
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"pack": {
3+
"pack_format": 48,
4+
"description": ""
5+
}
6+
}

0 commit comments

Comments
 (0)