Skip to content

Commit

Permalink
perf: optimize breaking block @e calls
Browse files Browse the repository at this point in the history
  • Loading branch information
chuangcaleb committed Jan 26, 2024
1 parent 514d0ae commit 6f3470c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions data/cchesed/functions/bft/block/remove.mcfunction
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
execute as @e[tag=cc.ft.llama] at @s unless block ~ ~ ~ minecraft:fletching_table run tp @s ~ ~-500 ~
execute as @e[tag=cc.ft.table_display] at @s unless block ~ ~ ~ minecraft:fletching_table run kill @s
tp @s ~ ~-500 ~
kill @s
3 changes: 2 additions & 1 deletion data/cchesed/functions/bft/tick/tick_llama.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ function cchesed:bft/recipe/_check_all_recipes
# ------------------------------ block handling ------------------------------ #

# If block is broken or moved
execute unless block ~ ~ ~ minecraft:fletching_table run function cchesed:bft/block/remove
# We run it per llama, this reduces computation calls
execute unless block ~ ~ ~ minecraft:fletching_table as @e[tag=cc.ft.table] at @s unless block ~ ~ ~ minecraft:fletching_table run function cchesed:bft/block/remove

0 comments on commit 6f3470c

Please sign in to comment.