├── .gitattributes ├── LICENSE ├── README.md ├── data ├── gu │ └── function │ │ ├── convert.mcfunction │ │ ├── generate.mcfunction │ │ └── zzz │ │ ├── concat_uuid.mcfunction │ │ ├── get_hexes.mcfunction │ │ ├── load.mcfunction │ │ └── store_uuid.mcfunction └── minecraft │ └── tags │ └── function │ └── load.json └── pack.mcmeta /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Simple UUID Converter 2 | 3 | This is a basic library to just generate the hex UUID of an entity 4 | 5 | ## Use 6 | 7 | > `gu:generate` - writes the UUID of the current entity to storage `gu:main out` 8 | 9 | > `gu:convert` - converts the UUID you input as the function argument `{UUID:[I;0,1,2,3]}` and writes it to storage `gu:main out` -------------------------------------------------------------------------------- /data/gu/function/convert.mcfunction: -------------------------------------------------------------------------------- 1 | data merge storage gu:temp {0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,a:0,b:0,c:0,d:0,e:0,f:0} 2 | $data modify storage gu:main in set value $(UUID) 3 | 4 | execute store result score 0= gu.main store result score 1= gu.main run data get storage gu:main in[0] 5 | execute store result storage gu:temp 0 int 1 run scoreboard players operation 0= gu.main %= 256 num 6 | execute store result score 2= gu.main run scoreboard players operation 1= gu.main /= 256 num 7 | execute store result storage gu:temp 1 int 1 run scoreboard players operation 1= gu.main %= 256 num 8 | execute store result score 3= gu.main run scoreboard players operation 2= gu.main /= 256 num 9 | execute store result storage gu:temp 2 int 1 run scoreboard players operation 2= gu.main %= 256 num 10 | execute store result storage gu:temp 3 int 1 run scoreboard players operation 3= gu.main /= 256 num 11 | 12 | execute store result score 0= gu.main store result score 1= gu.main run data get storage gu:main in[1] 13 | execute store result storage gu:temp 4 int 1 run scoreboard players operation 0= gu.main %= 256 num 14 | execute store result score 2= gu.main run scoreboard players operation 1= gu.main /= 256 num 15 | execute store result storage gu:temp 5 int 1 run scoreboard players operation 1= gu.main %= 256 num 16 | execute store result score 3= gu.main run scoreboard players operation 2= gu.main /= 256 num 17 | execute store result storage gu:temp 6 int 1 run scoreboard players operation 2= gu.main %= 256 num 18 | execute store result storage gu:temp 7 int 1 run scoreboard players operation 3= gu.main /= 256 num 19 | 20 | execute store result score 0= gu.main store result score 1= gu.main run data get storage gu:main in[2] 21 | execute store result storage gu:temp 8 int 1 run scoreboard players operation 0= gu.main %= 256 num 22 | execute store result score 2= gu.main run scoreboard players operation 1= gu.main /= 256 num 23 | execute store result storage gu:temp 9 int 1 run scoreboard players operation 1= gu.main %= 256 num 24 | execute store result score 3= gu.main run scoreboard players operation 2= gu.main /= 256 num 25 | execute store result storage gu:temp a int 1 run scoreboard players operation 2= gu.main %= 256 num 26 | execute store result storage gu:temp b int 1 run scoreboard players operation 3= gu.main /= 256 num 27 | 28 | execute store result score 0= gu.main store result score 1= gu.main run data get storage gu:main in[3] 29 | execute store result storage gu:temp c int 1 run scoreboard players operation 0= gu.main %= 256 num 30 | execute store result score 2= gu.main run scoreboard players operation 1= gu.main /= 256 num 31 | execute store result storage gu:temp d int 1 run scoreboard players operation 1= gu.main %= 256 num 32 | execute store result score 3= gu.main run scoreboard players operation 2= gu.main /= 256 num 33 | execute store result storage gu:temp e int 1 run scoreboard players operation 2= gu.main %= 256 num 34 | execute store result storage gu:temp f int 1 run scoreboard players operation 3= gu.main /= 256 num 35 | 36 | function gu:zzz/get_hexes with storage gu:temp 37 | function gu:zzz/concat_uuid with storage gu:temp -------------------------------------------------------------------------------- /data/gu/function/generate.mcfunction: -------------------------------------------------------------------------------- 1 | data merge storage gu:temp {0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,a:0,b:0,c:0,d:0,e:0,f:0} 2 | execute unless score @s gu.uuid.0 matches -2147483648.. run function gu:zzz/store_uuid 3 | 4 | execute store result score 0= gu.main run scoreboard players operation 1= gu.main = @s gu.uuid.0 5 | execute store result storage gu:temp 0 int 1 run scoreboard players operation 0= gu.main %= 256 num 6 | execute store result score 2= gu.main run scoreboard players operation 1= gu.main /= 256 num 7 | execute store result storage gu:temp 1 int 1 run scoreboard players operation 1= gu.main %= 256 num 8 | execute store result score 3= gu.main run scoreboard players operation 2= gu.main /= 256 num 9 | execute store result storage gu:temp 2 int 1 run scoreboard players operation 2= gu.main %= 256 num 10 | execute store result storage gu:temp 3 int 1 run scoreboard players operation 3= gu.main /= 256 num 11 | 12 | execute store result score 0= gu.main run scoreboard players operation 1= gu.main = @s gu.uuid.1 13 | execute store result storage gu:temp 4 int 1 run scoreboard players operation 0= gu.main %= 256 num 14 | execute store result score 2= gu.main run scoreboard players operation 1= gu.main /= 256 num 15 | execute store result storage gu:temp 5 int 1 run scoreboard players operation 1= gu.main %= 256 num 16 | execute store result score 3= gu.main run scoreboard players operation 2= gu.main /= 256 num 17 | execute store result storage gu:temp 6 int 1 run scoreboard players operation 2= gu.main %= 256 num 18 | execute store result storage gu:temp 7 int 1 run scoreboard players operation 3= gu.main /= 256 num 19 | 20 | execute store result score 0= gu.main run scoreboard players operation 1= gu.main = @s gu.uuid.2 21 | execute store result storage gu:temp 8 int 1 run scoreboard players operation 0= gu.main %= 256 num 22 | execute store result score 2= gu.main run scoreboard players operation 1= gu.main /= 256 num 23 | execute store result storage gu:temp 9 int 1 run scoreboard players operation 1= gu.main %= 256 num 24 | execute store result score 3= gu.main run scoreboard players operation 2= gu.main /= 256 num 25 | execute store result storage gu:temp a int 1 run scoreboard players operation 2= gu.main %= 256 num 26 | execute store result storage gu:temp b int 1 run scoreboard players operation 3= gu.main /= 256 num 27 | 28 | execute store result score 0= gu.main run scoreboard players operation 1= gu.main = @s gu.uuid.3 29 | execute store result storage gu:temp c int 1 run scoreboard players operation 0= gu.main %= 256 num 30 | execute store result score 2= gu.main run scoreboard players operation 1= gu.main /= 256 num 31 | execute store result storage gu:temp d int 1 run scoreboard players operation 1= gu.main %= 256 num 32 | execute store result score 3= gu.main run scoreboard players operation 2= gu.main /= 256 num 33 | execute store result storage gu:temp e int 1 run scoreboard players operation 2= gu.main %= 256 num 34 | execute store result storage gu:temp f int 1 run scoreboard players operation 3= gu.main /= 256 num 35 | 36 | function gu:zzz/get_hexes with storage gu:temp 37 | function gu:zzz/concat_uuid with storage gu:temp -------------------------------------------------------------------------------- /data/gu/function/zzz/concat_uuid.mcfunction: -------------------------------------------------------------------------------- 1 | $data modify storage gu:main out set value "$(3)$(2)$(1)$(0)-$(7)$(6)-$(5)$(4)-$(b)$(a)-$(9)$(8)$(f)$(e)$(d)$(c)" -------------------------------------------------------------------------------- /data/gu/function/zzz/get_hexes.mcfunction: -------------------------------------------------------------------------------- 1 | $data modify storage gu:temp 0 set from storage gu:main hex_chars[$(0)] 2 | $data modify storage gu:temp 1 set from storage gu:main hex_chars[$(1)] 3 | $data modify storage gu:temp 2 set from storage gu:main hex_chars[$(2)] 4 | $data modify storage gu:temp 3 set from storage gu:main hex_chars[$(3)] 5 | $data modify storage gu:temp 4 set from storage gu:main hex_chars[$(4)] 6 | $data modify storage gu:temp 5 set from storage gu:main hex_chars[$(5)] 7 | $data modify storage gu:temp 6 set from storage gu:main hex_chars[$(6)] 8 | $data modify storage gu:temp 7 set from storage gu:main hex_chars[$(7)] 9 | $data modify storage gu:temp 8 set from storage gu:main hex_chars[$(8)] 10 | $data modify storage gu:temp 9 set from storage gu:main hex_chars[$(9)] 11 | $data modify storage gu:temp a set from storage gu:main hex_chars[$(a)] 12 | $data modify storage gu:temp b set from storage gu:main hex_chars[$(b)] 13 | $data modify storage gu:temp c set from storage gu:main hex_chars[$(c)] 14 | $data modify storage gu:temp d set from storage gu:main hex_chars[$(d)] 15 | $data modify storage gu:temp e set from storage gu:main hex_chars[$(e)] 16 | $data modify storage gu:temp f set from storage gu:main hex_chars[$(f)] -------------------------------------------------------------------------------- /data/gu/function/zzz/load.mcfunction: -------------------------------------------------------------------------------- 1 | scoreboard objectives add gu.main dummy 2 | scoreboard objectives add gu.uuid.0 dummy 3 | scoreboard objectives add gu.uuid.1 dummy 4 | scoreboard objectives add gu.uuid.2 dummy 5 | scoreboard objectives add gu.uuid.3 dummy 6 | scoreboard objectives add num dummy 7 | scoreboard players set 256 num 256 8 | data modify storage gu:main hex_chars set value ["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"] -------------------------------------------------------------------------------- /data/gu/function/zzz/store_uuid.mcfunction: -------------------------------------------------------------------------------- 1 | data modify storage gu:main in set from entity @s UUID 2 | execute store result score @s gu.uuid.0 run data get storage gu:main in[0] 3 | execute store result score @s gu.uuid.1 run data get storage gu:main in[1] 4 | execute store result score @s gu.uuid.2 run data get storage gu:main in[2] 5 | execute store result score @s gu.uuid.3 run data get storage gu:main in[3] -------------------------------------------------------------------------------- /data/minecraft/tags/function/load.json: -------------------------------------------------------------------------------- 1 | { 2 | "values": [ 3 | "gu:zzz/load" 4 | ] 5 | } -------------------------------------------------------------------------------- /pack.mcmeta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbsly/gu/31e573233944f5155ecc4a5bce8889d2f2b34479/pack.mcmeta --------------------------------------------------------------------------------