Skip to content

Commit 9909031

Browse files
♻️ Rework repo structure
1 parent 1d4c9de commit 9909031

25 files changed

+25
-90
lines changed

examples/README.md

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

examples/area.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
from mcstructure import Block, Structure
2+
from pathlib import Path
3+
4+
here = Path(__file__).parent
25

36
struct = Structure(
47
(6, 6, 6), # Size of the Structure 声明结构大小,注意这是大小,其坐标从0开始
@@ -13,5 +16,5 @@
1316
print(struct._get_str_array(with_namespace=False, with_states=True))
1417

1518
# write into file 写入文件
16-
with open("structures/my_create.mcstructure", "wb") as f:
19+
with here.joinpath("out/area.mcstructure").open("wb") as f:
1720
struct.dump(f)

examples/copystruct.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from mcstructure import Structure
2+
from pathlib import Path
23

3-
with open("examples/structures/large_nether.mcstructure", "rb") as f:
4+
here = Path(__file__).parent
5+
6+
with here.joinpath("../samples/large_nether.mcstructure").open("rb") as f:
47
struct = Structure.load(f)
58

6-
with open("examples/pack/src/structures/large_nether.mcstructure", "wb") as f:
9+
with here.joinpath("out/large_nether.mcstructure").open("wb") as f:
710
struct.dump(f)

examples/diagonal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from mcstructure import Block, Structure
2+
from pathlib import Path
23

4+
here = Path(__file__).parent
35

46
BLOCK = Block("minecraft:grass")
57

@@ -13,5 +15,5 @@
1315
.set_block((5, 5, 5), BLOCK)
1416
)
1517

16-
with open("examples/my_diagonal.mcstructure", "wb") as f:
18+
with here.joinpath("out/diagonal.mcstructure").open("wb") as f:
1719
struct.dump(f)

examples/out/area.mcstructure

2 KB
Binary file not shown.

examples/out/diagonal.mcstructure

8.07 KB
Binary file not shown.
File renamed without changes.

examples/out/simple.mcstructure

382 Bytes
Binary file not shown.

examples/pack/README.md

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

examples/pack/makepack.py

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

0 commit comments

Comments
 (0)