-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor hangman plugin to support run commands syntax
- Loading branch information
Showing
20 changed files
with
247 additions
and
35 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
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 @@ | ||
{ | ||
"data_pack": { | ||
"load": ["src"] | ||
}, | ||
"pipeline": ["beet.contrib.hangman"] | ||
} |
16 changes: 16 additions & 0 deletions
16
examples/load_hangman_commands/src/data/demo/functions/bar.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,16 @@ | ||
# This will be left as-is | ||
execute as @p run say run commands | ||
|
||
# This one works | ||
execute as @a run commands | ||
# Not this one | ||
execute | ||
as @p run say | ||
run commands | ||
thing | ||
|
||
# But this one yes | ||
execute | ||
run | ||
commands | ||
say hello |
66 changes: 66 additions & 0 deletions
66
examples/load_hangman_commands/src/data/demo/functions/foo.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,66 @@ | ||
execute run commands | ||
say Hello world! | ||
give @s minecraft:diamond 64 # One stack should be enough | ||
|
||
execute | ||
# First we select all players | ||
as @a at @s | ||
if block ~ ~-1 ~ minecraft:air | ||
run commands # Blah blah this is a trailing comment | ||
say Hello world! | ||
# This give command is pretty long | ||
give @s | ||
minecraft:stone{ | ||
display: { | ||
Name: '[{ | ||
"text": "Hello", | ||
"bold": true # Bold makes it easier to read | ||
}]', | ||
Lore: [ | ||
# Pretty sure we don't need this | ||
'[{ "text": "Something else here" }]' | ||
] | ||
} | ||
} | ||
1 | ||
|
||
# Now we add some space | ||
|
||
say Lorem ipsum dolor sit amet, consectetur adipiscing | ||
elit, sed do eiusmod tempor incididunt ut labore et | ||
dolore magna aliqua. Ut enim ad minim veniam, quis | ||
nostrud exercitation ullamco laboris nisi ut aliquip | ||
ex ea commodo consequat. Duis aute irure dolor in | ||
reprehenderit in voluptate velit esse cillum dolore | ||
eu fugiat nulla pariatur. Excepteur sint occaecat | ||
cupidatat non proident, sunt in culpa qui officia | ||
deserunt mollit anim id est laborum | ||
|
||
execute as @e[type=minecraft:cow] at @s run commands | ||
data modify entity @s Motion[1] set value 5.0f | ||
particle minecraft:cloud ~ ~ ~ 0 0 0 0.1 10 normal | ||
|
||
execute as @a run commands | ||
execute | ||
facing entity @e[tag=target,limit=1,sort=nearest] eyes | ||
run commands | ||
say Boom! | ||
say and we're done | ||
|
||
execute run commands | ||
execute run commands | ||
execute run commands | ||
execute run commands | ||
execute run commands | ||
say 1 | ||
say 2 | ||
say 3 | ||
say 4 | ||
say 5 | ||
|
||
|
||
say something | ||
|
||
|
||
|
||
this isn't the end |
5 changes: 5 additions & 0 deletions
5
...ots/examples__build_load_hangman_commands__0.data_pack/data/demo/functions/bar.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 @@ | ||
# This will be left as-is | ||
execute as @p run say run commands | ||
|
||
# This one works | ||
execute as @a run function load_hangman_commands:generated_1 |
14 changes: 14 additions & 0 deletions
14
...ots/examples__build_load_hangman_commands__0.data_pack/data/demo/functions/foo.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,14 @@ | ||
execute run function load_hangman_commands:generated_2 | ||
|
||
# First we select all players | ||
# Blah blah this is a trailing comment | ||
execute as @a at @s if block ~ ~-1 ~ minecraft:air run function load_hangman_commands:generated_3 | ||
|
||
execute as @e[type=minecraft:cow] at @s run function load_hangman_commands:generated_4 | ||
|
||
execute as @a run function load_hangman_commands:generated_6 | ||
|
||
execute run function load_hangman_commands:generated_11 | ||
|
||
|
||
say something this isn't the end |
1 change: 1 addition & 0 deletions
1
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_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 @@ | ||
say hello |
5 changes: 5 additions & 0 deletions
5
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_1.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 @@ | ||
# Not this one | ||
execute as @p run say run commands thing | ||
|
||
# But this one yes | ||
execute run function load_hangman_commands:generated_0 |
2 changes: 2 additions & 0 deletions
2
...angman_commands__0.data_pack/data/load_hangman_commands/functions/generated_10.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,2 @@ | ||
execute run function load_hangman_commands:generated_9 | ||
say 4 |
2 changes: 2 additions & 0 deletions
2
...angman_commands__0.data_pack/data/load_hangman_commands/functions/generated_11.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,2 @@ | ||
execute run function load_hangman_commands:generated_10 | ||
say 5 |
3 changes: 3 additions & 0 deletions
3
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_2.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,3 @@ | ||
say Hello world! | ||
# One stack should be enough | ||
give @s minecraft:diamond 64 |
9 changes: 9 additions & 0 deletions
9
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_3.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,9 @@ | ||
say Hello world! | ||
# This give command is pretty long | ||
# Bold makes it easier to read | ||
# Pretty sure we don't need this | ||
give @s minecraft:stone{ display: { Name: '[{ "text": "Hello", "bold": true }]', Lore: [ '[{ "text": "Something else here" }]' ] } } 1 | ||
|
||
# Now we add some space | ||
|
||
say Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum |
2 changes: 2 additions & 0 deletions
2
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_4.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,2 @@ | ||
data modify entity @s Motion[1] set value 5.0f | ||
particle minecraft:cloud ~ ~ ~ 0 0 0 0.1 10 normal |
1 change: 1 addition & 0 deletions
1
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_5.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 @@ | ||
say Boom! |
2 changes: 2 additions & 0 deletions
2
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_6.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,2 @@ | ||
execute facing entity @e[tag=target,limit=1,sort=nearest] eyes run function load_hangman_commands:generated_5 | ||
say and we're done |
1 change: 1 addition & 0 deletions
1
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_7.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 @@ | ||
say 1 |
2 changes: 2 additions & 0 deletions
2
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_8.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,2 @@ | ||
execute run function load_hangman_commands:generated_7 | ||
say 2 |
2 changes: 2 additions & 0 deletions
2
...hangman_commands__0.data_pack/data/load_hangman_commands/functions/generated_9.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,2 @@ | ||
execute run function load_hangman_commands:generated_8 | ||
say 3 |
6 changes: 6 additions & 0 deletions
6
tests/snapshots/examples__build_load_hangman_commands__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": 6, | ||
"description": "" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/snapshots/examples__build_load_hangman_commands__1.resource_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": 6, | ||
"description": "" | ||
} | ||
} |