-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: getting the current timestamp for time based events
- Loading branch information
Showing
19 changed files
with
186 additions
and
6 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
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 @@ | ||
# arguments: input | ||
|
||
$data modify storage dork.base64:io decode.input set value "$(input)" | ||
scoreboard players set .check_for_terminator dork.temp 0 | ||
function dork.base64:impl/decode/main | ||
|
||
execute if score .success dork.temp matches 1 run return 1 | ||
return 0 |
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 @@ | ||
scoreboard players set .check_for_terminator dork.temp 0 | ||
execute if data storage dork.base64:io decode.input run function dork.base64:impl/decode/main | ||
|
||
execute if score .success dork.temp matches 1 run return 1 | ||
return 0 |
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 @@ | ||
# arguments: source | ||
|
||
$data modify storage dork.base64:io decode.input set from $(source) | ||
scoreboard players set .check_for_terminator dork.temp 0 | ||
function dork.base64:impl/decode/main | ||
|
||
execute if score .success dork.temp matches 1 run return 1 | ||
return 0 |
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,21 @@ | ||
# arguments: input | ||
|
||
$data modify storage dork.base64:io decode.input set value "$(input)" | ||
scoreboard players set .check_for_terminator dork.temp 0 | ||
function dork.base64:impl/decode/main | ||
|
||
$execute if score .success dork.temp matches 1 run tellraw @s ["Decoded '",{"text":"$(input)","color":"aqua"},"' to '",{"storage":"dork.base64:io","nbt":"decode.output","color":"green"},"'"] | ||
execute if score .success dork.temp matches 1 run return 1 | ||
|
||
execute store result score .start_index dork.temp store result score .end_index dork.temp run scoreboard players get .index dork.temp | ||
execute store result storage dork.base64:temp args.decode.end_index int 1 run scoreboard players add .end_index dork.temp 1 | ||
scoreboard players remove .start_index dork.temp 10 | ||
execute if score .start_index dork.temp matches ..-1 run scoreboard players set .start_index dork.temp 0 | ||
execute store result storage dork.base64:temp args.decode.start_index int 1 run scoreboard players get .start_index dork.temp | ||
|
||
$data modify storage dork.base64:io decode.input set value "$(input)" | ||
function dork.base64:impl/decode/get_error_message with storage dork.base64:temp args.decode | ||
execute if score .start_index dork.temp matches 0 run tellraw @s [{"text":"Invalid character at position ","color":"red"},{"score":{"name":".index","objective":"dork.temp"}},": ",{"storage":"dork.base64:temp","nbt":"section"},"<--[HERE]"] | ||
execute if score .start_index dork.temp matches 1.. run tellraw @s [{"text":"Invalid character at position ","color":"red"},{"score":{"name":".index","objective":"dork.temp"}},": ...",{"storage":"dork.base64:temp","nbt":"section"},"<--[HERE]"] | ||
|
||
return 0 |
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 @@ | ||
# arguments: terminator, include_terminator (bool) | ||
|
||
$scoreboard players set .include_terminator dork.temp $(include_terminator) | ||
$data modify storage dork.base64:io decode.terminator set value "$(terminator)" | ||
scoreboard players set .check_for_terminator dork.temp 1 | ||
execute if data storage dork.base64:io decode.input run function dork.base64:impl/decode/main | ||
|
||
execute if score .success dork.temp matches 1 run return 1 | ||
return 0 |
8 changes: 8 additions & 0 deletions
8
data/dork.base64/functions/impl/decode/concatenate.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 @@ | ||
$data modify storage dork.base64:temp args.decode.output set value "$(output)$(character)" | ||
|
||
execute unless score .check_for_terminator dork.temp matches 1 run return 0 | ||
data modify storage dork.base64:temp end set value "" | ||
$data modify storage dork.base64:temp end set string storage dork.base64:temp args.decode.output -$(terminator_length) | ||
execute store success score .different dork.temp store success score .continue dork.temp run data modify storage dork.base64:temp end set from storage dork.base64:io decode.terminator | ||
execute if score .different dork.temp matches 0 run scoreboard players set .index dork.temp -1 | ||
$execute if score .different dork.temp matches 0 if score .include_terminator dork.temp matches 0 run data modify storage dork.base64:temp args.decode.output set string storage dork.base64:temp args.decode.output 0 -$(terminator_length) |
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 @@ | ||
data modify storage dork.base64:temp args.decode.binary set string storage dork.base64:temp args.decode.binary 8 | ||
data modify storage dork.base64:temp args.decode.character set value "" | ||
$data modify storage dork.base64:temp args.decode.character set from storage dork.base64:global binary_to_ascii."$(byte)" | ||
|
||
data modify entity @s text set value '{"storage":"dork.base64:temp","nbt":"args.decode.output"}' | ||
data modify storage dork.base64:temp args.decode.output set string entity @s text 9 -2 | ||
function dork.base64:impl/decode/concatenate with storage dork.base64:temp args.decode |
1 change: 1 addition & 0 deletions
1
data/dork.base64/functions/impl/decode/get_error_message.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 @@ | ||
$data modify storage dork.base64:temp section set string storage dork.base64:io decode.input $(start_index) $(end_index) |
2 changes: 2 additions & 0 deletions
2
data/dork.base64/functions/impl/decode/init_entity.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 @@ | ||
kill @s | ||
function dork.base64:impl/decode/loop with storage dork.base64:temp args.decode |
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,12 @@ | ||
$execute unless data storage dork.base64:global digit_to_binary."$(char)" run scoreboard players set .success dork.temp 0 | ||
execute if score .success dork.temp matches 0 run return 0 | ||
|
||
data modify storage dork.base64:temp args.decode.converted set value "" | ||
$data modify storage dork.base64:temp args.decode.converted set from storage dork.base64:global digit_to_binary."$(char)" | ||
function dork.base64:impl/decode/try_convert with storage dork.base64:temp args.decode | ||
|
||
# repeat | ||
data modify storage dork.base64:temp args.decode.char set string storage dork.base64:io decode.input 0 1 | ||
data modify storage dork.base64:io decode.input set string storage dork.base64:io decode.input 1 | ||
scoreboard players add .index dork.temp 1 | ||
execute if score .index dork.temp < .length dork.temp if score .continue dork.temp matches 1 run function dork.base64:impl/decode/loop with storage dork.base64:temp args.decode |
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,15 @@ | ||
# (storage dork.base64:io decode.input) | ||
|
||
scoreboard players set .success dork.temp 1 | ||
execute store result score .length dork.temp run data get storage dork.base64:io decode.input | ||
scoreboard players set .index dork.temp 0 | ||
scoreboard players set .continue dork.temp 1 | ||
|
||
data modify storage dork.base64:temp args.decode set value {output:"",binary:"","converted":"",terminator_length:1} | ||
execute if score .check_for_terminator dork.temp matches 1 store result storage dork.base64:temp args.decode.terminator_length int 1 run data get storage dork.base64:io decode.terminator | ||
data modify storage dork.base64:temp args.decode.char set string storage dork.base64:io decode.input 0 1 | ||
data modify storage dork.base64:io decode.input set string storage dork.base64:io decode.input 1 | ||
execute if score .index dork.temp < .length dork.temp positioned ~ -2000 ~ summon text_display run function dork.base64:impl/decode/init_entity | ||
|
||
execute if score .success dork.temp matches 1 run data modify storage dork.base64:io decode.output set from storage dork.base64:temp args.decode.output | ||
execute if score .success dork.temp matches 0 run data remove storage dork.base64:io decode.output |
4 changes: 4 additions & 0 deletions
4
data/dork.base64/functions/impl/decode/try_convert.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 @@ | ||
$data modify storage dork.base64:temp args.decode.binary set value "$(binary)$(converted)" | ||
data modify storage dork.base64:temp args.decode.byte set value "" | ||
data modify storage dork.base64:temp args.decode.byte set string storage dork.base64:temp args.decode.binary 0 8 | ||
execute unless data storage dork.base64:temp args.decode{byte:""} run function dork.base64:impl/decode/do_convert with storage dork.base64:temp args.decode |
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 @@ | ||
scoreboard objectives add dork.temp dummy | ||
|
||
data modify storage dork.base64:global digit_to_binary set value {"A": "000000", "B": "000001", "C": "000010", "D": "000011", "E": "000100", "F": "000101", "G": "000110", "H": "000111", "I": "001000", "J": "001001", "K": "001010", "L": "001011", "M": "001100", "N": "001101", "O": "001110", "P": "001111", "Q": "010000", "R": "010001", "S": "010010", "T": "010011", "U": "010100", "V": "010101", "W": "010110", "X": "010111", "Y": "011000", "Z": "011001", "a": "011010", "b": "011011", "c": "011100", "d": "011101", "e": "011110", "f": "011111", "g": "100000", "h": "100001", "i": "100010", "j": "100011", "k": "100100", "l": "100101", "m": "100110", "n": "100111", "o": "101000", "p": "101001", "q": "101010", "r": "101011", "s": "101100", "t": "101101", "u": "101110", "v": "101111", "w": "110000", "x": "110001", "y": "110010", "z": "110011", "0": "110100", "1": "110101", "2": "110110", "3": "110111", "4": "111000", "5": "111001", "6": "111010", "7": "111011", "8": "111100", "9": "111101", "+": "111110", "/": "111111", "=": ""} | ||
data modify storage dork.base64:global binary_to_ascii set value {"00100000": " ", "00100001": "!", "00100010": "\\\"", "00100011": "#", "00100100": "$", "00100101": "%", "00100110": "&", "00100111": "'", "00101000": "(", "00101001": ")", "00101010": "*", "00101011": "+", "00101100": ",", "00101101": "-", "00101110": ".", "00101111": "/", "00110000": "0", "00110001": "1", "00110010": "2", "00110011": "3", "00110100": "4", "00110101": "5", "00110110": "6", "00110111": "7", "00111000": "8", "00111001": "9", "00111010": ":", "00111011": ";", "00111100": "<", "00111101": "=", "00111110": ">", "00111111": "?", "01000000": "@", "01000001": "A", "01000010": "B", "01000011": "C", "01000100": "D", "01000101": "E", "01000110": "F", "01000111": "G", "01001000": "H", "01001001": "I", "01001010": "J", "01001011": "K", "01001100": "L", "01001101": "M", "01001110": "N", "01001111": "O", "01010000": "P", "01010001": "Q", "01010010": "R", "01010011": "S", "01010100": "T", "01010101": "U", "01010110": "V", "01010111": "W", "01011000": "X", "01011001": "Y", "01011010": "Z", "01011011": "[", "01011100": "\\\\", "01011101": "]", "01011110": "^", "01011111": "_", "01100000": "`", "01100001": "a", "01100010": "b", "01100011": "c", "01100100": "d", "01100101": "e", "01100110": "f", "01100111": "g", "01101000": "h", "01101001": "i", "01101010": "j", "01101011": "k", "01101100": "l", "01101101": "m", "01101110": "n", "01101111": "o", "01110000": "p", "01110001": "q", "01110010": "r", "01110011": "s", "01110100": "t", "01110101": "u", "01110110": "v", "01110111": "w", "01111000": "x", "01111001": "y", "01111010": "z", "01111011": "{", "01111100": "|", "01111101": "}", "01111110": "~"} |
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,39 @@ | ||
|
||
|
||
function ./timestamp/scoreboard_process: | ||
$data modify storage simpledrawer:timestamp timestamp set value $(timestamp)L | ||
execute store result score #timestamp simpledrawer.math run data get storage simpledrawer:timestamp timestamp 0.001 | ||
|
||
|
||
function ./timestamp/process: | ||
data modify storage simpledrawer:timestamp timestamp set from block -29999990 33 1610 SkullOwner.Properties.textures[0].Value | ||
data modify storage simpledrawer:timestamp timestamp set string storage simpledrawer:timestamp timestamp 24 -1 | ||
data modify storage dork.base64:io decode.input set from storage simpledrawer:timestamp timestamp | ||
function dork.base64:api/decode/until {terminator: ",", include_terminator: false} | ||
data modify storage simpledrawer:timestamp timestamp set from storage dork.base64:io decode.output | ||
function ./timestamp/scoreboard_process with storage simpledrawer:timestamp | ||
|
||
|
||
schedule clear simpledrawer:impl/timestamp | ||
|
||
|
||
|
||
|
||
scoreboard players set #success_ts simpledrawer.math 0 | ||
|
||
execute | ||
as @p at @s | ||
if data block -29999990 33 1610 SkullOwner.Properties.textures[0] | ||
run scoreboard players set #success_ts simpledrawer.math 1 | ||
|
||
|
||
execute if score #success_ts simpledrawer.math matches 1 run function ./timestamp/process | ||
|
||
execute if score #success_ts simpledrawer.math matches 0 run schedule function simpledrawer:impl/timestamp 5t replace | ||
|
||
|
||
|
||
setblock -29999990 33 1610 air | ||
setblock -29999990 33 1610 player_head{SkullOwner:{Name:"jeb_"}} | ||
|
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 @@ | ||
{ | ||
"pools": [ | ||
{ | ||
"rolls": 1, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "minecraft:player_head", | ||
"functions": [ | ||
{ | ||
"function": "minecraft:fill_player_head", | ||
"entity": "this" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|