-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Finn
committed
Nov 24, 2024
1 parent
5e98a82
commit bd66709
Showing
12 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tellraw @a "announcement!!" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$scoreboard players set state stage.curtain $(action_data) |
11 changes: 11 additions & 0 deletions
11
data/lt/function/stage/feature/curtain/break_layer.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Takes storage data lt:stage/curtain as input | ||
# E.g. {width:33,length:9,x:1,z:0,current_step:0} | ||
|
||
$scoreboard players set evalX stage.curtain $(x) | ||
$scoreboard players set evalZ stage.curtain $(z) | ||
|
||
$execute if score evalX stage.curtain matches 1 run fill ~ ~-$(current_step) ~ ~$(width) ~-$(current_step) ~ air replace ltextras:curtain | ||
$execute if score evalZ stage.curtain matches 1 run fill ~ ~-$(current_step) ~ ~ ~-$(current_step) ~$(width) air replace ltextras:curtain | ||
|
||
## Update step value | ||
execute store result storage lt:stage/curtain current_step int 1 run scoreboard players remove length stage.curtain 1 |
1 change: 1 addition & 0 deletions
1
data/lt/function/stage/feature/curtain/create_curtain.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
execute align xyz run summon marker ~ ~ ~ {Tags:["stage.curtain"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Stop curtain logic once it becomes fully open or closed | ||
execute if score length stage.curtain = max_length stage.curtain if score state stage.curtain matches 1 run scoreboard players set state stage.curtain 0 | ||
execute if score length stage.curtain matches 0 if score state stage.curtain matches -1 run scoreboard players set state stage.curtain 0 | ||
|
||
# Run correct break/place function if state is not 0 | ||
execute if score state stage.curtain matches 1 run function lt:stage/feature/curtain/place_layer with storage lt:stage/curtain | ||
execute if score state stage.curtain matches -1 run function lt:stage/feature/curtain/break_layer with storage lt:stage/curtain | ||
|
||
# Evaluate new length | ||
execute store result score length stage.curtain run data get storage lt:stage/curtain current_step 1 | ||
|
11 changes: 11 additions & 0 deletions
11
data/lt/function/stage/feature/curtain/place_layer.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Takes storage data lt:stage/curtain as input | ||
# E.g. {width:33,length:9,x:1,z:0,current_step:0} | ||
|
||
$scoreboard players set evalX stage.curtain $(x) | ||
$scoreboard players set evalZ stage.curtain $(z) | ||
|
||
$execute if score evalX stage.curtain matches 1 run fill ~ ~-$(current_step) ~ ~$(width) ~-$(current_step) ~ ltextras:curtain replace air | ||
$execute if score evalZ stage.curtain matches 1 run fill ~ ~-$(current_step) ~ ~ ~-$(current_step) ~$(width) ltextras:curtain replace air | ||
|
||
## Update step value | ||
execute store result storage lt:stage/curtain current_step int 1 run scoreboard players add length stage.curtain 1 |
6 changes: 6 additions & 0 deletions
6
data/lt/function/stage/feature/curtain/setup_curtain.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
scoreboard players set state stage.curtain 0 | ||
scoreboard players set length stage.curtain 0 | ||
scoreboard players set evalX stage.curtain 0 | ||
scoreboard players set evalZ stage.curtain 0 | ||
scoreboard players set max_length stage.curtain 9 | ||
data merge storage lt:stage/curtain {width:33,length:9,x:1,z:0,current_step:0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Master function for performing/intitiating snlt stage actions | ||
# { action:"", action_data: INT} | ||
## function lt:snlt/stage_action {action_id:"toggle_curtain",action_data:0} | ||
|
||
$execute as @s at @s run function lt:stage/action/$(action_id) {action_data:$(action_data)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Main on_tick function for simple stage mechanics | ||
# More complex stage mechanics can have their own on_ticks, which should be ran from here instead of tick_runner | ||
|
||
|
||
|
||
## Run curtain logic only when it is not fully open or closed. | ||
execute unless score curtain_state stage.global matches 0 run execute as @e[type=marker,tag=stage.curtain] at @s run function lt:stage/feature/curtain/on_tick |