Skip to content

Commit

Permalink
fix things
Browse files Browse the repository at this point in the history
  • Loading branch information
aksiome committed Mar 6, 2025
1 parent 07ab225 commit ea9a5e4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/_templates/changelog/v3.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- <abbr title="Download">📥</abbr> **[#336](https://github.com/mcbookshelf/bookshelf/issues/336)** - Bookshelf is now available on PyPI! You can install it with pip or any other Python dependency manager for use with the Beet build toolchain.

### `🧱 bs.block`
- <abbr title="New Features">✨</abbr> **[#349](https://github.com/mcbookshelf/bookshelf/issues/349)** - Added the `on_completed` command argument to block fill operations. If specified the provided string is run as a command once the block fill operation is finished.
- <abbr title="New Features">✨</abbr> **[#349](https://github.com/mcbookshelf/bookshelf/issues/349)** - Added the `on_finished` command argument to block fill operations. If specified the provided string is run as a command once the block fill operation is finished.
- <abbr title="New Features">✨</abbr> **[#279](https://github.com/mcbookshelf/Bookshelf/issues/279)** - Added a `#bs.block:play_block_sound` tag for playing block sounds.
- <abbr title="Bug Fix">🐛</abbr> **[#320](https://github.com/mcbookshelf/Bookshelf/issues/320)** - Fixed functions that were unusable outside the Overworld.

Expand Down
6 changes: 3 additions & 3 deletions docs/modules/block.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Fill all or part of a region with a specific block.
- {nbt}`string` **block**: Block to fill the region with.
- {nbt}`string` {nbt}`list` **from**: Starting position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`string` {nbt}`list` **to**: Ending position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`int` **limit**: Limit how many blocks can be set in a single tick (default: 4096).
- {nbt}`string` **mode**: Mode used to set blocks [destroy|keep|replace] (default: replace).
- {nbt}`string` **on_finished**: Command executed at the end of the operation (at the location of the final block).
- {nbt}`int` **limit**: Limit how many blocks can be set in a single tick (default: 4096).
- {nbt}`list` **masks**: Determine which blocks will be replaced.
- {nbt}`compound` Block mask
- {nbt}`string` **block**: Block acting as a filter.
Expand Down Expand Up @@ -89,9 +89,9 @@ Fill all or part of a region with a specific block type, preserving states and N
- {nbt}`string` **type**: Block id to fill the region with.
- {nbt}`string` {nbt}`list` **from**: Starting position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`string` {nbt}`list` **to**: Ending position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`int` **limit**: Limit how many blocks can be set in a single tick (default: 4096).
- {nbt}`string` **mode**: Mode used to set blocks [destroy|keep|replace] (default: replace).
- {nbt}`string` **on_finished**: Command executed at the end of the operation (at the location of the final block).
- {nbt}`int` **limit**: Limit how many blocks can be set in a single tick (default: 4096).
- {nbt}`list` **masks**: Determine which blocks will be replaced.
- {nbt}`compound` Block mask
- {nbt}`string` **block**: Block acting as a filter.
Expand Down Expand Up @@ -131,9 +131,9 @@ Fill all or part of a region with random blocks or types.
- {nbt}`int` **weight**: Determine the likelihood of selecting the entry (default: 1).
- {nbt}`string` {nbt}`list` **from**: Starting position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`string` {nbt}`list` **to**: Ending position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`int` **limit**: Limit how many blocks can be set in a single tick (default: 4096).
- {nbt}`string` **mode**: Mode used to set blocks [destroy|keep|replace] (default: replace).
- {nbt}`string` **on_finished**: Command executed at the end of the operation (at the location of the final block).
- {nbt}`int` **limit**: Limit how many blocks can be set in a single tick (default: 4096).
- {nbt}`list` **masks**: Determine which blocks will be replaced.
- {nbt}`compound` Block mask
- {nbt}`string` **block**: Block acting as a filter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@
# For more details, refer to the MPL v2.0.
# ------------------------------------------------------------------------------------------------------------

# if there is an on_finished signal, execute it's command
$$(on_finished)
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ execute if score #block.z bs.data > #block.min_z bs.data positioned ~ ~ ~1 run r
$execute if score #block.y bs.data > #block.min_y bs.data positioned ~ ~1 $(min_z) run return run function bs.block:fill/recurse/next with storage bs:data block._
$execute if score #block.x bs.data <= #block.max_x bs.data positioned ~1 $(min_y) $(min_z) run return run function bs.block:fill/recurse/next with storage bs:data block._

#if present, the on_finished command is only executed at the end of the recursion
# if present, the on_finished command is only executed at the end of the recursion
execute if data storage bs:data block._.on_finished run function bs.block:fill/events/on_finished with storage bs:data block._
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# For more details, refer to the MPL v2.0.
# ------------------------------------------------------------------------------------------------------------

data modify storage bs:in block.fill_block set value {block:"minecraft:stone",from:[0,100,0],to:[1,101,1],on_finished:"succeed"}
data modify storage bs:in block.fill_block set value {block:"minecraft:stone",from:"~ ~ ~",to:"~ ~1 ~",limit:1,on_finished:"setblock ~ ~ ~ minecraft:bookshelf"}
function #bs.block:fill_block
fail "Failed to run on_completed command"
assert block ~ ~ ~ minecraft:stone
assert not block ~ ~1 ~ minecraft:stone
await delay 1t
assert block ~ ~1 ~ minecraft:bookshelf

0 comments on commit ea9a5e4

Please sign in to comment.