Skip to content

Commit 0892e8f

Browse files
committed
migrate to uv
Also ran formatters isort and black
1 parent 87270eb commit 0892e8f

File tree

12 files changed

+1814
-1813
lines changed

12 files changed

+1814
-1813
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
__pycache__/
88
*.py[cod]
99
*$py.class
10+
.venv
1011

1112
### Beet ###
13+
.beet_cache
1214
out/

poetry.lock

Lines changed: 0 additions & 951 deletions
This file was deleted.

pyproject.toml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
[tool.poetry]
2-
name = "src"
1+
[project]
2+
name = "skyvoid"
33
version = "1.0.0"
44
description = "SkyBlock Data Packs"
5-
authors = ["BPR"]
6-
license = "MIT"
75
readme = "README.md"
6+
requires-python = ">=3.10"
7+
dependencies = [
8+
"beet >= 0.110.1",
9+
"mecha >=0.98.0",
10+
"bolt >=0.49.1",
11+
"requests >= 2.32.3",
12+
"beet-observer >= 0.7.1"
13+
]
814

9-
[tool.poetry.dependencies]
10-
python = "^3.10"
11-
beet = "^0.110.1"
12-
mecha = ">=0.98.0"
13-
bolt = ">=0.49.1"
14-
requests = "^2.32.3"
15-
beet-observer = "^0.7.1"
16-
17-
[tool.poetry.dev-dependencies]
18-
black = "^22.6.0"
19-
isort = "^5.10.1"
15+
[tool.uv]
16+
dev-dependencies = [
17+
"black >= 22.6.0, < 23.0.0",
18+
"isort >= 5.10.1, < 6.0.0",
19+
"uv >= 0.5.4",
20+
]
2021

2122
[tool.beet]
2223

@@ -25,7 +26,3 @@ typeCheckingMode = "strict"
2526

2627
[tool.isort]
2728
profile = "black"
28-
29-
[build-system]
30-
requires = ["poetry-core"]
31-
build-backend = "poetry.core.masonry.api"

src/packs/starter_islands/skyvoid_only_dirt/generate_predicate.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
radius = 3
44
height = 4
55

6+
67
def generate_predicate():
7-
predicate = []
8+
predicate = []
9+
10+
for x in range(-radius, radius + 1):
11+
for z in range(-radius, radius + 1):
12+
for y in range(height):
13+
new = {
14+
"condition": "minecraft:location_check",
15+
"offsetX": x,
16+
"offsetY": y,
17+
"offsetZ": z,
18+
"predicate": {"biomes": "minecraft:snowy_taiga"},
19+
}
20+
predicate.append(new)
821

9-
for x in range(-radius,radius+1):
10-
for z in range(-radius,radius+1):
11-
for y in range(height):
12-
new = {
13-
"condition": "minecraft:location_check",
14-
"offsetX": x,
15-
"offsetY": y,
16-
"offsetZ": z,
17-
"predicate": {
18-
"biomes": "minecraft:snowy_taiga"
19-
}
20-
}
21-
predicate.append(new)
22+
return predicate
2223

23-
return predicate
2424

2525
def beet_default(ctx: Context):
26-
ctx.data["skyvoid_only_dirt:in_snowy_taiga"] = Predicate(generate_predicate())
26+
ctx.data["skyvoid_only_dirt:in_snowy_taiga"] = Predicate(generate_predicate())

src/packs/starter_islands/skyvoid_vanilla_oneblock/generate_predicate.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@
33
radius = 2
44
height = 2
55

6+
67
def generate_predicate():
7-
predicate = []
8+
predicate = []
9+
10+
for x in range(-radius, radius + 1):
11+
for z in range(-radius, radius + 1):
12+
for y in range(height):
13+
new = {
14+
"condition": "minecraft:location_check",
15+
"offsetX": x,
16+
"offsetY": y,
17+
"offsetZ": z,
18+
"predicate": {"biomes": "minecraft:snowy_taiga"},
19+
}
20+
predicate.append(new)
821

9-
for x in range(-radius,radius+1):
10-
for z in range(-radius,radius+1):
11-
for y in range(height):
12-
new = {
13-
"condition": "minecraft:location_check",
14-
"offsetX": x,
15-
"offsetY": y,
16-
"offsetZ": z,
17-
"predicate": {
18-
"biomes": "minecraft:snowy_taiga"
19-
}
20-
}
21-
predicate.append(new)
22+
return predicate
2223

23-
return predicate
2424

2525
def beet_default(ctx: Context):
26-
ctx.data["skyvoid_vanilla_oneblock:in_snowy_taiga"] = Predicate(generate_predicate())
26+
ctx.data["skyvoid_vanilla_oneblock:in_snowy_taiga"] = Predicate(
27+
generate_predicate()
28+
)

src/plugins/bundle.py

Lines changed: 75 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,92 @@
1-
from beet import Context, DataPack
2-
from beet.contrib.worldgen import * # type: ignore
31
import os
42

3+
from beet import Context, DataPack
4+
from beet.contrib.worldgen import * # type: ignore
5+
56
all_worldgen = [
6-
Dimension,
7-
DimensionType,
8-
WorldgenBiome,
9-
WorldgenConfiguredCarver,
10-
WorldgenConfiguredFeature,
11-
WorldgenDensityFunction,
12-
WorldgenNoise,
13-
WorldgenNoiseSettings,
14-
WorldgenPlacedFeature,
15-
WorldgenProcessorList,
16-
WorldgenStructure,
17-
WorldgenStructureSet,
18-
WorldgenConfiguredSurfaceBuilder,
19-
WorldgenTemplatePool,
20-
WorldgenWorldPreset,
21-
WorldgenFlatLevelGeneratorPreset,
22-
WorldgenBiomeTag,
23-
WorldgenStructureSetTag,
24-
WorldgenStructureTag,
25-
WorldgenConfiguredCarverTag,
26-
WorldgenPlacedFeatureTag,
7+
Dimension,
8+
DimensionType,
9+
WorldgenBiome,
10+
WorldgenConfiguredCarver,
11+
WorldgenConfiguredFeature,
12+
WorldgenDensityFunction,
13+
WorldgenNoise,
14+
WorldgenNoiseSettings,
15+
WorldgenPlacedFeature,
16+
WorldgenProcessorList,
17+
WorldgenStructure,
18+
WorldgenStructureSet,
19+
WorldgenConfiguredSurfaceBuilder,
20+
WorldgenTemplatePool,
21+
WorldgenWorldPreset,
22+
WorldgenFlatLevelGeneratorPreset,
23+
WorldgenBiomeTag,
24+
WorldgenStructureSetTag,
25+
WorldgenStructureTag,
26+
WorldgenConfiguredCarverTag,
27+
WorldgenPlacedFeatureTag,
2728
]
2829

30+
2931
def standard_skyblock(ctx: Context):
30-
island_path = ""
31-
generation_path = ""
32-
extra_path = ""
33-
for filename in os.listdir("build"):
34-
f = os.path.join("build", filename)
35-
# checking if it is a file
36-
if "skyvoid_island_standard_v" in f:
37-
island_path = f
38-
elif "skyvoid_worldgen_v" in f:
39-
generation_path = f
40-
elif "skyvoid_sand_island_v" in f:
41-
extra_path = f
32+
island_path = ""
33+
generation_path = ""
34+
extra_path = ""
35+
for filename in os.listdir("build"):
36+
f = os.path.join("build", filename)
37+
# checking if it is a file
38+
if "skyvoid_island_standard_v" in f:
39+
island_path = f
40+
elif "skyvoid_worldgen_v" in f:
41+
generation_path = f
42+
elif "skyvoid_sand_island_v" in f:
43+
extra_path = f
44+
45+
island = DataPack(path=island_path, extend_namespace=all_worldgen)
46+
generation = DataPack(path=generation_path, extend_namespace=all_worldgen)
47+
extra = DataPack(path=extra_path, extend_namespace=all_worldgen)
4248

43-
island = DataPack(path=island_path,extend_namespace=all_worldgen)
44-
generation = DataPack(path=generation_path,extend_namespace=all_worldgen)
45-
extra = DataPack(path=extra_path,extend_namespace=all_worldgen)
49+
ctx.data.merge(generation)
50+
ctx.data.merge(extra)
51+
ctx.data.merge(island)
4652

47-
ctx.data.merge(generation)
48-
ctx.data.merge(extra)
49-
ctx.data.merge(island)
5053

5154
def vanilla_oneblock(ctx: Context):
52-
island_path = ""
53-
generation_path = ""
54-
extra_path = ""
55-
for filename in os.listdir("build"):
56-
f = os.path.join("build", filename)
57-
# checking if it is a file
58-
if "skyvoid_island_oneblock_v" in f:
59-
island_path = f
60-
elif "skyvoid_worldgen_single_lava_v" in f:
61-
generation_path = f
62-
elif "skyvoid_vanilla_oneblock_starter_v" in f:
63-
extra_path = f
55+
island_path = ""
56+
generation_path = ""
57+
extra_path = ""
58+
for filename in os.listdir("build"):
59+
f = os.path.join("build", filename)
60+
# checking if it is a file
61+
if "skyvoid_island_oneblock_v" in f:
62+
island_path = f
63+
elif "skyvoid_worldgen_single_lava_v" in f:
64+
generation_path = f
65+
elif "skyvoid_vanilla_oneblock_starter_v" in f:
66+
extra_path = f
6467

65-
island = DataPack(path=island_path,extend_namespace=all_worldgen)
66-
generation = DataPack(path=generation_path,extend_namespace=all_worldgen)
67-
extra = DataPack(path=extra_path,extend_namespace=all_worldgen)
68+
island = DataPack(path=island_path, extend_namespace=all_worldgen)
69+
generation = DataPack(path=generation_path, extend_namespace=all_worldgen)
70+
extra = DataPack(path=extra_path, extend_namespace=all_worldgen)
6871

69-
ctx.data.merge(generation)
70-
ctx.data.merge(extra)
71-
ctx.data.merge(island)
72+
ctx.data.merge(generation)
73+
ctx.data.merge(extra)
74+
ctx.data.merge(island)
7275

7376

7477
def skyblock_dirt(ctx: Context):
75-
island_path = ""
76-
generation_path = ""
77-
for filename in os.listdir("build"):
78-
f = os.path.join("build", filename)
79-
# checking if it is a file
80-
if "skyvoid_island_only_dirt_v" in f:
81-
island_path = f
82-
elif "skyvoid_worldgen_normal_end_v" in f:
83-
generation_path = f
78+
island_path = ""
79+
generation_path = ""
80+
for filename in os.listdir("build"):
81+
f = os.path.join("build", filename)
82+
# checking if it is a file
83+
if "skyvoid_island_only_dirt_v" in f:
84+
island_path = f
85+
elif "skyvoid_worldgen_normal_end_v" in f:
86+
generation_path = f
8487

85-
island = DataPack(path=island_path,extend_namespace=all_worldgen)
86-
generation = DataPack(path=generation_path,extend_namespace=all_worldgen)
88+
island = DataPack(path=island_path, extend_namespace=all_worldgen)
89+
generation = DataPack(path=generation_path, extend_namespace=all_worldgen)
8790

88-
ctx.data.merge(generation)
89-
ctx.data.merge(island)
91+
ctx.data.merge(generation)
92+
ctx.data.merge(island)

0 commit comments

Comments
 (0)