Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change variable name in bs.sidebar:create #301

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/_templates/changelog/v3.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@
### `🎯 bs.hitbox`

- <abbr title="New Features">✨</abbr> **[#285](https://github.com/mcbookshelf/Bookshelf/pull/285)** - Introduced a `#bs.hitbox:is_sized` tag for improved hitbox management.


### `📰 bs.sidebar`

- <abbr title="Bug fix">🐛</abbr> **[#301](https://github.com/mcbookshelf/Bookshelf/pull/301)** Fixed the issue where `bs.sidebar:create` was not functioning correctly.
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ execute unless score #s bs.ctx matches 1 run return run function #bs.log:error {
}

# check that the contents have between 1 and 15 entries
execute store result score #l bs.ctx if data storage bs:ctx _.contents[]
execute unless score #l bs.ctx matches 1..15 run return run function #bs.log:error { \
execute store result score #s bs.ctx if data storage bs:ctx _.contents[]
execute unless score #s bs.ctx matches 1..15 run return run function #bs.log:error { \
namespace: "bs.sidebar", \
path: "#bs.sidebar:create", \
tag: "create", \
message: '[{"text":"The contents must have between 1 and 15 lines (","color":"red"},{"score":{"name":"#l","objective":"bs.ctx"}},{"text":" given)."}]', \
message: '[{"text":"The contents must have between 1 and 15 lines (","color":"red"},{"score":{"name":"#s","objective":"bs.ctx"}},{"text":" given)."}]', \
}

# start the recursion to create each line abort if a line failed
execute as B5-0-0-0-2 run function bs.sidebar:create/recurse/start with storage bs:ctx _
data remove entity @s CustomName
execute if score #l bs.ctx = #i bs.ctx run return 1
execute if score #s bs.ctx = #i bs.ctx run return 1
return run function bs.sidebar:create/recurse/abort with storage bs:ctx _
3 changes: 3 additions & 0 deletions modules/bs.sidebar/data/bs.sidebar/tags/function/create.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"authors": [
"Aksiome"
],
"contributors": [
"runoshun"
],
"created": {
"date": "2023/08/18",
"minecraft_version": "23w32a"
Expand Down
Loading