-
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
1 parent
8debb2b
commit 81f67aa
Showing
2 changed files
with
30 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,20 @@ | ||
#> ashen_lib:version/parser/ | ||
# | ||
# Convert version notation string into numerical array | ||
# | ||
# @input storage | ||
# ashen_lib:api Argument | ||
# Version : string | ||
# @output storage | ||
# ashen_lib:api Argument | ||
# Return : int[] | ||
# @api | ||
|
||
# Validate | ||
execute unless data storage ashen_lib:api Argument.Version run tellraw @a [{"nbt": "Ashen.Global.Prefix.ERROR", "storage": "global"},{"translate": "Ashen.Api.Error.VersionParser", "fallback": "Missing Argument: Version"}] | ||
|
||
# Exec | ||
execute if data storage ashen_lib:api Argument.Version run function ashen_lib:version/parser/core/ | ||
|
||
# Reset | ||
data remove storage ashen_lib:api Argument.Version |
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,10 @@ | ||
#> ashen_lib:version/parser/core/ | ||
# @within function ashen_lib:version/parser/ | ||
|
||
# Split by one | ||
data modify storage ashen_lib:api Argument.String set from storage ashen_lib:api Argument.Version | ||
function ashen_lib:string/split/ | ||
|
||
# Combine to 3 numbers | ||
data modify storage ashen_lib:api Argument.CharArray set from storage ashen_lib:api Return | ||
function ashen_lib:string/concat/ |