From e4338b0f4004601daf9c86b169a3771f876cff16 Mon Sep 17 00:00:00 2001 From: Valentin Berlier Date: Mon, 24 Oct 2022 21:27:00 +0200 Subject: [PATCH] feat: interpolate advancement predicate --- bolt/helpers.py | 4 ++++ bolt/parse.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/bolt/helpers.py b/bolt/helpers.py index fb1b9a7..3423797 100644 --- a/bolt/helpers.py +++ b/bolt/helpers.py @@ -11,6 +11,7 @@ from uuid import UUID from mecha import ( + AstAdvancementPredicate, AstBool, AstChildren, AstColor, @@ -85,6 +86,9 @@ def get_bolt_helpers() -> Dict[str, Any]: "interpolate_scoreboard_slot": converter(AstScoreboardSlot.from_value), "interpolate_swizzle": converter(AstSwizzle.from_value), "interpolate_team": converter(AstTeam.from_value), + "interpolate_advancement_predicate": converter( + AstAdvancementPredicate.from_value + ), "interpolate_color": converter(AstColor.from_value), "interpolate_sort_order": converter(AstSortOrder.from_value), "interpolate_gamemode": converter(AstGamemode.from_value), diff --git a/bolt/parse.py b/bolt/parse.py index faeb576..efc81cb 100644 --- a/bolt/parse.py +++ b/bolt/parse.py @@ -450,6 +450,12 @@ def get_bolt_parsers( [parsers["swizzle"], InterpolationParser("swizzle")] ), "team": AlternativeParser([InterpolationParser("team"), parsers["team"]]), + "advancement_predicate": AlternativeParser( + [ + InterpolationParser("advancement_predicate"), + parsers["advancement_predicate"], + ] + ), "color": AlternativeParser([InterpolationParser("color"), parsers["color"]]), "sort_order": AlternativeParser( [parsers["sort_order"], InterpolationParser("sort_order")]