beet
beet copied to clipboard
1.21 fixes from the nuclear nexus branch
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.