from lib.utils import get_dir_location import xml.etree.ElementTree as ET from .mappings import Mappings import requests import json import os # make sure the cache directory exists print('Making __cache__') if not os.path.exists(get_dir_location('__cache__')): print('Made __cache__ directory.', get_dir_location('__cache__')) os.mkdir(get_dir_location('__cache__')) def get_burger(): if not os.path.exists(get_dir_location('__cache__/Burger')): print('\033[92mDownloading Burger...\033[m') os.system( f'cd {get_dir_location("__cache__")} && git clone https://github.com/mat-1/Burger && cd Burger && git pull') print('\033[92mInstalling dependencies...\033[m') os.system(f'cd {get_dir_location("__cache__")}/Burger && python -m venv venv && venv/bin/pip install six jawa') def get_pumpkin_extractor(): if not os.path.exists(get_dir_location('__cache__/pumpkin-extractor')): print('\033[92mDownloading Pumpkin-MC/Extractor...\033[m') os.system( f'cd {get_dir_location("__cache__")} && git clone https://github.com/Pumpkin-MC/Extractor pumpkin-extractor && cd pumpkin-extractor && git pull') GIT_PATCH = '''diff --git a/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt b/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt index 936cd7b..9876a4b 100644 --- a/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt +++ b/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt @@ -106,12 +106,18 @@ class Blocks : Extractor.Extractor { } val collisionShapeIdxsJson = JsonArray() + val outlineShapeIdxsJson = JsonArray() for (box in state.getCollisionShape(EmptyBlockView.INSTANCE, BlockPos.ORIGIN).boundingBoxes) { val idx = shapes.putIfAbsent(box, shapes.size) collisionShapeIdxsJson.add(Objects.requireNonNullElseGet(idx) { shapes.size - 1 }) } + for (box in state.getOutlineShape(EmptyBlockView.INSTANCE, BlockPos.ORIGIN).boundingBoxes) { + val idx = shapes.putIfAbsent(box, shapes.size) + outlineShapeIdxsJson.add(Objects.requireNonNullElseGet(idx) { shapes.size - 1 }) + } stateJson.add("collision_shapes", collisionShapeIdxsJson) + stateJson.add("outline_shapes", outlineShapeIdxsJson) for (blockEntity in Registries.BLOCK_ENTITY_TYPE) { if (blockEntity.supports(state)) { ''' os.system( f'cd {get_dir_location("__cache__")}/pumpkin-extractor && git apply - <