Skip to content

Commit

Permalink
Merge pull request #4 from JaylyDev/beta
Browse files Browse the repository at this point in the history
Put vanilla structures into zip file
  • Loading branch information
JaylyDev committed Mar 18, 2023
2 parents 9b5298b + a29982d commit 1246e14
Show file tree
Hide file tree
Showing 742 changed files with 26 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
pull_request:

jobs:
test:
Expand All @@ -17,6 +18,7 @@ jobs:
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: pip install -r requirements.txt
- run: unzip assets/vanilla_structures.zip -d structures
- run: python __main__.py
- uses: actions/upload-artifact@v3
with:
Expand Down
11 changes: 5 additions & 6 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def convert(file):
with Progress(*columns, refresh_per_second=30) as progress:
task = progress.add_task("[cyan]Writing mcstructure...", total=size)
global completed
global timer
completed = 0

def write (data: bytes):
Expand All @@ -43,19 +44,17 @@ def write (data: bytes):
completed += len(data)

def renderWriteProgress():
progress.update(task, completed=completed, total=size)
global timer
progress.update(task, completed=completed)
timer = threading.Timer(1 / 30, renderWriteProgress)
if completed > size:
timer.cancel()
else:
timer.start()
timer.start()

renderWriteProgress()
mcstructure.save(write, True)

# stop progress as mcstructure file has been saved
timer.cancel()
progress.update(task, completed=completed, total=completed)
progress.stop_task(task)
progress.stop()

print(f"Wrote {mcstructureFile} in {round((time() - startTime) * 1000, 2)} ms\n")
Expand Down
Binary file modified assets/demo_video.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/vanilla_structures.zip
Binary file not shown.
11 changes: 10 additions & 1 deletion progress_bar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
from rich.progress import Task, Column, ProgressColumn, Text, Union, Sequence, ProgressType, Iterable, Optional, List, TextColumn, BarColumn, TimeRemainingColumn, Progress
from rich.progress import Task, Column, ProgressColumn, DownloadColumn, Text, Union, Sequence, TransferSpeedColumn, ProgressType, Iterable, Optional, List, TextColumn, BarColumn, TimeRemainingColumn, Progress

columns = (
TextColumn("[progress.description]{task.description}"),
BarColumn(),
DownloadColumn(),
TransferSpeedColumn(),
TextColumn("eta"),
TimeRemainingColumn(),
)

class TaskCompletedColumn(ProgressColumn):
"""Renders file size downloaded and total, e.g. '0.5/2.3 GB'.
Expand Down
11 changes: 9 additions & 2 deletions structures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This folder is where the program converts all your NBT files into mcstructure files.

There are lots of vanilla NBT structures extracted from Minecraft in this directory, they're mainly for testing the program against GitHub actions.
Example folder structure:

If you're using this program for personal use, consider removing all files in this directory.
```
nbt-to-mcstructure
└───structures
│ mapart_6x6.nbt
└───city
entrance_path_1.nbt
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/ancient_city/city_center/walls/left.nbt
Binary file not shown.
Binary file removed structures/ancient_city/city_center/walls/right.nbt
Binary file not shown.
Binary file removed structures/ancient_city/city_center/walls/top.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/ancient_city/structures/barracks.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/camp_1.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/camp_2.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/camp_3.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/chamber_1.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/chamber_2.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/chamber_3.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/ice_box_1.nbt
Binary file not shown.
Binary file not shown.
Binary file removed structures/ancient_city/structures/large_ruin_1.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/medium_pillar_1.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/medium_ruin_1.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/medium_ruin_2.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/sauna_1.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/small_ruin_1.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/small_ruin_2.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/small_statue.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/tall_ruin_1.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/tall_ruin_2.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/tall_ruin_3.nbt
Binary file not shown.
Binary file removed structures/ancient_city/structures/tall_ruin_4.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/blocks/air.nbt
Binary file not shown.
Binary file removed structures/bastion/blocks/gold.nbt
Binary file not shown.
Binary file removed structures/bastion/bridge/bridge_pieces/bridge.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/bridge/legs/leg_0.nbt
Binary file not shown.
Binary file removed structures/bastion/bridge/legs/leg_1.nbt
Binary file not shown.
Binary file removed structures/bastion/bridge/rampart_plates/plate_0.nbt
Binary file not shown.
Binary file removed structures/bastion/bridge/ramparts/rampart_0.nbt
Binary file not shown.
Binary file removed structures/bastion/bridge/ramparts/rampart_1.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/bridge/walls/wall_base_0.nbt
Binary file not shown.
Binary file removed structures/bastion/bridge/walls/wall_base_1.nbt
Binary file not shown.
Binary file removed structures/bastion/hoglin_stable/air_base.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/hoglin_stable/posts/end_post.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/hoglin_stable/walls/wall_base.nbt
Binary file not shown.
Binary file removed structures/bastion/jigsaw_test.nbt
Binary file not shown.
Binary file removed structures/bastion/mobs/empty.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/bases/centers__center_0.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/bases/centers__center_1.nbt
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/treasure/bases/centers__center_3.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/bases/lava_basin.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/big_air_full.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/brains/center_brain.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/treasure/corners/edges__bottom.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/corners/edges__middle.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/corners/edges__top.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/treasure/entrances/entrance_0.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/extensions/empty.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/extensions/fire_room.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/extensions/house_0.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/extensions/house_1.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/treasure/ramparts/lava_basin.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/treasure/ramparts/top_wall.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/roofs/center_roof.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/roofs/corner_roof.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/roofs/wall_roof.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/stairs/lower_stairs.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/bottom__wall_0.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/bottom__wall_1.nbt
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/bottom__wall_3.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/entrance_wall.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/lava_wall.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/mid__wall_0.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/mid__wall_1.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/mid__wall_2.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/outer__mid_corner.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/outer__top_corner.nbt
Binary file not shown.
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/top__wall_0.nbt
Binary file not shown.
Binary file removed structures/bastion/treasure/walls/top__wall_1.nbt
Binary file not shown.
Binary file removed structures/bastion/units/air_base.nbt
Binary file not shown.
Binary file removed structures/bastion/units/center_pieces/center_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/center_pieces/center_1.nbt
Binary file not shown.
Binary file removed structures/bastion/units/center_pieces/center_2.nbt
Binary file not shown.
Binary file removed structures/bastion/units/edges/edge_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/fillers/stage_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/pathways/pathway_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/pathways/pathway_wall_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/rampart_plates/plate_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/ramparts/ramparts_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/ramparts/ramparts_1.nbt
Binary file not shown.
Binary file removed structures/bastion/units/ramparts/ramparts_2.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/rot__stage_1_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_0_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_0_1.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_0_2.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_0_3.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_1_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_1_1.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_1_2.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_1_3.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_2_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_2_1.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_3_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_3_1.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_3_2.nbt
Binary file not shown.
Binary file removed structures/bastion/units/stages/stage_3_3.nbt
Binary file not shown.
Binary file removed structures/bastion/units/wall_units/edge_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/wall_units/edge_0_large.nbt
Binary file not shown.
Binary file removed structures/bastion/units/wall_units/unit_0.nbt
Binary file not shown.
Binary file removed structures/bastion/units/walls/connected_wall.nbt
Binary file not shown.
Binary file removed structures/bastion/units/walls/wall_base.nbt
Binary file not shown.
Binary file removed structures/coralcrust/crust1.nbt
Binary file not shown.
Binary file removed structures/coralcrust/crust2.nbt
Binary file not shown.
Binary file removed structures/coralcrust/crust3.nbt
Binary file not shown.
Binary file removed structures/coralcrust/crust4.nbt
Binary file not shown.
Binary file removed structures/coralcrust/crust5.nbt
Binary file not shown.
Binary file removed structures/coralcrust/outcropping1.nbt
Binary file not shown.
Binary file removed structures/coralcrust/outcropping2.nbt
Binary file not shown.
Binary file removed structures/coralcrust/outcropping3.nbt
Binary file not shown.
Binary file removed structures/coralcrust/outcropping4.nbt
Binary file not shown.
Binary file removed structures/coralcrust/outcropping5.nbt
Binary file not shown.
Binary file removed structures/coralcrust/outcropping6.nbt
Binary file not shown.
Binary file removed structures/endcity/base_floor.nbt
Binary file not shown.
Binary file removed structures/endcity/base_roof.nbt
Binary file not shown.
Binary file removed structures/endcity/bridge_end.nbt
Binary file not shown.
Binary file removed structures/endcity/bridge_gentle_stairs.nbt
Binary file not shown.
Binary file removed structures/endcity/bridge_piece.nbt
Binary file not shown.
Binary file removed structures/endcity/bridge_steep_stairs.nbt
Binary file not shown.
Binary file removed structures/endcity/fat_tower_base.nbt
Binary file not shown.
Binary file removed structures/endcity/fat_tower_middle.nbt
Binary file not shown.
Binary file removed structures/endcity/fat_tower_top.nbt
Binary file not shown.
Binary file removed structures/endcity/second_floor.nbt
Binary file not shown.
Binary file removed structures/endcity/second_floor_2.nbt
Binary file not shown.
Binary file removed structures/endcity/second_roof.nbt
Binary file not shown.
Binary file removed structures/endcity/ship.nbt
Binary file not shown.
Binary file removed structures/endcity/third_floor.nbt
Binary file not shown.
Binary file removed structures/endcity/third_floor_b.nbt
Binary file not shown.
Binary file removed structures/endcity/third_floor_c.nbt
Binary file not shown.
Binary file removed structures/endcity/third_roof.nbt
Binary file not shown.
Binary file removed structures/endcity/tower_base.nbt
Binary file not shown.
Binary file removed structures/endcity/tower_floor.nbt
Binary file not shown.
Binary file removed structures/endcity/tower_piece.nbt
Binary file not shown.
Binary file removed structures/endcity/tower_top.nbt
Binary file not shown.
Binary file removed structures/fossils/fossil_skull_01.nbt
Binary file not shown.
Binary file removed structures/fossils/fossil_skull_02.nbt
Binary file not shown.
Binary file removed structures/fossils/fossil_skull_03.nbt
Binary file not shown.
Binary file removed structures/fossils/fossil_skull_04.nbt
Binary file not shown.
Binary file removed structures/fossils/fossil_spine_01.nbt
Binary file not shown.
Binary file removed structures/fossils/fossil_spine_02.nbt
Binary file not shown.
Binary file removed structures/fossils/fossil_spine_03.nbt
Binary file not shown.
Binary file removed structures/fossils/fossil_spine_04.nbt
Binary file not shown.
Binary file removed structures/igloo/igloo_bottom.nbt
Binary file not shown.
Binary file removed structures/igloo/igloo_middle.nbt
Binary file not shown.
Binary file removed structures/igloo/igloo_top_no_trapdoor.nbt
Binary file not shown.
Binary file removed structures/igloo/igloo_top_trapdoor.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_a1.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_a2.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_a3.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_a4.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_a5.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_as1.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_as2.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_as3.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_as4.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_b1.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_b2.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_b3.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_b4.nbt
Binary file not shown.
Binary file removed structures/mansion/1x1_b5.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_a1.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_a2.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_a3.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_a4.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_a5.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_a6.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_a7.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_a8.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_a9.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_b1.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_b2.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_b3.nbt
Binary file not shown.
Binary file removed structures/mansion/1x2_b4.nbt
Binary file not shown.
Loading

0 comments on commit 1246e14

Please sign in to comment.