beet icon indicating copy to clipboard operation
beet copied to clipboard

1.21 fixes from the nuclear nexus branch

Open edayot opened this issue 1 year ago • 0 comments

Based on TheNuclearNexus dynamic support, another approach with dict instead of tuples. No more hardcoded values inside the datapack class.

Old scope definition :

class DamageType(JsonFile):
    """Class representing a damage type."""

    scope: ClassVar[Tuple[str, ...] | Dict[int, Tuple[str, ...]]] = ("damage_type",)
    extension: ClassVar[str] = ".json"

New scope definition :

class Advancement(JsonFile):
    """Class representing an advancement."""

    scope: ClassVar[Tuple[str, ...] | Dict[int, Tuple[str, ...]]] = {
        0: ("advancements",),
        45: ("advancement",),
    }
    extension: ClassVar[str] = ".json"

We have all future renames needed with the exact pack_version affected (assuming there is no conflict in future versions) while preserving the old & the new syntax.

edayot avatar Jul 08 '24 17:07 edayot