-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
167 additions
and
56 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
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 @@ | ||
require: | ||
- bolt | ||
data_pack: | ||
load: "src" | ||
pipeline: | ||
- mecha |
4 changes: 4 additions & 0 deletions
4
examples/bolt_macro_perf/src/data/demo/functions/export.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,4 @@ | ||
# Importing macros doesn't cause a command tree update when there is no code below | ||
|
||
from ./lib import foo1, foo2 | ||
from ./lib import foo3 |
8 changes: 8 additions & 0 deletions
8
examples/bolt_macro_perf/src/data/demo/functions/func1.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,8 @@ | ||
# Importing multiple macros in a row will update the command tree in a single batch | ||
|
||
from ./lib import foo1, foo2 | ||
from ./lib import foo3 | ||
|
||
foo1 | ||
foo2 | ||
foo3 |
7 changes: 7 additions & 0 deletions
7
examples/bolt_macro_perf/src/data/demo/functions/func2.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,7 @@ | ||
# If multiple scopes end up using the same set of macros they will share the same underlying command spec | ||
|
||
from ./export import foo1, foo2, foo3 | ||
|
||
foo1 | ||
foo2 | ||
foo3 |
13 changes: 13 additions & 0 deletions
13
examples/bolt_macro_perf/src/data/demo/functions/lib.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,13 @@ | ||
# Defining multiple macros in a row will update the command tree in a single batch | ||
|
||
macro foo1: | ||
say foo1 | ||
|
||
macro foo2: | ||
say foo2 | ||
|
||
macro foo3: | ||
say foo3 | ||
|
||
macro foo4: | ||
say foo4 |
44 changes: 44 additions & 0 deletions
44
tests/snapshots/examples__build_bolt_macro_perf__0.pack.md
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,44 @@ | ||
# Lectern snapshot | ||
|
||
## Data pack | ||
|
||
`@data_pack pack.mcmeta` | ||
|
||
```json | ||
{ | ||
"pack": { | ||
"pack_format": 10, | ||
"description": "" | ||
} | ||
} | ||
``` | ||
|
||
### demo | ||
|
||
`@function(strip_final_newline) demo:export` | ||
|
||
```mcfunction | ||
``` | ||
|
||
`@function demo:func1` | ||
|
||
```mcfunction | ||
say foo1 | ||
say foo2 | ||
say foo3 | ||
``` | ||
|
||
`@function demo:func2` | ||
|
||
```mcfunction | ||
say foo1 | ||
say foo2 | ||
say foo3 | ||
``` | ||
|
||
`@function(strip_final_newline) demo:lib` | ||
|
||
```mcfunction | ||
``` |