Skip to content

Commit

Permalink
fix: enable worldgen for data pack snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Aug 8, 2024
1 parent 51bb348 commit 699c4c3
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 1 deletion.
6 changes: 5 additions & 1 deletion beet/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Pack,
ResourcePack,
)
from beet.contrib.worldgen import worldgen
from beet.library.test_utils import ignore_name

try:
Expand All @@ -33,7 +34,10 @@ class FmtDataPack(Fmt[DataPack]):
extension = ".data_pack"

def load(self, path: Path) -> DataPack:
return ignore_name(DataPack(path=path))
data_pack = DataPack()
worldgen(data_pack)
data_pack.load(path)
return ignore_name(data_pack)

def dump(self, path: Path, value: DataPack):
value.save(path=path, overwrite=True)
Expand Down
2 changes: 2 additions & 0 deletions examples/load_worldgen/beet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data_pack:
load: "src"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"replace": false,
"values": [
"minecraft:taiga",
"minecraft:snowy_taiga",
"minecraft:old_growth_pine_taiga",
"minecraft:old_growth_spruce_taiga",
"minecraft:the_void"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"replace": false,
"values": [
"minecraft:taiga",
"minecraft:snowy_taiga",
"minecraft:old_growth_pine_taiga",
"minecraft:old_growth_spruce_taiga",
"minecraft:the_void"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 48,
"description": ""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 34,
"description": ""
}
}

0 comments on commit 699c4c3

Please sign in to comment.