From eac23787b8b8c243b09d3c27eedd95b8c4bca7a4 Mon Sep 17 00:00:00 2001 From: runoshun Date: Mon, 6 Jan 2025 23:11:10 +0900 Subject: [PATCH 1/2] fix variable name in `bs.sidebar:create` --- docs/_templates/changelog/v3.0.0.md | 5 +++++ .../data/bs.sidebar/function/create/create.mcfunction | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/_templates/changelog/v3.0.0.md b/docs/_templates/changelog/v3.0.0.md index 8ae8a7bded..0c2669fcd0 100644 --- a/docs/_templates/changelog/v3.0.0.md +++ b/docs/_templates/changelog/v3.0.0.md @@ -23,3 +23,8 @@ ### `🎯 bs.hitbox` - **[#285](https://github.com/mcbookshelf/Bookshelf/pull/285)** - Introduced a `#bs.hitbox:is_sized` tag for improved hitbox management. + + +### `📰 bs.sidebar` + +- 🐛 **[#301](https://github.com/mcbookshelf/Bookshelf/pull/301)** Fixed the issue where `bs.sidebar:create` was not functioning correctly. diff --git a/modules/bs.sidebar/data/bs.sidebar/function/create/create.mcfunction b/modules/bs.sidebar/data/bs.sidebar/function/create/create.mcfunction index e11a516b29..a3e42296a0 100644 --- a/modules/bs.sidebar/data/bs.sidebar/function/create/create.mcfunction +++ b/modules/bs.sidebar/data/bs.sidebar/function/create/create.mcfunction @@ -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 _ From 66954c07990e539695610fd060f9f87a866faec8 Mon Sep 17 00:00:00 2001 From: Aksiome <54895777+aksiome@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:45:10 +0100 Subject: [PATCH 2/2] Add runoshun as a contributor of the function --- modules/bs.sidebar/data/bs.sidebar/tags/function/create.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/bs.sidebar/data/bs.sidebar/tags/function/create.json b/modules/bs.sidebar/data/bs.sidebar/tags/function/create.json index c7eea40348..09440b62db 100644 --- a/modules/bs.sidebar/data/bs.sidebar/tags/function/create.json +++ b/modules/bs.sidebar/data/bs.sidebar/tags/function/create.json @@ -5,6 +5,9 @@ "authors": [ "Aksiome" ], + "contributors": [ + "runoshun" + ], "created": { "date": "2023/08/18", "minecraft_version": "23w32a"