From 2a8f9e0de038829fafdad234d44713db39fa0286 Mon Sep 17 00:00:00 2001 From: Valentin Berlier Date: Fri, 29 Mar 2024 01:02:07 +0100 Subject: [PATCH] fix: interpolation for item_slots --- bolt/parse.py | 3 +++ poetry.lock | 8 ++++---- pyproject.toml | 2 +- tests/snapshots/bolt__parse_103__0.txt | 2 ++ tests/snapshots/bolt__parse_103__1.txt | 2 ++ tests/snapshots/bolt__parse_166__0.txt | 2 ++ tests/snapshots/bolt__parse_205__0.txt | 2 ++ tests/snapshots/bolt__parse_205__1.txt | 2 ++ tests/snapshots/bolt__parse_206__0.txt | 2 ++ tests/snapshots/bolt__parse_206__1.txt | 2 ++ 10 files changed, 22 insertions(+), 5 deletions(-) diff --git a/bolt/parse.py b/bolt/parse.py index f5c194c..a2ed37a 100644 --- a/bolt/parse.py +++ b/bolt/parse.py @@ -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"]] diff --git a/poetry.lock b/poetry.lock index 52ca2e9..00d425c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -715,14 +715,14 @@ files = [ [[package]] name = "mecha" -version = "0.89.1" +version = "0.91.0" description = "A powerful Minecraft command library" category = "main" optional = false python-versions = ">=3.10,<4.0" files = [ - {file = "mecha-0.89.1-py3-none-any.whl", hash = "sha256:9f668b2256696189ea453fa622ec7705c428eff287cfd77eb02e924c38ec6595"}, - {file = "mecha-0.89.1.tar.gz", hash = "sha256:20973f03859410db25678e897cafcb538ef3f171c6bb82bad9f697f7af2e53cd"}, + {file = "mecha-0.91.0-py3-none-any.whl", hash = "sha256:85f9b56c16c9600737e54580403a0bc4c4ab72887578549b17e9f0750c747d80"}, + {file = "mecha-0.91.0.tar.gz", hash = "sha256:ffb28a8e4223e84f325eb387098c8572620fc05d922ec6507b726f193581b2ce"}, ] [package.dependencies] @@ -1582,4 +1582,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "66bd3d661a8841572f7b363db9f297085646417af3314b5566f59cd8062f0c65" +content-hash = "4acdf67d15690c0df07b01f5665485acdc62006170f24b756517ec406ea36287" diff --git a/pyproject.toml b/pyproject.toml index 934fcdd..4b5d955 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tests/snapshots/bolt__parse_103__0.txt b/tests/snapshots/bolt__parse_103__0.txt index 17864e0..babad99 100644 --- a/tests/snapshots/bolt__parse_103__0.txt +++ b/tests/snapshots/bolt__parse_103__0.txt @@ -125,6 +125,8 @@ as @a at @s if block ~ ~-1 ~ #wool give @s stone{ is_tag: False namespace: None path: 'stone' + components: + data_tags: location: SourceLocation(pos=90, lineno=2, colno=49) diff --git a/tests/snapshots/bolt__parse_103__1.txt b/tests/snapshots/bolt__parse_103__1.txt index 4156fb3..2376538 100644 --- a/tests/snapshots/bolt__parse_103__1.txt +++ b/tests/snapshots/bolt__parse_103__1.txt @@ -71,6 +71,8 @@ _bolt_refs[6] end_location: SourceLocation(pos=210, lineno=9, colno=2) identifier: + components: + data_tags: _bolt_refs[7] diff --git a/tests/snapshots/bolt__parse_166__0.txt b/tests/snapshots/bolt__parse_166__0.txt index 0278af8..1c93323 100644 --- a/tests/snapshots/bolt__parse_166__0.txt +++ b/tests/snapshots/bolt__parse_166__0.txt @@ -44,6 +44,8 @@ item replace block ~ ~2 ~ container.26 with minecraft:spruce_sapling 4 is_tag: False namespace: 'minecraft' path: 'spruce_sapling' + components: + data_tags: None location: SourceLocation(pos=69, lineno=1, colno=70) diff --git a/tests/snapshots/bolt__parse_205__0.txt b/tests/snapshots/bolt__parse_205__0.txt index 5124529..3ea4ab7 100644 --- a/tests/snapshots/bolt__parse_205__0.txt +++ b/tests/snapshots/bolt__parse_205__0.txt @@ -60,6 +60,8 @@ give @s bow{**bow_data} is_tag: False namespace: None path: 'bow' + components: + data_tags: location: SourceLocation(pos=43, lineno=2, colno=12) diff --git a/tests/snapshots/bolt__parse_205__1.txt b/tests/snapshots/bolt__parse_205__1.txt index e6dddc2..edefb28 100644 --- a/tests/snapshots/bolt__parse_205__1.txt +++ b/tests/snapshots/bolt__parse_205__1.txt @@ -35,6 +35,8 @@ _bolt_refs[2] end_location: SourceLocation(pos=55, lineno=2, colno=24) identifier: + components: + data_tags: _bolt_refs[3] diff --git a/tests/snapshots/bolt__parse_206__0.txt b/tests/snapshots/bolt__parse_206__0.txt index 3da0656..6c34f4c 100644 --- a/tests/snapshots/bolt__parse_206__0.txt +++ b/tests/snapshots/bolt__parse_206__0.txt @@ -86,6 +86,8 @@ give @s stone{CanPlaceOn: [*stone_can_place_on], **custom_model_data} is_tag: False namespace: None path: 'stone' + components: + data_tags: location: SourceLocation(pos=94, lineno=3, colno=14) diff --git a/tests/snapshots/bolt__parse_206__1.txt b/tests/snapshots/bolt__parse_206__1.txt index 28e9ab7..d04c494 100644 --- a/tests/snapshots/bolt__parse_206__1.txt +++ b/tests/snapshots/bolt__parse_206__1.txt @@ -64,6 +64,8 @@ _bolt_refs[5] end_location: SourceLocation(pos=150, lineno=3, colno=70) identifier: + components: + data_tags: _bolt_refs[6]