Skip to content

Commit

Permalink
feat: interpolate advancement predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Oct 24, 2022
1 parent 44c2d0e commit e4338b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bolt/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from uuid import UUID

from mecha import (
AstAdvancementPredicate,
AstBool,
AstChildren,
AstColor,
Expand Down Expand Up @@ -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),
Expand Down
6 changes: 6 additions & 0 deletions bolt/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit e4338b0

Please sign in to comment.