Skip to content

Commit

Permalink
fix: enable interpolation for uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Jul 25, 2022
1 parent 0b58274 commit 39cc462
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions bolt/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def get_bolt_helpers() -> Dict[str, Any]:
"interpolate_range": converter(AstRange.from_value),
"interpolate_resource_location": converter(AstResourceLocation.from_value),
"interpolate_item_slot": converter(AstItemSlot.from_value),
"interpolate_uuid": converter(AstUUID.from_value),
"interpolate_objective": converter(AstObjective.from_value),
"interpolate_objective_criteria": converter(AstObjectiveCriteria.from_value),
"interpolate_scoreboard_slot": converter(AstScoreboardSlot.from_value),
Expand Down
1 change: 1 addition & 0 deletions bolt/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ def get_bolt_parsers(
"item_slot": InterpolationParser(
"item_slot", parsers["item_slot"], fallback=True
),
"uuid": InterpolationParser("uuid", parsers["uuid"]),
"objective": InterpolationParser("objective", parsers["objective"]),
"objective_criteria": InterpolationParser(
"objective_criteria", parsers["objective_criteria"]
Expand Down
3 changes: 3 additions & 0 deletions examples/bolt_basic/src/data/demo/functions/foo.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -662,3 +662,6 @@ rd = Random()
rd.seed(42)
random_id = UUID(int=rd.getrandbits(128))
whitelist add random_id

other_id = UUID(int=rd.getrandbits(128))
attribute @s minecraft:generic.attack_speed modifier add other_id "double" 0.5 multiply
1 change: 1 addition & 0 deletions tests/snapshots/examples__build_bolt_basic__0.pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ say AstCommand(identifier='tellraw:targets:message', arguments=AstChildren((AstS
say tellraw @p "hello"
execute as 00000001-0002-0003-0405-000000000006 run function test:test
whitelist add bdd640fb-0667-1ad1-1c80-317fa3b1799d
attribute @s minecraft:generic.attack_speed modifier add 23b8c1e9-3924-56de-3eb1-3b9046685257 double 0.5 multiply
```

`@function demo:import_a`
Expand Down

0 comments on commit 39cc462

Please sign in to comment.