amulet-core 2.0a7__cp311-cp311-win_amd64.whl → 2.0.1a2.post250529084738__cp311-cp311-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.cp311-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.1a2.post250529084738.dist-info}/METADATA +25 -20
- amulet_core-2.0.1a2.post250529084738.dist-info/RECORD +45 -0
- {amulet_core-2.0a7.dist-info → amulet_core-2.0.1a2.post250529084738.dist-info}/WHEEL +1 -1
- amulet_core-2.0.1a2.post250529084738.dist-info/entry_points.txt +2 -0
- amulet/__init__.cp311-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.1a2.post250529084738.dist-info}/top_level.txt +0 -0
amulet/game/java/_biome.py
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
from collections.abc import Mapping, Collection
|
|
2
|
-
|
|
3
|
-
from amulet.biome import Biome
|
|
4
|
-
from amulet.game.abc import DatabaseBiomeData, BiomeDataNumericalComponent
|
|
5
|
-
from amulet.game.abc import GameVersion
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class JavaBiomeData(DatabaseBiomeData, BiomeDataNumericalComponent):
|
|
9
|
-
def __init__(
|
|
10
|
-
self,
|
|
11
|
-
game_version: GameVersion,
|
|
12
|
-
biomes: Mapping[str, Collection[str]],
|
|
13
|
-
to_universal: Mapping[tuple[str, str], Biome],
|
|
14
|
-
from_universal: Mapping[Biome, tuple[str, str]],
|
|
15
|
-
numerical_map: Mapping[int, tuple[str, str]],
|
|
16
|
-
):
|
|
17
|
-
super().__init__(game_version, biomes, to_universal, from_universal)
|
|
18
|
-
self._num_to_str = numerical_map
|
|
19
|
-
self._str_to_num = {v: k for k, v in self._num_to_str.items()}
|
|
20
|
-
|
|
21
|
-
def __getstate__(self) -> dict:
|
|
22
|
-
state = super().__getstate__()
|
|
23
|
-
state["_num_to_str"] = self._num_to_str
|
|
24
|
-
return state
|
|
25
|
-
|
|
26
|
-
def __setstate__(self, state: dict) -> None:
|
|
27
|
-
super().__setstate__(state)
|
|
28
|
-
self._num_to_str = state["_num_to_str"]
|
|
29
|
-
self._str_to_num = {v: k for k, v in self._num_to_str.items()}
|
|
30
|
-
|
|
31
|
-
def numerical_id_to_namespace_id(self, numerical_id: int) -> tuple[str, str]:
|
|
32
|
-
return self._num_to_str[numerical_id]
|
|
33
|
-
|
|
34
|
-
def namespace_id_to_numerical_id(self, namespace: str, base_name: str) -> int:
|
|
35
|
-
return self._str_to_num[(namespace, base_name)]
|
amulet/game/java/_block.py
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from enum import IntEnum
|
|
3
|
-
from collections.abc import Mapping
|
|
4
|
-
from typing import TYPE_CHECKING
|
|
5
|
-
|
|
6
|
-
from amulet.game.abc import (
|
|
7
|
-
DatabaseBlockData,
|
|
8
|
-
BlockDataNumericalComponent,
|
|
9
|
-
BlockSpec,
|
|
10
|
-
)
|
|
11
|
-
from amulet.game.translate import (
|
|
12
|
-
BlockToUniversalTranslator,
|
|
13
|
-
BlockFromUniversalTranslator,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
if TYPE_CHECKING:
|
|
17
|
-
from ._version import JavaGameVersion
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class Waterloggable(IntEnum):
|
|
21
|
-
No = 0
|
|
22
|
-
Yes = 1
|
|
23
|
-
Always = 2
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class JavaBlockData(DatabaseBlockData, BlockDataNumericalComponent):
|
|
27
|
-
def __init__(
|
|
28
|
-
self,
|
|
29
|
-
game_version: JavaGameVersion,
|
|
30
|
-
specification: Mapping[str, Mapping[str, BlockSpec]],
|
|
31
|
-
to_universal: Mapping[tuple[str, str], BlockToUniversalTranslator],
|
|
32
|
-
from_universal: Mapping[tuple[str, str], BlockFromUniversalTranslator],
|
|
33
|
-
numerical_map: Mapping[int, tuple[str, str]],
|
|
34
|
-
waterloggable: Mapping[tuple[str, str], Waterloggable],
|
|
35
|
-
):
|
|
36
|
-
super().__init__(game_version, specification, to_universal, from_universal)
|
|
37
|
-
self._num_to_str = numerical_map
|
|
38
|
-
self._str_to_num = {v: k for k, v in self._num_to_str.items()}
|
|
39
|
-
self._waterloggable = waterloggable
|
|
40
|
-
|
|
41
|
-
def __getstate__(self) -> dict:
|
|
42
|
-
state = super().__getstate__()
|
|
43
|
-
state["_num_to_str"] = self._num_to_str
|
|
44
|
-
state["_waterloggable"] = self._waterloggable
|
|
45
|
-
return state
|
|
46
|
-
|
|
47
|
-
def __setstate__(self, state: dict) -> None:
|
|
48
|
-
super().__setstate__(state)
|
|
49
|
-
self._num_to_str = state["_num_to_str"]
|
|
50
|
-
self._str_to_num = {v: k for k, v in self._num_to_str.items()}
|
|
51
|
-
self._waterloggable = state["_waterloggable"]
|
|
52
|
-
|
|
53
|
-
def numerical_id_to_namespace_id(self, numerical_id: int) -> tuple[str, str]:
|
|
54
|
-
return self._num_to_str[numerical_id]
|
|
55
|
-
|
|
56
|
-
def namespace_id_to_numerical_id(self, namespace: str, base_name: str) -> int:
|
|
57
|
-
return self._str_to_num[(namespace, base_name)]
|
|
58
|
-
|
|
59
|
-
def waterloggable(self, namespace: str, base_name: str) -> Waterloggable:
|
|
60
|
-
return self._waterloggable.get((namespace, base_name), Waterloggable.No)
|
amulet/game/java/_version.py
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from typing import Self
|
|
3
|
-
import os
|
|
4
|
-
import json
|
|
5
|
-
|
|
6
|
-
from amulet.biome import Biome
|
|
7
|
-
from amulet.game import get_game_version
|
|
8
|
-
from amulet.game.abc import GameVersion, load_json_block_spec, load_json_biome_data
|
|
9
|
-
from amulet.game.translate import (
|
|
10
|
-
BlockToUniversalTranslator,
|
|
11
|
-
BlockFromUniversalTranslator,
|
|
12
|
-
load_json_block_translations,
|
|
13
|
-
)
|
|
14
|
-
from amulet.version import VersionNumber
|
|
15
|
-
|
|
16
|
-
from ._block import JavaBlockData, Waterloggable
|
|
17
|
-
from ._biome import JavaBiomeData
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class JavaGameVersion(GameVersion):
|
|
21
|
-
_block: JavaBlockData
|
|
22
|
-
_biome: JavaBiomeData
|
|
23
|
-
|
|
24
|
-
def __init__(
|
|
25
|
-
self,
|
|
26
|
-
min_data_version: VersionNumber,
|
|
27
|
-
max_data_version: VersionNumber,
|
|
28
|
-
min_semantic_version: VersionNumber,
|
|
29
|
-
max_semantic_version: VersionNumber,
|
|
30
|
-
):
|
|
31
|
-
"""Do not use this."""
|
|
32
|
-
self._min_data_version = min_data_version
|
|
33
|
-
self._max_data_version = max_data_version
|
|
34
|
-
self._min_semantic_version = min_semantic_version
|
|
35
|
-
self._max_semantic_version = max_semantic_version
|
|
36
|
-
|
|
37
|
-
@classmethod
|
|
38
|
-
def from_json(cls, version_path: str) -> Self:
|
|
39
|
-
with open(os.path.join(version_path, "__init__.json")) as f:
|
|
40
|
-
init = json.load(f)
|
|
41
|
-
assert init["platform"] == "java"
|
|
42
|
-
min_data_version = VersionNumber(init["data_version"])
|
|
43
|
-
max_data_version = VersionNumber(init["data_version_max"])
|
|
44
|
-
min_semantic_version = VersionNumber(*init["version"])
|
|
45
|
-
max_semantic_version = VersionNumber(*init["version_max"])
|
|
46
|
-
|
|
47
|
-
block_format = init["block_format"]
|
|
48
|
-
universal_version = get_game_version("universal", VersionNumber(1))
|
|
49
|
-
|
|
50
|
-
self = cls(
|
|
51
|
-
min_data_version,
|
|
52
|
-
max_data_version,
|
|
53
|
-
min_semantic_version,
|
|
54
|
-
max_semantic_version,
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
# Load the block specification and translations
|
|
58
|
-
block_spec = load_json_block_spec(version_path, block_format)
|
|
59
|
-
block_to_universal = load_json_block_translations(
|
|
60
|
-
version_path,
|
|
61
|
-
block_format,
|
|
62
|
-
"to_universal",
|
|
63
|
-
BlockToUniversalTranslator,
|
|
64
|
-
lambda namespace, base_name: block_spec[namespace][base_name],
|
|
65
|
-
universal_version,
|
|
66
|
-
)
|
|
67
|
-
block_from_universal = load_json_block_translations(
|
|
68
|
-
version_path,
|
|
69
|
-
block_format,
|
|
70
|
-
"from_universal",
|
|
71
|
-
BlockFromUniversalTranslator,
|
|
72
|
-
universal_version.block.get_specification,
|
|
73
|
-
self,
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
waterloggable = dict[tuple[str, str], Waterloggable]()
|
|
77
|
-
for name, state in (
|
|
78
|
-
("__waterloggable__.json", Waterloggable.Yes),
|
|
79
|
-
("__always_waterlogged__.json", Waterloggable.Always),
|
|
80
|
-
):
|
|
81
|
-
file_path = os.path.join(version_path, name)
|
|
82
|
-
if not os.path.isfile(file_path):
|
|
83
|
-
continue
|
|
84
|
-
with open(file_path) as f:
|
|
85
|
-
blocks: list[str] = json.load(f)
|
|
86
|
-
for block in blocks:
|
|
87
|
-
namespace, base_name = block.split(":", 1)
|
|
88
|
-
waterloggable[(namespace, base_name)] = state
|
|
89
|
-
|
|
90
|
-
numerical_block_map = {}
|
|
91
|
-
file_path = os.path.join(version_path, "__numerical_block_map__.json")
|
|
92
|
-
if os.path.isfile(file_path):
|
|
93
|
-
with open(file_path) as f:
|
|
94
|
-
block_map: dict[str, int] = json.load(f)
|
|
95
|
-
for block_str, block_num in block_map.items():
|
|
96
|
-
namespace, base_name = block_str.split(":", 1)
|
|
97
|
-
numerical_block_map[block_num] = (namespace, base_name)
|
|
98
|
-
|
|
99
|
-
self._block = JavaBlockData(
|
|
100
|
-
self,
|
|
101
|
-
block_spec,
|
|
102
|
-
block_to_universal,
|
|
103
|
-
block_from_universal,
|
|
104
|
-
numerical_block_map,
|
|
105
|
-
waterloggable,
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
biomes, to_universal, from_universal = load_json_biome_data(version_path)
|
|
109
|
-
biome_namespace = dict[str, list[str]]()
|
|
110
|
-
for namespace, base_name in biomes:
|
|
111
|
-
biome_namespace.setdefault(namespace, []).append(base_name)
|
|
112
|
-
|
|
113
|
-
self._biome = JavaBiomeData(
|
|
114
|
-
self,
|
|
115
|
-
biome_namespace,
|
|
116
|
-
{
|
|
117
|
-
biome: Biome(
|
|
118
|
-
"universal",
|
|
119
|
-
VersionNumber(1),
|
|
120
|
-
universal_namespace,
|
|
121
|
-
universal_base_name,
|
|
122
|
-
)
|
|
123
|
-
for (
|
|
124
|
-
biome,
|
|
125
|
-
(universal_namespace, universal_base_name),
|
|
126
|
-
) in to_universal.items()
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
Biome(
|
|
130
|
-
"universal",
|
|
131
|
-
VersionNumber(1),
|
|
132
|
-
universal_namespace,
|
|
133
|
-
universal_base_name,
|
|
134
|
-
): biome
|
|
135
|
-
for (
|
|
136
|
-
(universal_namespace, universal_base_name),
|
|
137
|
-
biome,
|
|
138
|
-
) in from_universal.items()
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
biome_id: biome
|
|
142
|
-
for biome, biome_id in biomes.items()
|
|
143
|
-
if biome_id is not None
|
|
144
|
-
},
|
|
145
|
-
)
|
|
146
|
-
|
|
147
|
-
return self
|
|
148
|
-
|
|
149
|
-
def __repr__(self) -> str:
|
|
150
|
-
return f"JavaGameVersion({self.min_version!r})"
|
|
151
|
-
|
|
152
|
-
def supports_version(self, platform: str, version: VersionNumber) -> bool:
|
|
153
|
-
return platform == "java" and (
|
|
154
|
-
self._min_data_version <= version <= self._max_data_version
|
|
155
|
-
or self._min_semantic_version <= version <= self._max_semantic_version
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
@property
|
|
159
|
-
def platform(self) -> str:
|
|
160
|
-
return "java"
|
|
161
|
-
|
|
162
|
-
@property
|
|
163
|
-
def min_version(self) -> VersionNumber:
|
|
164
|
-
return self._min_data_version
|
|
165
|
-
|
|
166
|
-
@property
|
|
167
|
-
def max_version(self) -> VersionNumber:
|
|
168
|
-
return self._max_data_version
|
|
169
|
-
|
|
170
|
-
@property
|
|
171
|
-
def block(self) -> JavaBlockData:
|
|
172
|
-
return self._block
|
|
173
|
-
|
|
174
|
-
@property
|
|
175
|
-
def biome(self) -> JavaBiomeData:
|
|
176
|
-
return self._biome
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
A package to support translating block and entity data between versions.
|
|
3
|
-
Everything that is not imported into this module is an implementation detail.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
from ._translator import (
|
|
7
|
-
BlockToUniversalTranslator,
|
|
8
|
-
BlockFromUniversalTranslator,
|
|
9
|
-
EntityToUniversalTranslator,
|
|
10
|
-
EntityFromUniversalTranslator,
|
|
11
|
-
load_json_block_translations,
|
|
12
|
-
)
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from .abc import AbstractBaseTranslationFunction
|
|
2
|
-
from ._state import SrcData, SrcDataExtra, StateData, DstData
|
|
3
|
-
from .carry_nbt import CarryNBT
|
|
4
|
-
from .carry_properties import CarryProperties
|
|
5
|
-
from .code import Code
|
|
6
|
-
from .map_block_name import MapBlockName
|
|
7
|
-
from .map_nbt import MapNBT
|
|
8
|
-
from .map_properties import MapProperties
|
|
9
|
-
from .multiblock import MultiBlock
|
|
10
|
-
from .new_block import NewBlock
|
|
11
|
-
from .new_entity import NewEntity
|
|
12
|
-
from .new_nbt import NewNBT
|
|
13
|
-
from .new_properties import NewProperties
|
|
14
|
-
from .sequence import TranslationFunctionSequence
|
|
15
|
-
from .walk_input_nbt import WalkInputNBT
|
|
File without changes
|