-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
8 changed files
with
67 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: integrity-hooks-basic | ||
|
||
data_pack: | ||
load: | ||
- data/test/functions: src | ||
|
||
require: | ||
- bolt | ||
- integrity | ||
|
||
pipeline: | ||
- mecha | ||
|
||
output: dist | ||
|
||
meta: | ||
generate_namespace: test |
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,29 @@ | ||
from integrity import Hook | ||
|
||
function ./load: | ||
say Loading... | ||
Hook.create("load") | ||
say Loaded. | ||
Hook.create("loaded") | ||
|
||
with Hook.at("load"): | ||
as @a[tag=!loaded]: | ||
say Loading player | ||
Hook.create("player:load") | ||
tag @s add loaded | ||
|
||
with Hook.at("player:load"): | ||
scoreboard players set @s example.score 123 | ||
align xyz positioned ~.5 ~.5 ~.5 expand: | ||
Hook.create("player:load/centered") | ||
tag @s remove abc | ||
|
||
with Hook.at("player:load/centered"): | ||
setblock ~ ~ ~ stone | ||
|
||
with Hook.at("player:load/centered"): | ||
particle flame ~ ~ ~ 0 0 0 0.1 1 force | ||
|
||
|
||
with Hook.at("loaded"): | ||
scoreboard players reset @a * |
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,4 @@ | ||
from integrity import Hook | ||
|
||
with Hook.at("load"): | ||
scoreboard players set @a other.test 0 |
5 changes: 5 additions & 0 deletions
5
tests/snapshots/examples__build_hooks_basic__0.data_pack/data/test/functions/load.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,5 @@ | ||
say Loading... | ||
execute as @a[tag=!loaded] run function test:main/nested_execute_0 | ||
scoreboard players set @a other.test 0 | ||
say Loaded. | ||
scoreboard players reset @a * |
Empty file.
6 changes: 6 additions & 0 deletions
6
...ples__build_hooks_basic__0.data_pack/data/test/functions/main/nested_execute_0.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 @@ | ||
say Loading player | ||
scoreboard players set @s example.score 123 | ||
execute align xyz positioned ~0.5 ~0.5 ~0.5 run setblock ~ ~ ~ stone | ||
execute align xyz positioned ~0.5 ~0.5 ~0.5 run particle flame ~ ~ ~ 0 0 0 0.1 1 force | ||
tag @s remove abc | ||
tag @s add loaded |
Empty file.
6 changes: 6 additions & 0 deletions
6
tests/snapshots/examples__build_hooks_basic__0.data_pack/pack.mcmeta
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 @@ | ||
{ | ||
"pack": { | ||
"pack_format": 10, | ||
"description": "" | ||
} | ||
} |