This file contains hidden or 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
| const MANIFEST_URL = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json"; | |
| const categorizeVersion = (version) => { | |
| const v = version.id; | |
| if (v.startsWith("c") || v.startsWith("rd-")) return "classic"; | |
| if (v.startsWith("inf-") || v.startsWith("in-")) return "infdev_indev"; | |
| if (v.startsWith("a")) return "alpha"; | |
| if (v.startsWith("b")) return "beta"; | |
| if (/^\d{2}w\d{2}[a-z]/.test(v) || /^\d{4}/.test(v)) return "snapshots"; |
This file contains hidden or 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
| // A streaming DataView abstraction. (c) 2024 zlataovce (github.com/zlataovce) | |
| // License: Public domain (or MIT if needed). Attribution appreciated. | |
| // https://gist.github.com/zlataovce/7db8bc7cfe8b7897816495bf2ec3858d | |
| const DEFAULT_LITTLE_ENDIAN = true; | |
| const MIN_READ = 1024; // 1 KiB | |
| const INITIAL_BUF_SIZE = MIN_READ * 1.5; // 1.5 KiB | |
| type Awaitable<T> = T | PromiseLike<T>; | |
| export const EOF = new Error("End of stream"); |
This file contains hidden or 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
| // An offset-tracking DataView abstraction. (c) 2024 zlataovce (github.com/zlataovce) | |
| // License: Public domain (or MIT if needed). Attribution appreciated. | |
| // https://gist.github.com/zlataovce/42b87282e33bef4295981e177754dc13 | |
| const DEFAULT_BUFFER_SIZE = 1024; | |
| const DEFAULT_RESIZE = 32; | |
| const DEFAULT_LITTLE_ENDIAN = true; | |
| export interface Buffer { | |
| view: DataView; | |
| arrayView: Uint8Array; |
This file contains hidden or 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
| package dev.cephx.cfr.reader; | |
| import java.util.Objects; | |
| public final class ClassNode { | |
| private int major; | |
| private int minor; | |
| private int access; | |
| private String name; |
This file contains hidden or 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
| from argparse import ArgumentParser | |
| from re import compile | |
| CLASS_PATTERN = compile(r" -> ([^:]+):$") | |
| # you can get these mapping files at Spigot's developer hub and Mojang's version metadata | |
| # and you can get the links to them from https://mappings.cephx.dev/1.20.1/licenses.html | |
| if __name__ == "__main__": | |
| parser = ArgumentParser(description="Joins Mojang ProGuard and Spigot CSRG class mappings.") | |
| parser.add_argument("--mojang", "-m", help="the Mojang mapping path", default="./server.txt") |