{"id":16377547,"url":"https://github.com/zlataovce/takenaka","last_synced_at":"2025-05-09T02:38:28.575Z","repository":{"id":117694210,"uuid":"596960001","full_name":"zlataovce/takenaka","owner":"zlataovce","description":"A Kotlin library for reconciling multiple obfuscation mapping files from multiple versions of Minecraft: JE.","archived":false,"fork":false,"pushed_at":"2025-03-20T19:24:03.000Z","size":1084,"stargazers_count":69,"open_issues_count":4,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-03T03:05:08.893Z","etag":null,"topics":["hacktoberfest","java","mapper","mapping","minecraft","nms","obfuscation"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zlataovce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-03T10:06:26.000Z","updated_at":"2025-04-26T09:57:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5d91aa8-984a-4d0e-9dc7-4ff3be6f6ea5","html_url":"https://github.com/zlataovce/takenaka","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlataovce%2Ftakenaka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlataovce%2Ftakenaka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlataovce%2Ftakenaka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlataovce%2Ftakenaka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zlataovce","download_url":"https://codeload.github.com/zlataovce/takenaka/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253178856,"owners_count":21866617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","java","mapper","mapping","minecraft","nms","obfuscation"],"created_at":"2024-10-11T03:43:29.803Z","updated_at":"2025-05-09T02:38:28.551Z","avatar_url":"https://github.com/zlataovce.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# takenaka\n\n[![Maven releases](https://repo.screamingsandals.org/api/badge/latest/releases/me/kcra/takenaka/core?color=000000\u0026name=sandals-releases)](https://repo.screamingsandals.org/#/releases/me/kcra/takenaka)\n[![Maven snapshots](https://repo.screamingsandals.org/api/badge/latest/snapshots/me/kcra/takenaka/core?color=000000\u0026name=sandals-snapshots)](https://repo.screamingsandals.org/#/snapshots/me/kcra/takenaka)\n[![Discord](https://img.shields.io/discord/1151104250487783555?logo=discord)](https://discord.gg/HZhPBbxpFP)\n\nA Kotlin library for reconciling multiple obfuscation mapping files from multiple versions of Minecraft: JE.\n\nThe goal of this project is to improve the maintainability and performance of the [NMSMapper](https://github.com/ScreamingSandals/NMSMapper) library.\n\n## Features\n\n* fetching and deserialization of various mappings\n* parsing of the server and client JAR (modifiers, superclasses, superinterfaces and more)\n* mapping semantic analysis and error correction\n* cross-version mapping history comparison\n* web documentation generation (including generics!)\n* reflective/MethodHandle accessor generation\n\n### Mappings\n\n- [x] Mojang mappings\n- [x] Intermediary (FabricMC) mappings\n- [x] Searge (Forge) mappings\n- [x] Spigot mappings\n- [x] Yarn (FabricMC) mappings\n- [x] Hashed (QuiltMC) mappings\n- [x] QuiltMC mappings\n\n## Usage\n\n### generator-accessor-plugin\n\nA Gradle plugin for generating cross-version reflective accessors for plugins, mods, ...\n\nThis is an alternative to the traditional [paperweight-userdev](https://github.com/PaperMC/paperweight-test-plugin) + modularized abstraction approach,\nbut be warned, this requires a very good understanding of Java's [Reflection](https://www.oracle.com/technical-resources/articles/java/javareflection.html)\nand is by no means something a beginner developer should attempt.\n\nExample code listed here is in Gradle's Kotlin DSL flavor, but is also applicable to the Groovy DSL with minor adjustments.\n\nTo get started, include the ScreamingSandals repository for plugin management (`settings.gradle.kts`):\n```kt\npluginManagement {\n    repositories {\n        gradlePluginPortal()\n        \n        // add the ScreamingSandals repository for the Gradle plugin\n        maven(\"https://repo.screamingsandals.org/public\")\n    }\n}\n\n// ...\n```\n\nApply and configure the plugin in your buildscript (`build.gradle.kts`):\n```kt\n// the accessorRuntime() function is just sugar for \"me.kcra.takenaka:generator-accessor-runtime:${me.kcra.takenaka.gradle.BuildConfig.BUILD_VERSION}\"\nimport me.kcra.takenaka.generator.accessor.plugin.accessorRuntime\n\nplugins {\n    id(\"me.kcra.takenaka.accessor\") version \"\u003clatest version here, check the releases badge on the top of the page\u003e\" // apply the plugin\n}\n\nrepositories {\n    mavenCentral()\n\n    // add the ScreamingSandals repository for the mapping bundle\n    maven(\"https://repo.screamingsandals.org/public\")\n}\n\ndependencies {\n    mappingBundle(\"me.kcra.takenaka:mappings:1.8.8+1.20.6\") // the mapping bundle, published by the project at github.com/zlataovce/mappings\n    implementation(accessorRuntime()) // the small library needed for the accessors to function\n}\n\naccessors {\n    // you can select a version subset with versions or versionRange, i.e.:\n    \n    // versions(\"1.20.1\", \"1.20.2\", \"1.20.3\", \"1.20.4\", \"1.20.6\")\n    // versionRange(\"1.20.1\", \"1.20.6\")\n    \n    // if you don't, you will get accessors mapped for everything that the bundle offers, i.e. 1.8.8 to 1.20.6\n    \n    basePackage(\"org.example.myplugin.accessors\") // this is the base package of the generated output, probably somewhere in your plugin/library's namespace\n    namespaces(\"spigot\", \"mojang\") // these are the \"namespaces\" that can be queried on runtime, i.e. \"spigot\" (for Spigot/CraftBukkit/Paper), \"searge\" (for Forge), \"mojang\" (for Mojang-mapped Paper - \u003e1.20.4), \"yarn\" (not useful on runtime), \"intermediary\" (for Fabric), \"quilt\" or \"hashed\" (for Quilt)\n    accessorType(\"reflection\") // this is the generated accessor type, can be \"none\" (no accessor breakout classes are generated, only a mapping class that can be queried), \"reflection\" or \"method_handles\" (self-explanatory, java.lang.reflect or java.lang.invoke accessors)\n    \n    // there are many more options, like mapping for clients, IntelliJ's source JAR view and auto-complete are your friends (Ctrl+Click)\n    \n    // now, let's define what we want to access\n    mapClass(\"net.minecraft.network.Connection\") { // basically any name on mappings.dev apart from the obfuscated one, applies to other definitions as well\n        // NOTE: in one member declaration, the field type, method or constructor argument types and the method return type MUST all be from the same namespace (you CAN'T mix e.g. Mojang and Searge names in one declaration)\n        // the generation WILL fail if you do this!\n        \n        // NOTE: all mapped members are made accessible automatically (field.setAccessible(true), ...), so you don't need to worry about visibility modifiers\n    \n        // maps the \"Channel channel\" field\n        field(\"io.netty.channel.Channel\" /* the type of the field, can be a stringified type, a Java class or a KClass */, \"channel\" /* the name of the field */)\n        \n        // maps the \"Connection(PacketFlow arg0)\" constructor\n        constructor(\"net.minecraft.network.protocol.PacketFlow\" /* argument types of the constructor, same thing as the field type */)\n        \n        // maps the \"SocketAddress getRemoteAddress()\" method\n        method(java.net.SocketAddress::class /* the return type of the method, same thing as the field type */, \"getRemoteAddress\" /* the method name */)\n        \n        // maps the \"void disconnect(Component arg0)\" method\n        method(java.lang.Void.TYPE /* same thing, just a Java class instance */, \"disconnect\" /* same thing */, \"net.minecraft.network.chat.Component\" /* the method argument types, same thing as the field type */)\n    }\n    \n    // ... - more mapClass declarations\n}\n```\n\n### generator-web-cli\n\nA CLI to generate your own mapping documentation site ([mappings.dev](https://mappings.dev)).\n\nThe CLI artifact can be acquired either from [the ScreamingSandals Maven repository](https://repo.screamingsandals.org/#/releases/me/kcra/takenaka/generator-web-cli)\n(be sure to select the artifact with the `-all` classifier, else you're going to run into errors) or built and executed from source using the `runShadow` task:\n`./gradlew :generator-web-cli:runShadow --args='\u003capplication args here\u003e'`\n\nAvailable options can be shown using the `--help` argument, example:\n```\nUsage: web-cli options_list\nOptions: \n    --output, -o [output] -\u003e Output directory { String }\n    --version, -v -\u003e Target Minecraft version, can be specified multiple times (always required) { String }\n    --namespace, -n -\u003e Target namespace, can be specified multiple times, order matters { String }\n    --ancestryNamespace, -a -\u003e Target ancestry namespace, can be specified multiple times, has to be a subset of --namespace { String }\n    --cache, -c [cache] -\u003e Caching directory for mappings and other resources { String }\n    --server [false] -\u003e Include server mappings in the documentation \n    --client [false] -\u003e Include client mappings in the documentation \n    --strictCache [false] -\u003e Enforces strict cache validation \n    --clean [false] -\u003e Removes previous build output and cache before launching \n    --noJoined [false] -\u003e Don't cache joined mapping files \n    --minifier, -m [NORMAL] -\u003e The minifier implementation used for minifying the documentation { Value should be one of [deterministic, normal, none] }\n    --javadoc, -j -\u003e Javadoc site that should be referenced in the documentation, can be specified multiple times { String }\n    --synthetic, -s [false] -\u003e Include synthetic classes and class members in the documentation \n    --noMeta [false] -\u003e Don't emit HTML metadata tags in OpenGraph format \n    --noPseudoElems [false] -\u003e Don't emit pseudo-elements (increases file size) \n    --help, -h -\u003e Usage info\n```\n\nThe command-line to build a [mappings.dev](https://mappings.dev) clone would look something like this:\n`java -jar generator-web-cli-\u003clatest version here\u003e.jar --client --server -n mojang -n spigot -n yarn -n searge -n intermediary -v 1.20.2 -v 1.20.1 ... (more versions follow)`\n\n#### `--namespace` option\n\nThis option allows you to specify a custom namespace subset and preference ordering.\nUseful if you want to build an instance for only modding mappings for example.\n\nFor the Fabric toolchain, you would specify something along the lines of `-n yarn -n intermediary`,\nthat resolves only the Yarn and Intermediary mappings, with Yarn names used for the links/overview pages/...\nand Intermediary being a fallback that is used if a Yarn name is not present.\nBoth namespaces will still be shown as usual on class detail pages.\n\n*The `source` (obfuscated) namespace is always implicitly appended last.*\n\nBy default, all available namespaces are used (`mojang, spigot, yarn, quilt, searge, intermediary, hashed`).\n\n#### `--ancestryNamespace` option\n\nThis option allows you to select a subset of defined namespaces (`--namespace` choices or its default), which will be\nused for ancestry computation. This option is more advanced and most users won't need to use it, the default suffices for most cases.\n\nBy default, the `mojang, spigot, searge, intermediary` namespaces are used, minus ones that haven't been defined (`--namespace` choices or its default).\n\n#### `--javadoc` option\n\nThe expected value can be:\n- a plus-sign delimited pair of a supported package and a link to the Javadoc root (Javadoc sites _with no modules_): `org.slf4j+https://www.slf4j.org/api`\n- a link to the Javadoc root (Javadoc sites _with modules_): `https://docs.oracle.com/en/java/javase/17/docs/api`\n\n**Java 21 API is included automatically for indexing.**\n\n## Acknowledgements\n\n- the [NMSMapper](https://github.com/ScreamingSandals/NMSMapper) library and the ScreamingSandals members\n\n## Licensing\n\nThis library is licensed under the [Apache License, Version 2.0](https://github.com/zlataovce/takenaka/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzlataovce%2Ftakenaka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzlataovce%2Ftakenaka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzlataovce%2Ftakenaka/lists"}