Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions beet/library/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,18 @@
SupportsMerge,
)
from beet.core.file import File, FileOrigin, JsonFile, PngFile
from beet.core.utils import FileSystemPath, JsonDict, SupportedFormats, TextComponent
from beet.core.utils import (
FileSystemPath,
JsonDict,
SupportedFormats,
TextComponent,
)
from beet.resources.pack_format_registry import PackFormatRegistryContainer
from beet.toolchain.config import FormatSpecifier

from .utils import list_extensions, list_origin_folders

LATEST_MINECRAFT_VERSION: str = "1.21"
LATEST_MINECRAFT_VERSION: str = "1.21.10"


T = TypeVar("T")
Expand Down Expand Up @@ -1012,7 +1018,7 @@ class Pack(MatchMixin, MergeMixin, Container[str, NamespaceType]):

namespace_type: ClassVar[Type[Namespace]]
default_name: ClassVar[str]
pack_format_registry: ClassVar[Dict[Tuple[int, ...], int | FormatSpecifier]]
pack_format_registry: ClassVar[PackFormatRegistryContainer]
latest_pack_format: ClassVar[int | FormatSpecifier]
pack_format_switch_format: ClassVar[int]

Expand Down
19 changes: 6 additions & 13 deletions beet/library/data_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
TextFileBase,
TextFileContent,
)
from beet.core.utils import JsonDict, extra_field, split_version
from beet.core.utils import JsonDict, extra_field
from beet.resources.pack_format_registry import PackFormatRegistryContainer

from .base import (
LATEST_MINECRAFT_VERSION,
Expand Down Expand Up @@ -648,19 +649,11 @@ class DataPack(Pack[DataPackNamespace]):

default_name = "untitled_data_pack"

pack_format_registry = {
(1, 13): 4,
(1, 14): 4,
(1, 15): 5,
(1, 16): 6,
(1, 17): 7,
(1, 18): 9,
(1, 19): 12,
(1, 20): 41,
(1, 21): (88, 0),
}
latest_pack_format = pack_format_registry[split_version(LATEST_MINECRAFT_VERSION)]
pack_format_switch_format = 82
pack_format_registry = PackFormatRegistryContainer(
pack_format_switch_format, "data_pack"
)
latest_pack_format = pack_format_registry[LATEST_MINECRAFT_VERSION]

# fmt: off
advancements: NamespaceProxyDescriptor[Advancement] = NamespaceProxyDescriptor(Advancement)
Expand Down
27 changes: 7 additions & 20 deletions beet/library/resource_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
from dataclasses import dataclass
from typing import Any, ClassVar, Dict, Optional, Type

from beet.resources.pack_format_registry import PackFormatRegistryContainer

try:
from PIL.Image import Image
except ImportError:
Image = Any

from beet.core.file import BinaryFile, BinaryFileContent, JsonFile, PngFile, TextFile
from beet.core.utils import JsonDict, extra_field, split_version
from beet.core.utils import JsonDict, extra_field

from .base import (
LATEST_MINECRAFT_VERSION,
Expand Down Expand Up @@ -373,26 +375,11 @@ class ResourcePack(Pack[ResourcePackNamespace]):

default_name = "untitled_resource_pack"

pack_format_registry = {
(1, 6): 1,
(1, 7): 1,
(1, 8): 1,
(1, 9): 2,
(1, 10): 2,
(1, 11): 3,
(1, 12): 3,
(1, 13): 4,
(1, 14): 4,
(1, 15): 5,
(1, 16): 6,
(1, 17): 7,
(1, 18): 8,
(1, 19): 13,
(1, 20): 32,
(1, 21): (69, 0),
}
latest_pack_format = pack_format_registry[split_version(LATEST_MINECRAFT_VERSION)]
pack_format_switch_format = 65
pack_format_registry = PackFormatRegistryContainer(
pack_format_switch_format, "resource_pack"
)
latest_pack_format = pack_format_registry[LATEST_MINECRAFT_VERSION]

language_config = McmetaPin[Dict[str, JsonDict]]("language", default_factory=dict)

Expand Down
Empty file added beet/resources/__init__.py
Empty file.
Loading