Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import std.mem;
import hex.dec;
import std.io;
using int = s32;
enum TextureFormat : u16 {
Unknown = 0,
Alpha8 = 1,
R8 = 2,
function indexOfMatch<T>(value: T, values: T[]) {
return values.indexOf(value)
}
interface Card {
power: [number, number, number, number],
team: number
}
enum UpdateKind {
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> everything
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> from <advancement/minecraft:resource_location>
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> only <advancement/minecraft:resource_location> [<criterion/brigadier:string[type: greedy]>]
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> through <advancement/minecraft:resource_location>
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> until <advancement/minecraft:resource_location>
advancement revoke <targets/minecraft:entity[type: players, amount: multiple]> everything
advancement revoke <targets/minecraft:entity[type: players, amount: multiple]> from <advancement/minecraft:resource_location>
advancement revoke <targets/minecraft:entity[type: players, amount: multiple]> only <advancement/minecraft:resource_location> [<criterion/brigadier:string[type: greedy]>]
{
"header": {
"unk_version_1": 1,
"unk_version_2": 517
},
"items": [
{
"name": "Relay",
"guid": "DAA95265-FE3D-934B-84D4-FAAF5AF8F81F",
"unk1": "01000000-0000-0000-0000-0000EA070000",
@brecert
brecert / ubjson.hexpat
Created February 22, 2024 02:17
ubjson.hexpat
#pragma author bree
#pragma description UBJSON ( Universal Binary JSON) format
#pragma MIME application/ubjson
#pragma endian big
#include <std/io.pat>
#include <std/mem.pat>
#include <std/string.pat>
@brecert
brecert / pnp.pat
Last active September 6, 2024 19:57
#pragma endian big
import type.magic;
import std.array;
using f32 = float;
fn relative_to_parent(u128 offset) {
return addressof(parent) + offset;
};
https://flems.io/#0=N4IgtglgJlA2CmIBcA2ATAOgBwoDQgDMIEBnZAbVADsBDMRJEDACwBcxYR8BjAeytbwByEAB5uNKgDcaJAAQB3aK2YBeFABY5zeBADmbdVoD0APi4gS8BN1YR+ZRgAYkaFCAC+uanQZMAVmQ8-ILCjHxUJKxytgAecqpyULzcAK70AhgARrxQAJ4YAI6p8ABOeQDK1vC2vKUAFADkEtKyjQCUGHrwrADCIfCxrE1oUB0AOlSTBKlUtvZUct2sALK8qVYACrwk9S0yJLhy8O1ywJNycjKlcjmzUPKJ+7JdPQBC61RQEFR6vbAQISsABKNWG7QA3Bc5NCIlE5LIAA5ghJnaGXJRQFRIW6fB4YTEqOTGGKsWIYZ4kAnKZhyAA+dLkTlw6O0ugMrBxdy+VJ0+jYxNJ5MpLHZAoZTJZizkHihU2lCGi8USKxoKgwpTx9XgGF4BAIVlYAA1BUiwdSscxIdDFXI8qjVerNfdtbr9YaAJqmkjI2yi-msa3S2EOaJRGhZBCo87Sy6xHEQEgAMR+EEE9VipwA-HJ4jjmay8gnk6n03ls3a5PmpZdZdDoaUeqlSotw5H4HKPJNJnEMERYLAKqw8lHEo0AMT6pzTpyNHtkvvEWCg2z1ACMRw3ci3a-a3aotqgpRoej0Pz0qIINFgVjlvZF-ERvB+glKyQUi0S2tOqlMaOlR4nmevyoqwpQlHKlxwtEwC5kc9oeKiyxrBs8DbLs96SAcRwnLCC79suYIZvBm6bnuVBdvKmGtFSj7PgIZRgLwUjwKi34JH+MaXBABD1IBp7nqcXGXDEoZnHBlaIYkyHrFsOx7AulI4eRIlCouA4rsMsQkduZHQpRlHzsKWEvHRL5lKkiJsScHH-pc-HAReiRXjeHaTIZVAzHMdj8Ekx4KPUQkhpE0RpKUjYCEmx70KivbLAAkmAJ7wAAImqND1MykpqSKhLMEc1EHP6HIqTC0rQUsPSbBAsTWGx2l2j+f5hRFrBRb4GBQO
float round(float n) {
return floor(n) + step(-0.5, n - ceil(n));
}