amulet-core 2.0a7__cp312-cp312-win_amd64.whl → 2.0.1.0.1297307203.19.43.34808.0a0__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of amulet-core might be problematic. Click here for more details.
- amulet/core/__init__.py +36 -0
- amulet/core/__pyinstaller/hook-amulet.core.py +4 -0
- amulet/core/_amulet_core.cp312-win_amd64.pyd +0 -0
- amulet/core/_amulet_core.pyi +7 -0
- amulet/{_version.py → core/_version.py} +3 -3
- amulet/core/amulet_core.dll +0 -0
- amulet/core/amulet_core.lib +0 -0
- amulet/core/amulet_coreConfig.cmake +18 -0
- amulet/{biome.pyi → core/biome/__init__.pyi} +3 -3
- amulet/core/biome/biome.hpp +53 -0
- amulet/{block.pyi → core/block/__init__.pyi} +25 -26
- amulet/core/block/block.hpp +156 -0
- amulet/{block_entity.pyi → core/block_entity/__init__.pyi} +7 -7
- amulet/core/block_entity/block_entity.hpp +84 -0
- amulet/{errors.py → core/chunk/__init__.pyi} +37 -33
- amulet/core/chunk/chunk.hpp +126 -0
- amulet/core/chunk/component/__init__.pyi +18 -0
- amulet/core/chunk/component/biome_3d_component.hpp +96 -0
- amulet/core/chunk/component/block_component.hpp +101 -0
- amulet/core/chunk/component/block_component.pyi +28 -0
- amulet/core/chunk/component/block_entity_component.hpp +119 -0
- amulet/core/chunk/component/section_array_map.hpp +129 -0
- amulet/{chunk_components.pyi → core/chunk/component/section_array_map.pyi} +4 -24
- amulet/core/dll.hpp +21 -0
- amulet/core/entity/__init__.pyi +105 -0
- amulet/core/entity/entity.hpp +100 -0
- amulet/{palette → core/palette}/__init__.pyi +2 -2
- amulet/core/palette/biome_palette.hpp +65 -0
- amulet/{palette → core/palette}/biome_palette.pyi +8 -8
- amulet/core/palette/block_palette.hpp +71 -0
- amulet/{palette → core/palette}/block_palette.pyi +12 -10
- amulet/core/selection/__init__.pyi +8 -0
- amulet/core/selection/box.hpp +86 -0
- amulet/core/selection/box.pyi +215 -0
- amulet/core/selection/group.hpp +80 -0
- amulet/core/selection/group.pyi +213 -0
- amulet/{version.pyi → core/version/__init__.pyi} +58 -10
- amulet/core/version/version.hpp +204 -0
- {amulet_core-2.0a7.dist-info → amulet_core-2.0.1.0.1297307203.19.43.34808.0a0.dist-info}/METADATA +25 -20
- amulet_core-2.0.1.0.1297307203.19.43.34808.0a0.dist-info/RECORD +45 -0
- {amulet_core-2.0a7.dist-info → amulet_core-2.0.1.0.1297307203.19.43.34808.0a0.dist-info}/WHEEL +1 -1
- amulet_core-2.0.1.0.1297307203.19.43.34808.0a0.dist-info/entry_points.txt +2 -0
- amulet/__init__.cp312-win_amd64.pyd +0 -0
- amulet/__init__.py.cpp +0 -43
- amulet/__init__.pyi +0 -28
- amulet/__pyinstaller/hook-amulet.py +0 -4
- amulet/_init.py +0 -26
- amulet/biome.cpp +0 -36
- amulet/biome.hpp +0 -43
- amulet/biome.py.cpp +0 -122
- amulet/block.cpp +0 -435
- amulet/block.hpp +0 -119
- amulet/block.py.cpp +0 -377
- amulet/block_entity.cpp +0 -12
- amulet/block_entity.hpp +0 -56
- amulet/block_entity.py.cpp +0 -115
- amulet/chunk.cpp +0 -16
- amulet/chunk.hpp +0 -99
- amulet/chunk.py.cpp +0 -80
- amulet/chunk.pyi +0 -28
- amulet/chunk_components/biome_3d_component.cpp +0 -5
- amulet/chunk_components/biome_3d_component.hpp +0 -79
- amulet/chunk_components/block_component.cpp +0 -41
- amulet/chunk_components/block_component.hpp +0 -88
- amulet/chunk_components/block_entity_component.cpp +0 -5
- amulet/chunk_components/block_entity_component.hpp +0 -147
- amulet/chunk_components/section_array_map.cpp +0 -129
- amulet/chunk_components/section_array_map.hpp +0 -147
- amulet/collections/eq.py.hpp +0 -37
- amulet/collections/hash.py.hpp +0 -27
- amulet/collections/holder.py.hpp +0 -37
- amulet/collections/iterator.py.hpp +0 -80
- amulet/collections/mapping.py.hpp +0 -199
- amulet/collections/mutable_mapping.py.hpp +0 -226
- amulet/collections/sequence.py.hpp +0 -163
- amulet/collections.pyi +0 -40
- amulet/data_types.py +0 -29
- amulet/entity.py +0 -182
- amulet/game/__init__.py +0 -7
- amulet/game/_game.py +0 -152
- amulet/game/_universal/__init__.py +0 -1
- amulet/game/_universal/_biome.py +0 -17
- amulet/game/_universal/_block.py +0 -47
- amulet/game/_universal/_version.py +0 -68
- amulet/game/abc/__init__.py +0 -22
- amulet/game/abc/_block_specification.py +0 -150
- amulet/game/abc/biome.py +0 -213
- amulet/game/abc/block.py +0 -331
- amulet/game/abc/game_version_container.py +0 -25
- amulet/game/abc/json_interface.py +0 -27
- amulet/game/abc/version.py +0 -44
- amulet/game/bedrock/__init__.py +0 -1
- amulet/game/bedrock/_biome.py +0 -35
- amulet/game/bedrock/_block.py +0 -42
- amulet/game/bedrock/_version.py +0 -165
- amulet/game/java/__init__.py +0 -2
- amulet/game/java/_biome.py +0 -35
- amulet/game/java/_block.py +0 -60
- amulet/game/java/_version.py +0 -176
- amulet/game/translate/__init__.py +0 -12
- amulet/game/translate/_functions/__init__.py +0 -15
- amulet/game/translate/_functions/_code_functions/__init__.py +0 -0
- amulet/game/translate/_functions/_code_functions/_text.py +0 -553
- amulet/game/translate/_functions/_code_functions/banner_pattern.py +0 -67
- amulet/game/translate/_functions/_code_functions/bedrock_chest_connection.py +0 -152
- amulet/game/translate/_functions/_code_functions/bedrock_moving_block_pos.py +0 -88
- amulet/game/translate/_functions/_code_functions/bedrock_sign.py +0 -152
- amulet/game/translate/_functions/_code_functions/bedrock_skull_rotation.py +0 -16
- amulet/game/translate/_functions/_code_functions/custom_name.py +0 -146
- amulet/game/translate/_functions/_frozen.py +0 -66
- amulet/game/translate/_functions/_state.py +0 -54
- amulet/game/translate/_functions/_typing.py +0 -98
- amulet/game/translate/_functions/abc.py +0 -123
- amulet/game/translate/_functions/carry_nbt.py +0 -160
- amulet/game/translate/_functions/carry_properties.py +0 -80
- amulet/game/translate/_functions/code.py +0 -143
- amulet/game/translate/_functions/map_block_name.py +0 -66
- amulet/game/translate/_functions/map_nbt.py +0 -111
- amulet/game/translate/_functions/map_properties.py +0 -93
- amulet/game/translate/_functions/multiblock.py +0 -112
- amulet/game/translate/_functions/new_block.py +0 -42
- amulet/game/translate/_functions/new_entity.py +0 -43
- amulet/game/translate/_functions/new_nbt.py +0 -206
- amulet/game/translate/_functions/new_properties.py +0 -64
- amulet/game/translate/_functions/sequence.py +0 -51
- amulet/game/translate/_functions/walk_input_nbt.py +0 -331
- amulet/game/translate/_translator.py +0 -433
- amulet/img/__init__.py +0 -10
- amulet/img/missing_no.png +0 -0
- amulet/img/missing_pack.png +0 -0
- amulet/img/missing_world.png +0 -0
- amulet/io/binary_reader.hpp +0 -45
- amulet/io/binary_writer.hpp +0 -30
- amulet/item.py +0 -75
- amulet/level/__init__.pyi +0 -23
- amulet/level/_load.py +0 -100
- amulet/level/abc/__init__.py +0 -12
- amulet/level/abc/_chunk_handle.py +0 -335
- amulet/level/abc/_dimension.py +0 -86
- amulet/level/abc/_history/__init__.py +0 -1
- amulet/level/abc/_history/_cache.py +0 -224
- amulet/level/abc/_history/_history_manager.py +0 -291
- amulet/level/abc/_level/__init__.py +0 -5
- amulet/level/abc/_level/_compactable_level.py +0 -10
- amulet/level/abc/_level/_creatable_level.py +0 -28
- amulet/level/abc/_level/_disk_level.py +0 -17
- amulet/level/abc/_level/_level.py +0 -449
- amulet/level/abc/_level/_loadable_level.py +0 -42
- amulet/level/abc/_player_storage.py +0 -7
- amulet/level/abc/_raw_level.py +0 -187
- amulet/level/abc/_registry.py +0 -40
- amulet/level/java/__init__.pyi +0 -16
- amulet/level/java/_chunk_handle.py +0 -17
- amulet/level/java/_dimension.py +0 -20
- amulet/level/java/_level.py +0 -184
- amulet/level/java/_raw/__init__.pyi +0 -15
- amulet/level/java/_raw/_chunk.pyi +0 -23
- amulet/level/java/_raw/_constant.py +0 -9
- amulet/level/java/_raw/_data_pack/__init__.py +0 -2
- amulet/level/java/_raw/_data_pack/data_pack.py +0 -241
- amulet/level/java/_raw/_data_pack/data_pack_manager.py +0 -77
- amulet/level/java/_raw/_dimension.py +0 -86
- amulet/level/java/_raw/_level.py +0 -507
- amulet/level/java/_raw/_typing.py +0 -3
- amulet/level/java/_raw/java_chunk_decode.cpp +0 -531
- amulet/level/java/_raw/java_chunk_decode.hpp +0 -23
- amulet/level/java/_raw/java_chunk_encode.cpp +0 -25
- amulet/level/java/_raw/java_chunk_encode.hpp +0 -23
- amulet/level/java/anvil/__init__.py +0 -2
- amulet/level/java/anvil/_dimension.py +0 -170
- amulet/level/java/anvil/_region.py +0 -421
- amulet/level/java/anvil/_sector_manager.py +0 -223
- amulet/level/java/chunk.pyi +0 -81
- amulet/level/java/chunk_/_chunk.py +0 -260
- amulet/level/java/chunk_/components/inhabited_time.py +0 -12
- amulet/level/java/chunk_/components/last_update.py +0 -12
- amulet/level/java/chunk_/components/legacy_version.py +0 -12
- amulet/level/java/chunk_/components/light_populated.py +0 -12
- amulet/level/java/chunk_/components/named_height_2d.py +0 -37
- amulet/level/java/chunk_/components/status.py +0 -11
- amulet/level/java/chunk_/components/terrain_populated.py +0 -12
- amulet/level/java/chunk_components/data_version_component.cpp +0 -32
- amulet/level/java/chunk_components/data_version_component.hpp +0 -31
- amulet/level/java/chunk_components/java_raw_chunk_component.cpp +0 -56
- amulet/level/java/chunk_components/java_raw_chunk_component.hpp +0 -45
- amulet/level/java/chunk_components.pyi +0 -22
- amulet/level/java/java_chunk.cpp +0 -170
- amulet/level/java/java_chunk.hpp +0 -141
- amulet/level/java/long_array.hpp +0 -175
- amulet/level/java/long_array.pyi +0 -39
- amulet/level/temporary_level/__init__.py +0 -1
- amulet/level/temporary_level/_level.py +0 -16
- amulet/mesh/__init__.py +0 -0
- amulet/mesh/block/__init__.py +0 -1
- amulet/mesh/block/block_mesh.py +0 -369
- amulet/mesh/block/cube.py +0 -149
- amulet/mesh/block/missing_block.py +0 -20
- amulet/mesh/util.py +0 -17
- amulet/palette/biome_palette.hpp +0 -85
- amulet/palette/block_palette.cpp +0 -32
- amulet/palette/block_palette.hpp +0 -93
- amulet/player.py +0 -62
- amulet/pybind11/collections.hpp +0 -118
- amulet/pybind11/numpy.hpp +0 -26
- amulet/pybind11/py_module.hpp +0 -34
- amulet/pybind11/type_hints.hpp +0 -51
- amulet/pybind11/types.hpp +0 -25
- amulet/pybind11/typing.hpp +0 -7
- amulet/resource_pack/__init__.py +0 -62
- amulet/resource_pack/abc/__init__.py +0 -2
- amulet/resource_pack/abc/resource_pack.py +0 -38
- amulet/resource_pack/abc/resource_pack_manager.py +0 -87
- amulet/resource_pack/bedrock/__init__.py +0 -2
- amulet/resource_pack/bedrock/bedrock_vanilla_fix/pack_icon.png +0 -0
- amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_carried.png +0 -0
- amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_side_carried.png +0 -0
- amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/water.png +0 -0
- amulet/resource_pack/bedrock/blockshapes/__init__.py +0 -31
- amulet/resource_pack/bedrock/blockshapes/air.py +0 -35
- amulet/resource_pack/bedrock/blockshapes/base_blockshape.py +0 -29
- amulet/resource_pack/bedrock/blockshapes/bubble_column.py +0 -29
- amulet/resource_pack/bedrock/blockshapes/cake.py +0 -46
- amulet/resource_pack/bedrock/blockshapes/chest.py +0 -54
- amulet/resource_pack/bedrock/blockshapes/comparator.py +0 -51
- amulet/resource_pack/bedrock/blockshapes/cross_texture.py +0 -186
- amulet/resource_pack/bedrock/blockshapes/cross_texture0.py +0 -17
- amulet/resource_pack/bedrock/blockshapes/cross_texture_green.py +0 -16
- amulet/resource_pack/bedrock/blockshapes/cube.py +0 -38
- amulet/resource_pack/bedrock/blockshapes/default.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/door.py +0 -38
- amulet/resource_pack/bedrock/blockshapes/door1.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/door2.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/door3.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/door4.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/door5.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/door6.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/double_plant.py +0 -40
- amulet/resource_pack/bedrock/blockshapes/enchanting_table.py +0 -22
- amulet/resource_pack/bedrock/blockshapes/farmland.py +0 -22
- amulet/resource_pack/bedrock/blockshapes/fence.py +0 -22
- amulet/resource_pack/bedrock/blockshapes/flat.py +0 -55
- amulet/resource_pack/bedrock/blockshapes/flat_wall.py +0 -55
- amulet/resource_pack/bedrock/blockshapes/furnace.py +0 -44
- amulet/resource_pack/bedrock/blockshapes/furnace_lit.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/green_cube.py +0 -39
- amulet/resource_pack/bedrock/blockshapes/ladder.py +0 -36
- amulet/resource_pack/bedrock/blockshapes/lilypad.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/partial_block.py +0 -57
- amulet/resource_pack/bedrock/blockshapes/piston.py +0 -44
- amulet/resource_pack/bedrock/blockshapes/piston_arm.py +0 -72
- amulet/resource_pack/bedrock/blockshapes/portal_frame.py +0 -22
- amulet/resource_pack/bedrock/blockshapes/pressure_plate.py +0 -29
- amulet/resource_pack/bedrock/blockshapes/pumpkin.py +0 -36
- amulet/resource_pack/bedrock/blockshapes/pumpkin_carved.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/pumpkin_lit.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/red_dust.py +0 -14
- amulet/resource_pack/bedrock/blockshapes/repeater.py +0 -53
- amulet/resource_pack/bedrock/blockshapes/slab.py +0 -33
- amulet/resource_pack/bedrock/blockshapes/slab_double.py +0 -15
- amulet/resource_pack/bedrock/blockshapes/tree.py +0 -41
- amulet/resource_pack/bedrock/blockshapes/turtle_egg.py +0 -15
- amulet/resource_pack/bedrock/blockshapes/vine.py +0 -52
- amulet/resource_pack/bedrock/blockshapes/wall.py +0 -22
- amulet/resource_pack/bedrock/blockshapes/water.py +0 -38
- amulet/resource_pack/bedrock/download_resources.py +0 -147
- amulet/resource_pack/bedrock/resource_pack.py +0 -40
- amulet/resource_pack/bedrock/resource_pack_manager.py +0 -361
- amulet/resource_pack/bedrock/sort_blockshapes.py +0 -15
- amulet/resource_pack/java/__init__.py +0 -2
- amulet/resource_pack/java/download_resources.py +0 -212
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
- amulet/resource_pack/java/resource_pack.py +0 -44
- amulet/resource_pack/java/resource_pack_manager.py +0 -551
- amulet/resource_pack/unknown_resource_pack.py +0 -10
- amulet/selection/__init__.py +0 -2
- amulet/selection/abstract_selection.py +0 -342
- amulet/selection/box.py +0 -852
- amulet/selection/group.py +0 -481
- amulet/utils/__init__.pyi +0 -23
- amulet/utils/call_spec/__init__.py +0 -24
- amulet/utils/call_spec/_call_spec.py +0 -257
- amulet/utils/comment_json.py +0 -188
- amulet/utils/format_utils.py +0 -41
- amulet/utils/generator.py +0 -18
- amulet/utils/matrix.py +0 -243
- amulet/utils/numpy.hpp +0 -36
- amulet/utils/numpy.pyi +0 -11
- amulet/utils/numpy_helpers.py +0 -19
- amulet/utils/shareable_lock.py +0 -335
- amulet/utils/signal/__init__.py +0 -10
- amulet/utils/signal/_signal.py +0 -228
- amulet/utils/task_manager.py +0 -235
- amulet/utils/typed_property.py +0 -111
- amulet/utils/weakref.py +0 -70
- amulet/utils/world_utils.py +0 -102
- amulet/version.cpp +0 -136
- amulet/version.hpp +0 -142
- amulet/version.py.cpp +0 -281
- amulet_core-2.0a7.dist-info/RECORD +0 -295
- amulet_core-2.0a7.dist-info/entry_points.txt +0 -2
- /amulet/{__pyinstaller → core/__pyinstaller}/__init__.py +0 -0
- /amulet/{py.typed → core/py.typed} +0 -0
- {amulet_core-2.0a7.dist-info → amulet_core-2.0.1.0.1297307203.19.43.34808.0a0.dist-info}/top_level.txt +0 -0
|
@@ -1,433 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from typing import Callable, Union, Sequence, TypeVar, Type, Any, TYPE_CHECKING
|
|
3
|
-
import json
|
|
4
|
-
import glob
|
|
5
|
-
import os
|
|
6
|
-
from concurrent.futures import ThreadPoolExecutor
|
|
7
|
-
|
|
8
|
-
from amulet_nbt import (
|
|
9
|
-
read_nbt,
|
|
10
|
-
read_snbt,
|
|
11
|
-
NamedTag,
|
|
12
|
-
ListTag,
|
|
13
|
-
CompoundTag,
|
|
14
|
-
AnyNBT,
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
from amulet.block import Block
|
|
18
|
-
from amulet.block_entity import BlockEntity
|
|
19
|
-
from amulet.entity import Entity
|
|
20
|
-
from amulet.data_types import BlockCoordinates
|
|
21
|
-
from amulet.version import VersionNumber
|
|
22
|
-
|
|
23
|
-
from ._functions import (
|
|
24
|
-
AbstractBaseTranslationFunction,
|
|
25
|
-
SrcData,
|
|
26
|
-
SrcDataExtra,
|
|
27
|
-
StateData,
|
|
28
|
-
DstData,
|
|
29
|
-
)
|
|
30
|
-
from ._functions.abc import translation_function_from_json
|
|
31
|
-
from ._functions._typing import NBTPath
|
|
32
|
-
|
|
33
|
-
if TYPE_CHECKING:
|
|
34
|
-
from amulet.game.abc import GameVersion, BlockSpec
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
# These classes exist to do some pre-translation and post-translation processing.
|
|
38
|
-
# They also store the constant data so that it doesn't need to be passed in each time.
|
|
39
|
-
# They don't do any caching
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
def create_nbt(
|
|
43
|
-
outer_name: str,
|
|
44
|
-
outer_type: type[ListTag] | type[CompoundTag],
|
|
45
|
-
nbt_list: Sequence[
|
|
46
|
-
tuple[
|
|
47
|
-
str,
|
|
48
|
-
type[ListTag] | type[CompoundTag],
|
|
49
|
-
NBTPath,
|
|
50
|
-
Union[str, int],
|
|
51
|
-
AnyNBT,
|
|
52
|
-
]
|
|
53
|
-
],
|
|
54
|
-
default_template: str | None = None,
|
|
55
|
-
) -> NamedTag:
|
|
56
|
-
nbt_object: AnyNBT
|
|
57
|
-
if default_template is None:
|
|
58
|
-
nbt_object = outer_type()
|
|
59
|
-
else:
|
|
60
|
-
nbt_object = read_snbt(default_template)
|
|
61
|
-
|
|
62
|
-
for nbt_entry in nbt_list:
|
|
63
|
-
(
|
|
64
|
-
element_outer_name,
|
|
65
|
-
element_outer_type,
|
|
66
|
-
element_nbt_path,
|
|
67
|
-
element_data_path,
|
|
68
|
-
element_data,
|
|
69
|
-
) = nbt_entry
|
|
70
|
-
if outer_name == element_outer_name and issubclass(
|
|
71
|
-
outer_type, element_outer_type
|
|
72
|
-
):
|
|
73
|
-
nbt_temp: AnyNBT = nbt_object
|
|
74
|
-
for path, nbt_type in element_nbt_path:
|
|
75
|
-
# if the nested NBT object does not exist then create it
|
|
76
|
-
if isinstance(nbt_temp, CompoundTag):
|
|
77
|
-
assert isinstance(path, str)
|
|
78
|
-
if path not in nbt_temp or not isinstance(nbt_temp[path], nbt_type):
|
|
79
|
-
nbt_temp[path] = nbt_type()
|
|
80
|
-
nbt_temp = nbt_temp[path]
|
|
81
|
-
elif isinstance(nbt_temp, ListTag):
|
|
82
|
-
assert isinstance(path, int)
|
|
83
|
-
# if the list is a different type to nbt_type replace it with nbt_type
|
|
84
|
-
if len(nbt_temp) > 0 and not isinstance(nbt_temp[0], nbt_type):
|
|
85
|
-
raise RuntimeError("ListTag elements are the wrong type")
|
|
86
|
-
|
|
87
|
-
for _ in range(path + 1 - len(nbt_temp)):
|
|
88
|
-
# pad out the list to the length of the index
|
|
89
|
-
nbt_temp.append(nbt_type())
|
|
90
|
-
# we now should have a ListTag of the same type as nbt_type and length as path
|
|
91
|
-
nbt_temp = nbt_temp[path]
|
|
92
|
-
else:
|
|
93
|
-
raise RuntimeError
|
|
94
|
-
|
|
95
|
-
if isinstance(nbt_temp, CompoundTag):
|
|
96
|
-
assert isinstance(element_data_path, str)
|
|
97
|
-
nbt_temp[element_data_path] = element_data
|
|
98
|
-
|
|
99
|
-
elif isinstance(nbt_temp, ListTag):
|
|
100
|
-
assert isinstance(element_data_path, int)
|
|
101
|
-
# if the list is a different type to data replace it with type(data)
|
|
102
|
-
if (
|
|
103
|
-
len(nbt_temp) > 0
|
|
104
|
-
and nbt_temp[0].list_data_type != element_data.tag_id
|
|
105
|
-
):
|
|
106
|
-
raise RuntimeError("ListTag elements are the wrong type")
|
|
107
|
-
|
|
108
|
-
for _ in range(element_data_path + 1 - len(nbt_temp)):
|
|
109
|
-
# pad out the list to the length of the index
|
|
110
|
-
nbt_temp.append(element_data.__class__())
|
|
111
|
-
# we now should have a ListTag of the same type as nbt_type and length as data_path
|
|
112
|
-
nbt_temp[element_data_path] = element_data
|
|
113
|
-
|
|
114
|
-
# TODO:
|
|
115
|
-
# elif isinstance(nbt_temp, ByteArrayTag) and isinstance(data, ByteTag):
|
|
116
|
-
# # pad to the length of data_path if less than the current length
|
|
117
|
-
# # nbt_temp[data_path] = data.value
|
|
118
|
-
# elif isinstance(nbt_temp, IntArrayTag) and isinstance(data, IntTag):
|
|
119
|
-
# elif isinstance(nbt_temp, LongArrayTag) and isinstance(data, LongTag):
|
|
120
|
-
|
|
121
|
-
return NamedTag(nbt_object, outer_name)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
class BlockToUniversalTranslator:
|
|
125
|
-
# Class variables
|
|
126
|
-
_instances: dict[BlockToUniversalTranslator, BlockToUniversalTranslator] = {}
|
|
127
|
-
|
|
128
|
-
# Instance variables
|
|
129
|
-
_src_spec: BlockSpec
|
|
130
|
-
_translation: AbstractBaseTranslationFunction
|
|
131
|
-
_universal_version: GameVersion
|
|
132
|
-
_hash: int | None
|
|
133
|
-
|
|
134
|
-
def __new__(
|
|
135
|
-
cls,
|
|
136
|
-
src_spec: BlockSpec,
|
|
137
|
-
translation: AbstractBaseTranslationFunction,
|
|
138
|
-
universal_version: GameVersion,
|
|
139
|
-
) -> BlockToUniversalTranslator:
|
|
140
|
-
self = super().__new__(cls)
|
|
141
|
-
self._src_spec = src_spec
|
|
142
|
-
self._translation = translation
|
|
143
|
-
self._universal_version = universal_version
|
|
144
|
-
self._hash = None
|
|
145
|
-
return cls._instances.setdefault(self, self)
|
|
146
|
-
|
|
147
|
-
def __reduce__(self) -> Any:
|
|
148
|
-
return BlockToUniversalTranslator, (
|
|
149
|
-
self._src_spec,
|
|
150
|
-
self._translation,
|
|
151
|
-
self._universal_version,
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
def __hash__(self) -> int:
|
|
155
|
-
if self._hash is None:
|
|
156
|
-
self._hash = hash(
|
|
157
|
-
(self._src_spec, self._translation, self._universal_version)
|
|
158
|
-
)
|
|
159
|
-
return self._hash
|
|
160
|
-
|
|
161
|
-
def run(
|
|
162
|
-
self,
|
|
163
|
-
block: Block,
|
|
164
|
-
block_entity: BlockEntity | None,
|
|
165
|
-
extra: (
|
|
166
|
-
tuple[
|
|
167
|
-
BlockCoordinates,
|
|
168
|
-
Callable[[BlockCoordinates], tuple[Block, BlockEntity | None]],
|
|
169
|
-
]
|
|
170
|
-
| None
|
|
171
|
-
),
|
|
172
|
-
) -> tuple[Block, BlockEntity | None, bool, bool]:
|
|
173
|
-
if extra is None:
|
|
174
|
-
src_extra = None
|
|
175
|
-
else:
|
|
176
|
-
coords, get_block = extra
|
|
177
|
-
src_extra = SrcDataExtra(coords, get_block)
|
|
178
|
-
|
|
179
|
-
block_entity_nbt = None if block_entity is None else block_entity.nbt
|
|
180
|
-
|
|
181
|
-
if self._src_spec.nbt is not None and block_entity_nbt is None:
|
|
182
|
-
# There should be a block entity
|
|
183
|
-
if src_extra is not None:
|
|
184
|
-
# Load it from the level
|
|
185
|
-
block_entity = src_extra.get_block_callback((0, 0, 0))[1]
|
|
186
|
-
if block_entity is not None:
|
|
187
|
-
block_entity_nbt = block_entity.nbt
|
|
188
|
-
if block_entity_nbt is None:
|
|
189
|
-
# If it is still None then load it from the specification
|
|
190
|
-
block_entity_nbt = read_nbt(self._src_spec.nbt.snbt)
|
|
191
|
-
|
|
192
|
-
src = SrcData(block, block_entity_nbt, src_extra)
|
|
193
|
-
state = StateData()
|
|
194
|
-
dst = DstData()
|
|
195
|
-
self._translation.run(src, state, dst)
|
|
196
|
-
|
|
197
|
-
assert dst.cls is Block
|
|
198
|
-
assert dst.resource_id is not None
|
|
199
|
-
namespace, base_name = dst.resource_id
|
|
200
|
-
|
|
201
|
-
dst_spec = self._universal_version.block.get_specification(namespace, base_name)
|
|
202
|
-
properties = {k: v.default for k, v in dst_spec.properties.items()}
|
|
203
|
-
properties.update(dst.properties)
|
|
204
|
-
|
|
205
|
-
dst_block = Block(
|
|
206
|
-
"universal", VersionNumber(1), namespace, base_name, properties
|
|
207
|
-
)
|
|
208
|
-
|
|
209
|
-
if dst_spec.nbt is None:
|
|
210
|
-
dst_block_entity = None
|
|
211
|
-
else:
|
|
212
|
-
dst_block_entity = BlockEntity(
|
|
213
|
-
"universal",
|
|
214
|
-
VersionNumber(1),
|
|
215
|
-
dst_spec.nbt.namespace,
|
|
216
|
-
dst_spec.nbt.base_name,
|
|
217
|
-
create_nbt(
|
|
218
|
-
"",
|
|
219
|
-
CompoundTag,
|
|
220
|
-
dst.nbt,
|
|
221
|
-
dst_spec.nbt.snbt,
|
|
222
|
-
),
|
|
223
|
-
)
|
|
224
|
-
|
|
225
|
-
return dst_block, dst_block_entity, dst.extra_needed, dst.cacheable
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
class BlockFromUniversalTranslator:
|
|
229
|
-
# Class variables
|
|
230
|
-
_instances: dict[BlockFromUniversalTranslator, BlockFromUniversalTranslator] = {}
|
|
231
|
-
|
|
232
|
-
# Instance variables
|
|
233
|
-
_src_spec: BlockSpec
|
|
234
|
-
_translation: AbstractBaseTranslationFunction
|
|
235
|
-
_target_version: GameVersion
|
|
236
|
-
_hash: int | None
|
|
237
|
-
|
|
238
|
-
def __new__(
|
|
239
|
-
cls,
|
|
240
|
-
src_spec: BlockSpec,
|
|
241
|
-
translation: AbstractBaseTranslationFunction,
|
|
242
|
-
target_version: GameVersion,
|
|
243
|
-
) -> BlockFromUniversalTranslator:
|
|
244
|
-
self = super().__new__(cls)
|
|
245
|
-
self._src_spec = src_spec
|
|
246
|
-
self._translation = translation
|
|
247
|
-
self._target_version = target_version
|
|
248
|
-
self._hash = None
|
|
249
|
-
return cls._instances.setdefault(self, self)
|
|
250
|
-
|
|
251
|
-
def __reduce__(self) -> Any:
|
|
252
|
-
return BlockFromUniversalTranslator, (
|
|
253
|
-
self._src_spec,
|
|
254
|
-
self._translation,
|
|
255
|
-
self._target_version,
|
|
256
|
-
)
|
|
257
|
-
|
|
258
|
-
def __hash__(self) -> int:
|
|
259
|
-
if self._hash is None:
|
|
260
|
-
self._hash = hash((self._src_spec, self._translation, self._target_version))
|
|
261
|
-
return self._hash
|
|
262
|
-
|
|
263
|
-
def run(
|
|
264
|
-
self,
|
|
265
|
-
target_platform: str,
|
|
266
|
-
target_version: VersionNumber,
|
|
267
|
-
block: Block,
|
|
268
|
-
block_entity: BlockEntity | None,
|
|
269
|
-
extra: (
|
|
270
|
-
tuple[
|
|
271
|
-
BlockCoordinates,
|
|
272
|
-
Callable[[BlockCoordinates], tuple[Block, BlockEntity | None]],
|
|
273
|
-
]
|
|
274
|
-
| None
|
|
275
|
-
),
|
|
276
|
-
) -> tuple[Block, BlockEntity | None, bool, bool] | tuple[Entity, None, bool, bool]:
|
|
277
|
-
if extra is None:
|
|
278
|
-
src_extra = None
|
|
279
|
-
else:
|
|
280
|
-
coords, get_block = extra
|
|
281
|
-
src_extra = SrcDataExtra(coords, get_block)
|
|
282
|
-
|
|
283
|
-
block_entity_nbt = None if block_entity is None else block_entity.nbt
|
|
284
|
-
|
|
285
|
-
if self._src_spec.nbt is not None and block_entity_nbt is None:
|
|
286
|
-
# There should be a block entity
|
|
287
|
-
if src_extra is not None:
|
|
288
|
-
# Load it from the level
|
|
289
|
-
block_entity = src_extra.get_block_callback((0, 0, 0))[1]
|
|
290
|
-
if block_entity is not None:
|
|
291
|
-
block_entity_nbt = block_entity.nbt
|
|
292
|
-
if block_entity_nbt is None:
|
|
293
|
-
# If it is still None then load it from the specification
|
|
294
|
-
block_entity_nbt = read_nbt(self._src_spec.nbt.snbt)
|
|
295
|
-
|
|
296
|
-
src = SrcData(block, block_entity_nbt, src_extra)
|
|
297
|
-
state = StateData()
|
|
298
|
-
dst = DstData()
|
|
299
|
-
self._translation.run(src, state, dst)
|
|
300
|
-
|
|
301
|
-
if dst.cls is Block:
|
|
302
|
-
assert dst.resource_id is not None
|
|
303
|
-
namespace, base_name = dst.resource_id
|
|
304
|
-
|
|
305
|
-
dst_spec = self._target_version.block.get_specification(
|
|
306
|
-
namespace, base_name
|
|
307
|
-
)
|
|
308
|
-
properties = {k: v.default for k, v in dst_spec.properties.items()}
|
|
309
|
-
properties.update(dst.properties)
|
|
310
|
-
|
|
311
|
-
dst_block = Block(
|
|
312
|
-
target_platform, target_version, namespace, base_name, properties
|
|
313
|
-
)
|
|
314
|
-
|
|
315
|
-
if dst_spec.nbt is None:
|
|
316
|
-
dst_block_entity = None
|
|
317
|
-
else:
|
|
318
|
-
dst_block_entity = BlockEntity(
|
|
319
|
-
target_platform,
|
|
320
|
-
target_version,
|
|
321
|
-
dst_spec.nbt.namespace,
|
|
322
|
-
dst_spec.nbt.base_name,
|
|
323
|
-
create_nbt(
|
|
324
|
-
"",
|
|
325
|
-
CompoundTag,
|
|
326
|
-
dst.nbt,
|
|
327
|
-
dst_spec.nbt.snbt,
|
|
328
|
-
),
|
|
329
|
-
)
|
|
330
|
-
|
|
331
|
-
return dst_block, dst_block_entity, dst.extra_needed, dst.cacheable
|
|
332
|
-
|
|
333
|
-
elif dst.cls is Entity:
|
|
334
|
-
assert dst.resource_id is not None
|
|
335
|
-
namespace, base_name = dst.resource_id
|
|
336
|
-
|
|
337
|
-
# dst_spec = self._target_version.block.get_specification(
|
|
338
|
-
# namespace, base_name
|
|
339
|
-
# )
|
|
340
|
-
|
|
341
|
-
dst_entity = Entity(
|
|
342
|
-
target_platform,
|
|
343
|
-
target_version,
|
|
344
|
-
namespace,
|
|
345
|
-
base_name,
|
|
346
|
-
0.0,
|
|
347
|
-
0.0,
|
|
348
|
-
0.0,
|
|
349
|
-
create_nbt(
|
|
350
|
-
"",
|
|
351
|
-
CompoundTag,
|
|
352
|
-
dst.nbt,
|
|
353
|
-
# dst_spec.nbt.snbt,
|
|
354
|
-
),
|
|
355
|
-
)
|
|
356
|
-
|
|
357
|
-
return dst_entity, None, dst.extra_needed, dst.cacheable
|
|
358
|
-
|
|
359
|
-
else:
|
|
360
|
-
raise RuntimeError
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
TranslationClsT = TypeVar(
|
|
364
|
-
"TranslationClsT", BlockToUniversalTranslator, BlockFromUniversalTranslator
|
|
365
|
-
)
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
def _read_file(path: str) -> str:
|
|
369
|
-
with open(path) as f:
|
|
370
|
-
return f.read()
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
def load_json_block_translations(
|
|
374
|
-
version_path: str,
|
|
375
|
-
block_format: str,
|
|
376
|
-
direction: str,
|
|
377
|
-
translation_cls: Type[TranslationClsT],
|
|
378
|
-
get_src_spec: Callable[[str, str], BlockSpec],
|
|
379
|
-
target_version: GameVersion,
|
|
380
|
-
) -> dict[tuple[str, str], TranslationClsT]:
|
|
381
|
-
translations = dict[tuple[str, str], TranslationClsT]()
|
|
382
|
-
paths = glob.glob(
|
|
383
|
-
os.path.join(
|
|
384
|
-
glob.escape(version_path),
|
|
385
|
-
"block",
|
|
386
|
-
block_format,
|
|
387
|
-
direction,
|
|
388
|
-
"*",
|
|
389
|
-
"*",
|
|
390
|
-
"*.json",
|
|
391
|
-
)
|
|
392
|
-
)
|
|
393
|
-
with ThreadPoolExecutor() as e:
|
|
394
|
-
for file_path, data in zip(paths, e.map(_read_file, paths)):
|
|
395
|
-
*_, namespace, _, base_name = os.path.splitext(os.path.normpath(file_path))[
|
|
396
|
-
0
|
|
397
|
-
].split(os.sep)
|
|
398
|
-
translations[(namespace, base_name)] = translation_cls(
|
|
399
|
-
get_src_spec(namespace, base_name),
|
|
400
|
-
translation_function_from_json(json.loads(data)),
|
|
401
|
-
target_version,
|
|
402
|
-
)
|
|
403
|
-
return translations
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
class EntityToUniversalTranslator:
|
|
407
|
-
def run(
|
|
408
|
-
self,
|
|
409
|
-
entity: Entity,
|
|
410
|
-
extra: (
|
|
411
|
-
tuple[
|
|
412
|
-
BlockCoordinates,
|
|
413
|
-
Callable[[BlockCoordinates], tuple[Block, BlockEntity | None]],
|
|
414
|
-
]
|
|
415
|
-
| None
|
|
416
|
-
),
|
|
417
|
-
) -> tuple[Block, BlockEntity | None, bool, bool]:
|
|
418
|
-
raise NotImplementedError
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
class EntityFromUniversalTranslator:
|
|
422
|
-
def run(
|
|
423
|
-
self,
|
|
424
|
-
entity: Entity | None,
|
|
425
|
-
extra: (
|
|
426
|
-
tuple[
|
|
427
|
-
BlockCoordinates,
|
|
428
|
-
Callable[[BlockCoordinates], tuple[Block, BlockEntity | None]],
|
|
429
|
-
]
|
|
430
|
-
| None
|
|
431
|
-
),
|
|
432
|
-
) -> tuple[Block, BlockEntity | None, bool] | tuple[Entity, None, bool]:
|
|
433
|
-
raise NotImplementedError
|
amulet/img/__init__.py
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def _get_path(file: str) -> str:
|
|
5
|
-
return os.path.abspath(os.path.join(os.path.dirname(__file__), file))
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
missing_no_icon_path = _get_path("missing_no.png")
|
|
9
|
-
missing_pack_icon_path = _get_path("missing_pack.png")
|
|
10
|
-
missing_world_icon_path = _get_path("missing_world.png")
|
amulet/img/missing_no.png
DELETED
|
Binary file
|
amulet/img/missing_pack.png
DELETED
|
Binary file
|
amulet/img/missing_world.png
DELETED
|
Binary file
|
amulet/io/binary_reader.hpp
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <string>
|
|
4
|
-
#include <cstdint>
|
|
5
|
-
#include <cstring>
|
|
6
|
-
#include <algorithm>
|
|
7
|
-
#include <bit>
|
|
8
|
-
#include <functional>
|
|
9
|
-
#include <stdexcept>
|
|
10
|
-
#include <memory>
|
|
11
|
-
|
|
12
|
-
#include <amulet_nbt/io/binary_reader.hpp>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
namespace Amulet {
|
|
16
|
-
class BinaryReader: public AmuletNBT::BinaryReader {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
public:
|
|
20
|
-
BinaryReader(
|
|
21
|
-
const std::string& input,
|
|
22
|
-
size_t& position
|
|
23
|
-
) : AmuletNBT::BinaryReader(input, position, std::endian::little, [](const std::string& value) {return value; }) {}
|
|
24
|
-
|
|
25
|
-
std::string readSizeAndBytes() {
|
|
26
|
-
std::uint64_t length;
|
|
27
|
-
readNumericInto<std::uint64_t>(length);
|
|
28
|
-
// Ensure the buffer is long enough
|
|
29
|
-
if (position + length > data.size()) {
|
|
30
|
-
throw std::out_of_range("Cannot read string of length " + std::to_string(length) + " at position " + std::to_string(position));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
std::string value = data.substr(position, length);
|
|
34
|
-
position += length;
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
template <class T>
|
|
40
|
-
std::shared_ptr<T> deserialise(const std::string& data){
|
|
41
|
-
size_t position = 0;
|
|
42
|
-
BinaryReader reader(data, position);
|
|
43
|
-
return T::deserialise(reader);
|
|
44
|
-
}
|
|
45
|
-
}
|
amulet/io/binary_writer.hpp
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <string>
|
|
4
|
-
#include <cstdint>
|
|
5
|
-
#include <cstring>
|
|
6
|
-
#include <algorithm>
|
|
7
|
-
#include <bit>
|
|
8
|
-
#include <functional>
|
|
9
|
-
|
|
10
|
-
#include <amulet_nbt/io/binary_writer.hpp>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
namespace Amulet {
|
|
14
|
-
class BinaryWriter: public AmuletNBT::BinaryWriter {
|
|
15
|
-
public:
|
|
16
|
-
BinaryWriter(): AmuletNBT::BinaryWriter(std::endian::little, [](const std::string& value) {return value; }) {}
|
|
17
|
-
|
|
18
|
-
void writeSizeAndBytes(const std::string& value) {
|
|
19
|
-
writeNumeric<std::uint64_t>(value.size());
|
|
20
|
-
data.append(value);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
template <typename T>
|
|
25
|
-
std::string serialise(const T& obj){
|
|
26
|
-
BinaryWriter writer;
|
|
27
|
-
obj.serialise(writer);
|
|
28
|
-
return writer.getBuffer();
|
|
29
|
-
}
|
|
30
|
-
}
|
amulet/item.py
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# from amulet_nbt import CompoundTag, StringTag
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
# class Item(CompoundTag):
|
|
5
|
-
# """
|
|
6
|
-
# {
|
|
7
|
-
# "namespace": StringTag,
|
|
8
|
-
# "base_name": StringTag,
|
|
9
|
-
# "metadata": CompoundTag
|
|
10
|
-
# }
|
|
11
|
-
# """
|
|
12
|
-
#
|
|
13
|
-
# def __init__(self, namespace: str, base_name: str, metadata: dict = None) -> None:
|
|
14
|
-
# super().__init__(
|
|
15
|
-
# {
|
|
16
|
-
# "namespace": StringTag(namespace),
|
|
17
|
-
# "base_name": StringTag(base_name),
|
|
18
|
-
# "metadata": CompoundTag(metadata or {}),
|
|
19
|
-
# }
|
|
20
|
-
# )
|
|
21
|
-
#
|
|
22
|
-
# @property
|
|
23
|
-
# def namespace(self) -> str:
|
|
24
|
-
# return self.get_string("namespace").py_str
|
|
25
|
-
#
|
|
26
|
-
# @property
|
|
27
|
-
# def base_name(self) -> str:
|
|
28
|
-
# return self.get_string("base_name").py_str
|
|
29
|
-
#
|
|
30
|
-
# @property
|
|
31
|
-
# def metadata(self) -> CompoundTag:
|
|
32
|
-
# return self.get_compound("metadata")
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
# class BlockItem(CompoundTag):
|
|
36
|
-
# """
|
|
37
|
-
# {
|
|
38
|
-
# "namespace": StringTag,
|
|
39
|
-
# "base_name": StringTag,
|
|
40
|
-
# "properties": CompoundTag
|
|
41
|
-
# "metadata": CompoundTag
|
|
42
|
-
# }
|
|
43
|
-
# """
|
|
44
|
-
#
|
|
45
|
-
# def __init__(
|
|
46
|
-
# self,
|
|
47
|
-
# namespace: str,
|
|
48
|
-
# base_name: str,
|
|
49
|
-
# properties: dict = None,
|
|
50
|
-
# metadata: dict = None,
|
|
51
|
-
# ):
|
|
52
|
-
# super().__init__(
|
|
53
|
-
# {
|
|
54
|
-
# "namespace": StringTag(namespace),
|
|
55
|
-
# "base_name": StringTag(base_name),
|
|
56
|
-
# "properties": CompoundTag(properties or {}),
|
|
57
|
-
# "metadata": CompoundTag(metadata or {}),
|
|
58
|
-
# }
|
|
59
|
-
# )
|
|
60
|
-
#
|
|
61
|
-
# @property
|
|
62
|
-
# def namespace(self) -> str:
|
|
63
|
-
# return self.get_string("namespace").py_str
|
|
64
|
-
#
|
|
65
|
-
# @property
|
|
66
|
-
# def base_name(self) -> str:
|
|
67
|
-
# return self.get_string("base_name").py_str
|
|
68
|
-
#
|
|
69
|
-
# @property
|
|
70
|
-
# def properties(self) -> CompoundTag:
|
|
71
|
-
# return self.get_compound("properties")
|
|
72
|
-
#
|
|
73
|
-
# @property
|
|
74
|
-
# def metadata(self) -> CompoundTag:
|
|
75
|
-
# return self.get_compound("metadata")
|
amulet/level/__init__.pyi
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from amulet.level._load import (
|
|
4
|
-
NoValidLevel,
|
|
5
|
-
get_level,
|
|
6
|
-
register_level_class,
|
|
7
|
-
unregister_level_class,
|
|
8
|
-
)
|
|
9
|
-
from amulet.level.abc._level._level import Level
|
|
10
|
-
from amulet.level.java._level import JavaLevel
|
|
11
|
-
|
|
12
|
-
from . import _load, abc, java
|
|
13
|
-
|
|
14
|
-
__all__ = [
|
|
15
|
-
"JavaLevel",
|
|
16
|
-
"Level",
|
|
17
|
-
"NoValidLevel",
|
|
18
|
-
"abc",
|
|
19
|
-
"get_level",
|
|
20
|
-
"java",
|
|
21
|
-
"register_level_class",
|
|
22
|
-
"unregister_level_class",
|
|
23
|
-
]
|