mcbeet / beet

The Minecraft pack development kit.
https://mcbeet.dev
MIT License
140 stars 14 forks source link

1.21 fixes from the nuclear nexus branch #442

Closed edayot closed 4 months ago

edayot commented 4 months ago

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[NamespaceFileScope] = ("damage_type",)
    extension: ClassVar[str] = ".json"

New scope definition :

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

    scope: ClassVar[NamespaceFileScope] = {
        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.

Stoupy51 commented 4 months ago

Up

edayot commented 4 months ago

Checking the action logs, it's only a formmating issue, i hate myself

vberlier commented 4 months ago

Sorry for not getting on to this sooner! This looks really good, that's basically how I would have done it as well! I tweaked a few minor things and enabled 1.21 as the latest default version. Thanks!