diff --git a/data/ashen_lib/functions/string/split/.mcfunction b/data/ashen_lib/functions/string/split/.mcfunction new file mode 100644 index 0000000..36f3e02 --- /dev/null +++ b/data/ashen_lib/functions/string/split/.mcfunction @@ -0,0 +1,19 @@ +#> ashen_lib:string/split/ +# +# Break down the string into single characters +# +# @input storage +# ashen_lib:api Argument +# String : string +# @output storage ashen_lib:api +# Return : string[] +# @api + +# Validate + execute unless data storage ashen_lib:api Argument.String run tellraw @a [{"nbt": "Ashen.Global.Prefix.ERROR", "storage": "global"}, {"translate": "Ashen.Api.Error.String", "fallback": "Missing Argument: String"}] + +# Exec + execute if data storage ashen_lib:api Argument.String run function ashen_lib:string/split/core/ + +# Reset + data remove storage ashen_lib:api Argument.String diff --git a/data/ashen_lib/functions/string/split/core/.mcfunction b/data/ashen_lib/functions/string/split/core/.mcfunction new file mode 100644 index 0000000..b72817c --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/.mcfunction @@ -0,0 +1,24 @@ +#> ashen_lib:string/split/core/ +# @within function ashen_lib:string/split/ + +# Move to Temporary Storage + data modify storage ashen_lib:temp all set from storage ashen_lib:api Argument.String + +# Get Length + execute store result score #Length Ashen.Global.Temporary run data get storage ashen_lib:temp all + +# Division into 2 parts + execute if score #Length Ashen.Global.Temporary matches 1024.. run function ashen_lib:string/split/core/start/1024 + execute if score #Length Ashen.Global.Temporary matches 512.. run function ashen_lib:string/split/core/start/512 + execute if score #Length Ashen.Global.Temporary matches 256.. run function ashen_lib:string/split/core/start/256 + execute if score #Length Ashen.Global.Temporary matches 128.. run function ashen_lib:string/split/core/start/128 + execute if score #Length Ashen.Global.Temporary matches 64.. run function ashen_lib:string/split/core/start/64 + execute if score #Length Ashen.Global.Temporary matches 32.. run function ashen_lib:string/split/core/start/32 + execute if score #Length Ashen.Global.Temporary matches 16.. run function ashen_lib:string/split/core/start/16 + execute if score #Length Ashen.Global.Temporary matches 8.. run function ashen_lib:string/split/core/start/8 + execute if score #Length Ashen.Global.Temporary matches 4.. run function ashen_lib:string/split/core/start/4 + execute if score #Length Ashen.Global.Temporary matches 2.. run function ashen_lib:string/split/core/start/2 + execute if score #Length Ashen.Global.Temporary matches 1.. run function ashen_lib:string/split/core/start/1 + +# Reset + scoreboard players reset #Length Ashen.Global.Temporary diff --git a/data/ashen_lib/functions/string/split/core/1024.mcfunction b/data/ashen_lib/functions/string/split/core/1024.mcfunction new file mode 100644 index 0000000..d858577 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/1024.mcfunction @@ -0,0 +1,8 @@ +#> ashen_lib:string/split/core/1024 +# @within function +# ashen_lib:string/split/core/start/1024 + +data modify storage ashen_lib:temp 512 set string storage ashen_lib:temp all 0 512 +function ashen_lib:string/split/core/512 +data modify storage ashen_lib:temp 512 set string storage ashen_lib:temp all 512 +function ashen_lib:string/split/core/512 diff --git a/data/ashen_lib/functions/string/split/core/128.mcfunction b/data/ashen_lib/functions/string/split/core/128.mcfunction new file mode 100644 index 0000000..d623300 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/128.mcfunction @@ -0,0 +1,9 @@ +#> ashen_lib:string/split/core/128 +# @within function +# ashen_lib:string/split/core/start/128 +# ashen_lib:string/split/core/256 + +data modify storage ashen_lib:temp 64 set string storage ashen_lib:temp all 0 64 +function ashen_lib:string/split/core/64 +data modify storage ashen_lib:temp 64 set string storage ashen_lib:temp all 64 +function ashen_lib:string/split/core/64 diff --git a/data/ashen_lib/functions/string/split/core/16.mcfunction b/data/ashen_lib/functions/string/split/core/16.mcfunction new file mode 100644 index 0000000..84908bf --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/16.mcfunction @@ -0,0 +1,9 @@ +#> ashen_lib:string/split/core/16 +# @within function +# ashen_lib:string/split/core/start/16 +# ashen_lib:string/split/core/32 + +data modify storage ashen_lib:temp 8 set string storage ashen_lib:temp all 0 8 +function ashen_lib:string/split/core/8 +data modify storage ashen_lib:temp 8 set string storage ashen_lib:temp all 8 +function ashen_lib:string/split/core/8 diff --git a/data/ashen_lib/functions/string/split/core/2.mcfunction b/data/ashen_lib/functions/string/split/core/2.mcfunction new file mode 100644 index 0000000..ed7a425 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/2.mcfunction @@ -0,0 +1,7 @@ +#> ashen_lib:string/split/core/2 +# @within function +# ashen_lib:string/split/core/start/2 +# ashen_lib:string/split/core/4 + +data modify storage ashen_lib:api Return append string storage ashen_lib:temp all 0 1 +data modify storage ashen_lib:api Return append string storage ashen_lib:temp all 1 diff --git a/data/ashen_lib/functions/string/split/core/256.mcfunction b/data/ashen_lib/functions/string/split/core/256.mcfunction new file mode 100644 index 0000000..116516a --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/256.mcfunction @@ -0,0 +1,9 @@ +#> ashen_lib:string/split/core/256 +# @within function +# ashen_lib:string/split/core/start/256 +# ashen_lib:string/split/core/512 + +data modify storage ashen_lib:temp 128 set string storage ashen_lib:temp all 0 128 +function ashen_lib:string/split/core/128 +data modify storage ashen_lib:temp 128 set string storage ashen_lib:temp all 128 +function ashen_lib:string/split/core/128 diff --git a/data/ashen_lib/functions/string/split/core/32.mcfunction b/data/ashen_lib/functions/string/split/core/32.mcfunction new file mode 100644 index 0000000..6e1ea71 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/32.mcfunction @@ -0,0 +1,9 @@ +#> ashen_lib:string/split/core/32 +# @within function +# ashen_lib:string/split/core/start/32 +# ashen_lib:string/split/core/64 + +data modify storage ashen_lib:temp 16 set string storage ashen_lib:temp all 0 16 +function ashen_lib:string/split/core/16 +data modify storage ashen_lib:temp 16 set string storage ashen_lib:temp all 16 +function ashen_lib:string/split/core/16 diff --git a/data/ashen_lib/functions/string/split/core/4.mcfunction b/data/ashen_lib/functions/string/split/core/4.mcfunction new file mode 100644 index 0000000..0430787 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/4.mcfunction @@ -0,0 +1,9 @@ +#> ashen_lib:string/split/core/4 +# @within function +# ashen_lib:string/split/core/start/4 +# ashen_lib:string/split/core/8 + +data modify storage ashen_lib:temp 2 set string storage ashen_lib:temp all 0 2 +function ashen_lib:string/split/core/2 +data modify storage ashen_lib:temp 2 set string storage ashen_lib:temp all 2 +function ashen_lib:string/split/core/2 diff --git a/data/ashen_lib/functions/string/split/core/512.mcfunction b/data/ashen_lib/functions/string/split/core/512.mcfunction new file mode 100644 index 0000000..805c030 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/512.mcfunction @@ -0,0 +1,9 @@ +#> ashen_lib:string/split/core/512 +# @within function +# ashen_lib:string/split/core/start/512 +# ashen_lib:string/split/core/1024 + +data modify storage ashen_lib:temp 256 set string storage ashen_lib:temp all 0 256 +function ashen_lib:string/split/core/256 +data modify storage ashen_lib:temp 256 set string storage ashen_lib:temp all 256 +function ashen_lib:string/split/core/256 diff --git a/data/ashen_lib/functions/string/split/core/64.mcfunction b/data/ashen_lib/functions/string/split/core/64.mcfunction new file mode 100644 index 0000000..190af87 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/64.mcfunction @@ -0,0 +1,9 @@ +#> ashen_lib:string/split/core/64 +# @within function +# ashen_lib:string/split/core/start/64 +# ashen_lib:string/split/core/128 + +data modify storage ashen_lib:temp 32 set string storage ashen_lib:temp all 0 32 +function ashen_lib:string/split/core/32 +data modify storage ashen_lib:temp 32 set string storage ashen_lib:temp all 32 +function ashen_lib:string/split/core/32 diff --git a/data/ashen_lib/functions/string/split/core/8.mcfunction b/data/ashen_lib/functions/string/split/core/8.mcfunction new file mode 100644 index 0000000..32663d6 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/8.mcfunction @@ -0,0 +1,9 @@ +#> ashen_lib:string/split/core/8 +# @within function +# ashen_lib:string/split/core/start/8 +# ashen_lib:string/split/core/16 + +data modify storage ashen_lib:temp 4 set string storage ashen_lib:temp all 0 4 +function ashen_lib:string/split/core/4 +data modify storage ashen_lib:temp 4 set string storage ashen_lib:temp all 4 +function ashen_lib:string/split/core/4 diff --git a/data/ashen_lib/functions/string/split/core/_index.d.mcfunction b/data/ashen_lib/functions/string/split/core/_index.d.mcfunction new file mode 100644 index 0000000..cc1d99a --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/_index.d.mcfunction @@ -0,0 +1,6 @@ +#> ashen_lib:string/split/core/_index.d +# @private + +#> Score Holder +# @within function ashen_lib:string/split/core/** + #declare score_holder #Length diff --git a/data/ashen_lib/functions/string/split/core/start/1.mcfunction b/data/ashen_lib/functions/string/split/core/start/1.mcfunction new file mode 100644 index 0000000..6675a9b --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/1.mcfunction @@ -0,0 +1,6 @@ +#> ashen_lib:string/split/core/start/1 +# @within function +# ashen_lib:string/split/core/ + +data modify storage ashen_lib:api Return append string storage ashen_lib:temp all 0 1 +scoreboard players remove #Length Ashen.Global.Temporary 1 diff --git a/data/ashen_lib/functions/string/split/core/start/1024.mcfunction b/data/ashen_lib/functions/string/split/core/start/1024.mcfunction new file mode 100644 index 0000000..e5e9767 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/1024.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/1024 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/1024 + +data modify storage ashen_lib:temp 1024 set string storage ashen_lib:temp all 0 1024 +function ashen_lib:string/split/core/1024 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 1024 +scoreboard players remove #Length Ashen.Global.Temporary 1024 +execute if score #Length Ashen.Global.Temporary matches 1024.. run function ashen_lib:string/split/core/start/1024 diff --git a/data/ashen_lib/functions/string/split/core/start/128.mcfunction b/data/ashen_lib/functions/string/split/core/start/128.mcfunction new file mode 100644 index 0000000..b92bf74 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/128.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/128 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/128 + +data modify storage ashen_lib:temp 128 set string storage ashen_lib:temp all 0 128 +function ashen_lib:string/split/core/128 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 128 +scoreboard players remove #Length Ashen.Global.Temporary 128 +execute if score #Length Ashen.Global.Temporary matches 128.. run function ashen_lib:string/split/core/start/128 diff --git a/data/ashen_lib/functions/string/split/core/start/16.mcfunction b/data/ashen_lib/functions/string/split/core/start/16.mcfunction new file mode 100644 index 0000000..36e510b --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/16.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/16 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/16 + +data modify storage ashen_lib:temp 16 set string storage ashen_lib:temp all 0 16 +function ashen_lib:string/split/core/16 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 16 +scoreboard players remove #Length Ashen.Global.Temporary 16 +execute if score #Length Ashen.Global.Temporary matches 16.. run function ashen_lib:string/split/core/start/16 diff --git a/data/ashen_lib/functions/string/split/core/start/2.mcfunction b/data/ashen_lib/functions/string/split/core/start/2.mcfunction new file mode 100644 index 0000000..eac8ed9 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/2.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/2 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/2 + +data modify storage ashen_lib:temp 2 set string storage ashen_lib:temp all 0 2 +function ashen_lib:string/split/core/2 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 2 +scoreboard players remove #Length Ashen.Global.Temporary 2 +execute if score #Length Ashen.Global.Temporary matches 2.. run function ashen_lib:string/split/core/start/2 diff --git a/data/ashen_lib/functions/string/split/core/start/256.mcfunction b/data/ashen_lib/functions/string/split/core/start/256.mcfunction new file mode 100644 index 0000000..f2bc374 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/256.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/256 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/256 + +data modify storage ashen_lib:temp 256 set string storage ashen_lib:temp all 0 256 +function ashen_lib:string/split/core/256 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 256 +scoreboard players remove #Length Ashen.Global.Temporary 256 +execute if score #Length Ashen.Global.Temporary matches 256.. run function ashen_lib:string/split/core/start/256 diff --git a/data/ashen_lib/functions/string/split/core/start/32.mcfunction b/data/ashen_lib/functions/string/split/core/start/32.mcfunction new file mode 100644 index 0000000..8282195 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/32.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/32 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/32 + +data modify storage ashen_lib:temp 32 set string storage ashen_lib:temp all 0 32 +function ashen_lib:string/split/core/32 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 32 +scoreboard players remove #Length Ashen.Global.Temporary 32 +execute if score #Length Ashen.Global.Temporary matches 32.. run function ashen_lib:string/split/core/start/32 diff --git a/data/ashen_lib/functions/string/split/core/start/4.mcfunction b/data/ashen_lib/functions/string/split/core/start/4.mcfunction new file mode 100644 index 0000000..d5a63ea --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/4.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/4 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/4 + +data modify storage ashen_lib:temp 4 set string storage ashen_lib:temp all 0 4 +function ashen_lib:string/split/core/4 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 4 +scoreboard players remove #Length Ashen.Global.Temporary 4 +execute if score #Length Ashen.Global.Temporary matches 4.. run function ashen_lib:string/split/core/start/4 diff --git a/data/ashen_lib/functions/string/split/core/start/512.mcfunction b/data/ashen_lib/functions/string/split/core/start/512.mcfunction new file mode 100644 index 0000000..b74bb40 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/512.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/512 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/512 + +data modify storage ashen_lib:temp 512 set string storage ashen_lib:temp all 0 512 +function ashen_lib:string/split/core/512 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 512 +scoreboard players remove #Length Ashen.Global.Temporary 512 +execute if score #Length Ashen.Global.Temporary matches 512.. run function ashen_lib:string/split/core/start/512 diff --git a/data/ashen_lib/functions/string/split/core/start/64.mcfunction b/data/ashen_lib/functions/string/split/core/start/64.mcfunction new file mode 100644 index 0000000..578935c --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/64.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/64 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/64 + +data modify storage ashen_lib:temp 64 set string storage ashen_lib:temp all 0 64 +function ashen_lib:string/split/core/64 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 64 +scoreboard players remove #Length Ashen.Global.Temporary 64 +execute if score #Length Ashen.Global.Temporary matches 64.. run function ashen_lib:string/split/core/start/64 diff --git a/data/ashen_lib/functions/string/split/core/start/8.mcfunction b/data/ashen_lib/functions/string/split/core/start/8.mcfunction new file mode 100644 index 0000000..11d5f72 --- /dev/null +++ b/data/ashen_lib/functions/string/split/core/start/8.mcfunction @@ -0,0 +1,10 @@ +#> ashen_lib:string/split/core/start/8 +# @within function +# ashen_lib:string/split/core/ +# ashen_lib:string/split/core/start/8 + +data modify storage ashen_lib:temp 8 set string storage ashen_lib:temp all 0 8 +function ashen_lib:string/split/core/8 +data modify storage ashen_lib:temp all set string storage ashen_lib:temp all 8 +scoreboard players remove #Length Ashen.Global.Temporary 8 +execute if score #Length Ashen.Global.Temporary matches 8.. run function ashen_lib:string/split/core/start/8