{"id":18141403,"url":"https://github.com/bladehuntmc/rpp","last_synced_at":"2026-05-03T11:34:52.398Z","repository":{"id":258336095,"uuid":"863527238","full_name":"bladehuntmc/rpp","owner":"bladehuntmc","description":"Resource Pack Processor","archived":false,"fork":false,"pushed_at":"2025-02-11T22:11:35.000Z","size":165,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-06T09:02:04.133Z","etag":null,"topics":["gradle","gradle-plugin","java","kotlin","minecraft","resource-pack","resourcepack"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bladehuntmc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-09-26T12:57:50.000Z","updated_at":"2025-08-27T18:19:17.000Z","dependencies_parsed_at":"2024-10-18T14:27:07.653Z","dependency_job_id":null,"html_url":"https://github.com/bladehuntmc/rpp","commit_stats":null,"previous_names":["bladehuntmc/rpp"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bladehuntmc/rpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bladehuntmc%2Frpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bladehuntmc%2Frpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bladehuntmc%2Frpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bladehuntmc%2Frpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bladehuntmc","download_url":"https://codeload.github.com/bladehuntmc/rpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bladehuntmc%2Frpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32567449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gradle","gradle-plugin","java","kotlin","minecraft","resource-pack","resourcepack"],"created_at":"2024-11-01T17:06:45.059Z","updated_at":"2026-05-03T11:34:52.383Z","avatar_url":"https://github.com/bladehuntmc.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Resource Pack Processor\nThe *best* Gradle plugin that assists in building resource packs for development.\n\n## Plugin Overview\n### Tasks\n- **buildResourcePack** - Generates an output and code.\n- **cleanResourcePack** - Deletes the output directory.\n- **watchResourcePack** - Watches the source directory for file changes, then rebuilds the resource pack.\n- **startResourcePackServer** - Hosts an HTTP server for local development. In conjunction with the client library, resource packs can be iterated upon easily.\n\n### Configuration\n```kt\nplugins {\n    id(\"net.bladehunt.rpp\") version \"\u003cversion\u003e\"\n}\n\nrpp {\n    // Default source directory\n    sourceDirectory = \"src/main/rpp\"\n  \n    // Sets the output name of the archive and file containing the hash\n    baseArchiveName = \"resource_pack_$version\"\n  \n    // processJson() adds a FileProcessor that minifies Json. As a result of parsing, this also acts as a strict\n    // JSON validator. This also transpiles .jsonc to .json, .mcmeta.json to .mcmeta, and .mcmeta.jsonc to .mcmeta\n    processJson()\n    \n    // This will take a font file, then generate a corresponding class that allows for easy use.\n    generateFontClasses(matcher = Regex(...) /* Optional. If you're using a custom file format, you can create a regex to match them here */)\n  \n    // Creates a spaces font \u0026 optional utility class.\n    generateSpaces(\n        resource = Resource(\"rpp:spaces\"),\n        charCount = 8, // This will generate characters for 1, 2, 4, 8, 16, 32, 64, 128, and their corresponding negatives\n        `package` = \"net.bladehunt.rpp.generated.spaces\", // Optional: Allows for generating of the utility class for creating spaces\n        className = \"Spaces\" // If package is defined, this must also be defined\n    )\n  \n    server {\n        address = InetSocketAddress(\"127.0.0.1\", 8000)\n        \n        // If you would like to change the archive ID that is served, change it here\n        // Leaving it unchanged uses \"default\"\n        archiveId = \"my_custom_id\"\n    }\n    \n    // If you would like to use custom processors, add them\n    fileProcessor.add(MyFileProcessor)\n    \n    outputProcessor.add(MyOutputProcessor)\n    \n    archiveProcessors.add(MyArchiveProcessor)\n}\n```\n\n### Codegen\n\nCurrently, Font generation is only done with bitmap and space provider types.\n\nTo start, place a codegen configuration in your font's definition.\n```json5\n{\n  \"codegen\": {\n    \"package\": \"net.bladehunt.rpp.generated.font\",\n    \"className\": \"MyFontClass\"\n  },\n  \"providers\": [\n    {\n      \"type\": \"bitmap\",\n      \"file\": \"mygame:sprite/image.png\",\n      \"ascent\": 7,\n      \"height\": 7,\n      \"name\": \"IMAGE\", // This will generate an IMAGE field that uses the first character\n      \"chars\": [\n        \"\\uE000\"\n      ]\n    }\n  ]\n}\n```\n\n### Processors\n\nProcessors are a huge part of RPP, hence the name Resource Pack _Processor_. Two different types of processors are supported by RPP.\n\n* FileProcessor\n  * Outputs are tracked by RPP, so subsequent builds in the same _session_ only build the necessary files.\n* PostProcessor\n  * These processors are executed after certain steps. In the plugin configuration, there are two different fields: outputProcessors \u0026 archiveProcessors\n  * All PostProcessors in outputProcessors get executed after all files are copied \u0026 all FileProcessors have been executed, but before the default archive is generated.\n  * All PostProcessors in archiveProcessors get executed after the default archive is generated.\n\nBuilding your own processor is relatively simple. The recommended method is putting it in your `buildSrc` to stay organized.\n\nHere is an example of a simple FileProcessor that copies the values in `assets/minecraft/lang/all.json` to all the defined language codes\n```kt\nprivate val LANGUAGE_CODES = arrayOf(\n    \"af_za\",\n    \"ar_sa\",\n    // put any other language codes\n)\n\nclass LanguageProcessor : FileProcessor\u003cNothing?\u003e {\n    override fun BuildScope.process(file: FileData) {\n        // This is a \"lazy\" approach\n        // The recommended method is processing all the outputs\n        val source = file.outputs.firstOrNull() ?: return\n\n        // Decode the JSON. Rpp provides a kotlinx.serialization.json.Json instance that ignores comments \u0026 trailing commas\n        val all = try {\n            source.inputStream().use { Json.decodeFromStream\u003cMap\u003cString, String\u003e\u003e(it) }\n        } catch (_: SerializationException) {\n            return\n        }\n        \n        // Make sure all the fonts directory exists\n        val fonts = rpp.layout.build.output.resolve(\"assets/minecraft/lang\")\n        fonts.mkdirs()\n\n        LANGUAGE_CODES.forEach { language -\u003e\n            val langFile = fonts.resolve(\"$language.json\")\n            \n            // Load the current language file or create a new one\n            val output = if (langFile.exists()) {\n                try {\n                    val input = langFile.inputStream().use {\n                        Json.decodeFromStream\u003cMutableMap\u003cString, String\u003e\u003e(it)\n                    }\n                    all.forEach { (k, v) -\u003e\n                        input.putIfAbsent(k, v)\n                    }\n                    input\n                } catch (_: SerializationException) {\n                    return@forEach\n                }\n            } else {\n                langFile.createNewFile() // Create the new output\n                file.outputs.add(langFile) // Track the output\n                all\n            }\n\n            // Encode the output to the file\n            langFile.outputStream().use { Json.encodeToStream(output, it) }\n        }\n        \n        source.delete() // Delete the source\n        file.outputs.remove(source) // Untrack it\n    }\n\n    // Checks if the processor should execute.\n    // If you would like to do a more complex analysis, you can always just return in .process\n    override fun BuildScope.shouldExecute(file: FileData): Boolean =\n        file.source.absolutePath.endsWith(\"assets/minecraft/lang/all.json\")\n\n    // Contexts are shared throughout a session.\n    // They can be accessed just by calling getOrCreateSession() in .process\n    override fun createContext(rpp: ResourcePackProcessor): Nothing? = null\n}\n```\n\n## Client Overview\nThe client library is not strictly necessary to use RPP, but it improves development experience. Currently, it requires SLF4J to function.\n\n### Installation\n```kt\nrepositories {\n    maven(\"https://mvn.bladehunt.net/releases\")\n}\n\ndependencies {\n    implementation(\"net.bladehunt:rpp:\u003cversion\u003e\")\n}\n```\n\n### Example (Minestom/Adventure)\n```kt\nfun main() {\n    val server = MinecraftServer.init()\n\n    val rppClient = RppClient(URI(\"http://127.0.0.1:8000\")) { uri, hash -\u003e\n        // This assumes default RPP configuration with Minestom\n\n        Audiences.server().sendResourcePacks(\n            ResourcePackRequest.resourcePackRequest()\n                .packs(\n                    ResourcePackInfo.resourcePackInfo()\n                        .uri(uri)\n                        .id(UUID.randomUUID())\n                        .hash(hash.removeSuffix(\"\\n\")) // In some cases, a newline will be at the end of the hash. This will be fixed in an upcoming release\n                        .build()\n                )\n                .prompt(text(\"Please use the pack\"))\n                .replace(true) // Replace the packs\n                .required(true)\n                .build()\n        )\n    }\n\n    rppClient.start() // Starts on another thread. You can call .join() on the return of .start() to block.\n\n    server.start(\"127.0.0.1\", 25565)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbladehuntmc%2Frpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbladehuntmc%2Frpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbladehuntmc%2Frpp/lists"}