Skip to content

Commit

Permalink
fix: interpolation for item_slots
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Mar 29, 2024
1 parent 9040ff1 commit 2a8f9e0
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 5 deletions.
3 changes: 3 additions & 0 deletions bolt/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ def get_bolt_parsers(
"item_slot": AlternativeParser(
[parsers["item_slot"], InterpolationParser("item_slot")]
),
"item_slots": AlternativeParser(
[parsers["item_slots"], InterpolationParser("item_slots")]
),
"uuid": AlternativeParser([InterpolationParser("uuid"), parsers["uuid"]]),
"objective": AlternativeParser(
[InterpolationParser("objective"), parsers["objective"]]
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include = ["bolt/py.typed"]
[tool.poetry.dependencies]
python = "^3.10"
beet = ">=0.104"
mecha = ">=0.89.1"
mecha = ">=0.91.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.0.1"
Expand Down
2 changes: 2 additions & 0 deletions tests/snapshots/bolt__parse_103__0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ as @a at @s if block ~ ~-1 ~ #wool give @s stone{
is_tag: False
namespace: None
path: 'stone'
components:
<empty>
data_tags:
<class 'mecha.ast.AstNbtCompound'>
location: SourceLocation(pos=90, lineno=2, colno=49)
Expand Down
2 changes: 2 additions & 0 deletions tests/snapshots/bolt__parse_103__1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ _bolt_refs[6]
end_location: SourceLocation(pos=210, lineno=9, colno=2)
identifier:
<class 'mecha.ast.AstResourceLocation'>
components:
<empty>
data_tags:
<class 'mecha.ast.AstNbtCompound'>
_bolt_refs[7]
Expand Down
2 changes: 2 additions & 0 deletions tests/snapshots/bolt__parse_166__0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ item replace block ~ ~2 ~ container.26 with minecraft:spruce_sapling 4
is_tag: False
namespace: 'minecraft'
path: 'spruce_sapling'
components:
<empty>
data_tags: None
<class 'mecha.ast.AstNumber'>
location: SourceLocation(pos=69, lineno=1, colno=70)
Expand Down
2 changes: 2 additions & 0 deletions tests/snapshots/bolt__parse_205__0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ give @s bow{**bow_data}
is_tag: False
namespace: None
path: 'bow'
components:
<empty>
data_tags:
<class 'mecha.ast.AstNbtCompound'>
location: SourceLocation(pos=43, lineno=2, colno=12)
Expand Down
2 changes: 2 additions & 0 deletions tests/snapshots/bolt__parse_205__1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ _bolt_refs[2]
end_location: SourceLocation(pos=55, lineno=2, colno=24)
identifier:
<class 'mecha.ast.AstResourceLocation'>
components:
<empty>
data_tags:
<class 'mecha.ast.AstNbtCompound'>
_bolt_refs[3]
Expand Down
2 changes: 2 additions & 0 deletions tests/snapshots/bolt__parse_206__0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ give @s stone{CanPlaceOn: [*stone_can_place_on], **custom_model_data}
is_tag: False
namespace: None
path: 'stone'
components:
<empty>
data_tags:
<class 'mecha.ast.AstNbtCompound'>
location: SourceLocation(pos=94, lineno=3, colno=14)
Expand Down
2 changes: 2 additions & 0 deletions tests/snapshots/bolt__parse_206__1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ _bolt_refs[5]
end_location: SourceLocation(pos=150, lineno=3, colno=70)
identifier:
<class 'mecha.ast.AstResourceLocation'>
components:
<empty>
data_tags:
<class 'mecha.ast.AstNbtCompound'>
_bolt_refs[6]
Expand Down

0 comments on commit 2a8f9e0

Please sign in to comment.