{"id":22957504,"url":"https://github.com/tca166/mcsavefileparsers","last_synced_at":"2025-04-02T01:45:16.137Z","repository":{"id":167376051,"uuid":"642572334","full_name":"TCA166/mcSavefileParsers","owner":"TCA166","description":"A collection of tools and libraries for extraction of data from Minecraft savefiles and 3d model generation","archived":false,"fork":false,"pushed_at":"2024-05-12T14:22:30.000Z","size":6551,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T16:43:31.208Z","etag":null,"topics":["3d-models","3d-reconstruction","c","c-library","minecraft","minecraft-saves","nbt","nbt-files","savefile","wavefront-obj"],"latest_commit_sha":null,"homepage":"https://tca166.github.io/mcSavefileParsers/","language":"C","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/TCA166.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":"2023-05-18T22:00:21.000Z","updated_at":"2024-05-12T14:22:33.000Z","dependencies_parsed_at":"2024-05-12T15:41:10.544Z","dependency_job_id":null,"html_url":"https://github.com/TCA166/mcSavefileParsers","commit_stats":null,"previous_names":["tca166/mcsavefileparsers"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCA166%2FmcSavefileParsers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCA166%2FmcSavefileParsers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCA166%2FmcSavefileParsers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCA166%2FmcSavefileParsers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TCA166","download_url":"https://codeload.github.com/TCA166/mcSavefileParsers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246741189,"owners_count":20826063,"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":["3d-models","3d-reconstruction","c","c-library","minecraft","minecraft-saves","nbt","nbt-files","savefile","wavefront-obj"],"created_at":"2024-12-14T17:17:30.122Z","updated_at":"2025-04-02T01:45:16.112Z","avatar_url":"https://github.com/TCA166.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcSavefileParsers\n\n[![GitHub Pages Documentation](https://img.shields.io/badge/GitHub_Pages-Documentation-blue)](https://tca166.github.io/mcSavefileParsers/)\n[![CodeQL](https://github.com/TCA166/mcSavefileParsers/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/TCA166/mcSavefileParsers/actions/workflows/github-code-scanning/codeql)\n[![Linux](https://github.com/TCA166/mcSavefileParsers/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/TCA166/mcSavefileParsers/actions/workflows/c-cpp.yml)\n[![Windows](https://github.com/TCA166/mcSavefileParsers/actions/workflows/c-cppWin.yml/badge.svg)](https://github.com/TCA166/mcSavefileParsers/actions/workflows/c-cppWin.yml)\n\nMultiple programs for Minecraft [save file data extraction](#data-extraction-utilities) and [3D model generation](#3d-model-generation) based on save files.\nAlso several well documented custom C libraries with minimal prerequisites for wavefront 3d model handling and Minecraft save file handling.\n\n[**User Manual**](https://tca166.github.io/mcSavefileParsers/md_doc_pages_userManual.html)\n\n## Capabilities\n\n- Generate a 3d model based on your Minecraft savefile blazing fast\n- extract chunk nbt from region files\n- generate mtl from minecraft resource packs\n- generate obj files from minecraft resource packs\n\n## Getting started\n\nIn order to get started either download the parts of the precompiled release that apply to your system or compile the source code yourself.\nIn order to compile use make, which is configured to allow for separate compilation of each utility, or complete compilation using the 'all' target ('windows' for cross-compilation).\n\n## Data extraction utilities\n\nMultiple utilities for Minecraft region file parsing.\nEither extract all [chunk NBT](https://minecraft.fandom.com/wiki/Chunk_format)s in a [region file](https://minecraft.fandom.com/wiki/Region_file_format) or just a single one.\n\n### regionFileReader\n\nThis program extracts all the chunks in the given region file into nbt files that will be created in the provided directory.\n\n```Bash\nregionFileReader \u003cpath to region file\u003e \u003coutput directory\u003e\n```\n\n### chunkExtractor\n\nThis program extracts only a single chunk with the given chunk coordinates into an nbt file.\n\n```Bash\nchunkExtractor \u003cpath to region directory\u003e \u003cx\u003e \u003cz\u003e\n```\n\n## 3D model generation\n\nMultiple tools that can take in Minecraft related files as input and create 3D representations of your worlds\n\n### modelGenerator\n\nAn open customizable chunk to 3d model converter.\nTakes in a chunk nbt file, a material file defining the look of blocks, an object file for non cube blocks and creates a 3d model based on that.\nIdeally the nbt file will be extracted using one of the tools above.\n\n```Bash\nmodelGenerator \u003cpath to nbt file\u003e ...\n```\n\nThe program accepts the following additional arguments:\n\n- -l $y+ $y- :limits the result model to the given vertical range\n- -f :disables face culling\n- -h :displays help\n- -s $s :changes the block side in the result side to the given s argument\n- -m $filename :sets the given filename as the source mtl file\n- -o $filename :sets the given filename as the source special objects file\n- -out $filename :sets the given filename as the output filename\n\n#### Mtl format\n\nThe generator if provided with the -m flag followed by the mtl file filepath will use the provided file as a material source and generate the obj file to support mtl materials. Blocks of minecraft:dirt will use a mtl material called dirt and so on. Feel free to create your own mtl file or use the mtl Gen to create one quickly.\n\n#### Obj format\n\nSo in order to handle non cube blocks the generator needs an obj file defining models for those \"special\" blocks.\nIf that file isn't provided the generator will simply assume everything is a cube.\nIn order for the special obj file to get interpreted properly the vertex coordinates in each object must be relative to the center of the object.\n\n### radiusGenerator\n\nA version of modelGenerator using multiprocessing that can generate models same as modelGenerator, but with multiple chunks at the same time.\nThis is the program you are going to want to use to generate your model.\nYou provide coordinates of a chunk that will act as a center for your model, a radius in which surrounding chunks will be added to the model and the radiusGenerator will create a large model for you.\nThe argument interface is very similar to modelGenerator and all rules about assets and limitations from modelGenerator apply here.\nThat being said here is how you use radiusGenerator:\n\n```Bash\nradiusGenerator \u003cpath to region directory\u003e \u003cx\u003e \u003cz\u003e \u003cradius\u003e ...\n```\n\n#### Cygwin\n\nYou may want to compile the Linux version of radiusGenerator and use it under Windows for speed.\nYou may accomplish that by installing [Cygwin](https://www.cygwin.com/) and compiling radiusGenerator in their environment.\nHowever due to POSIX shared memory management differing too greatly from Windows the cygserver needs to be running.\nIn order to do that install the correct package, then run:\n\n```Bash\ncygserver-config\nnet start cygserver\n```\n\n## Asset extractors\n\nMinecraft stores it's assets in it's own unique way.\nDue to this, and a need to provide assets for 3D model generators scripts were created.\nNaturally those assets aren't provided here since I want these programs to be Minecraft version independent (and I don't want to be sued).\n\n### mtlGen\n\nA script for generating complete and valid mtl files for modelGenerator\n\n```Bash\nmtlGen.py \u003cpath to /assets/minecraft/textures/block directory of a resource pack\u003e ...\n```\n\nThe script accepts the following additional arguments:\n\n- -s :Generates a simplified mtl file that doesn't use textures, but solid colors generated by averaging out RGBA values of all pixels\n- -t :Causes all textures with _top in name to be generated without it\n- -c :Enables green color correction to correct for the fact most vegetation textures are stored in greyscale\n\nDistribute the result at your own risk.\n\n### objGen\n\nA script for generating a complete obj file containing special object definition for modelGenerator\n\n```Bash\nobjGen.py \u003cpath to /assets/minecraft directory of a resource pack\u003e\n```\n\nDistribute the result at your own risk.\n\n### quickGen\n\nBatch script combining objGen.py and mtlGen.py in case you don't want to figure out how to use the two scripts\n\n```Bash\n./quickGen.sh \u003cpath to /assets/minecraft directory of a resource pack\u003e\n```\n\n### Minecraft default assets\n\nYou may generate mtl and obj files based on resource packs, or Minecraft default assets.\nIn order to find them, extract your minecraft version jar file as if it is a file archive.\nInside you will find default Minecraft textures and models.\n\n## cNBT\n\nFor parsing of the nbt files I have chosen to use the [cNBT](https://github.com/chmod222/cNBT/tree/master) library.\nThese are compiled automatically using make, and then linked together into cNBT.o.\n\n## API\n\nMost of the code has been organized into four \"libraries\".\nThese may prove to be useful should you want to parse Minecraft save files or generate wavefront 3D models.\nFeel free to use these as libraries in your projects just make sure to read the license before you do so.\nThe documentation for functions in these libraries should be mainly in header files and on [GitHub Pages](https://tca166.github.io/mcSavefileParsers/), and I will gladly expand it should there be a need so just let me know.\n\n- regionParser  \n    This library provides three functions for parsing region files.\n    You can either extract an entire chunk from the given region file, or extract all of them at once.\n- chunkParser  \n    This library utilizes the cNBT library to extract information about blocks from Minecraft NBTs\n- model  \n    This library is capable of generating wavefront 3D models\n- generator  \n    This library utilizes chunkParser and model to provide a simple interface with which you can quickly generate a 3D model from a Minecraft save file\n\n## License\n\nThis work is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftca166%2Fmcsavefileparsers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftca166%2Fmcsavefileparsers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftca166%2Fmcsavefileparsers/lists"}