-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
150 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# mcSavefileParsers | ||
|
||
[![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) | ||
[![Linux](https://github.com/TCA166/mcSavefileParsers/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/TCA166/mcSavefileParsers/actions/workflows/c-cpp.yml) | ||
[![Windows](https://github.com/TCA166/mcSavefileParsers/actions/workflows/c-cppWin.yml/badge.svg)](https://github.com/TCA166/mcSavefileParsers/actions/workflows/c-cppWin.yml) | ||
|
||
Welcome to mcSavefileParsers documentation! | ||
This is generally intended to be a resource for developers, but here's a [**User Manual**](https://tca166.github.io/mcSavefileParsers/md_doc_src_userManual.html) for the layman on how to use the utilities. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Utilities | ||
|
||
Quick overview of the developed utilities | ||
|
||
## Getting started | ||
|
||
In order to get started either download the parts of the precompiled release that apply to your system or compile the source code yourself. | ||
In 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). | ||
|
||
## Data extraction utilities | ||
|
||
Multiple utilities for Minecraft region file parsing. | ||
Either 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. | ||
|
||
### regionFileReader | ||
|
||
This program extracts all the chunks in the given region file into nbt files that will be created in the provided directory. | ||
|
||
```Bash | ||
regionFileReader <path to region file> <output directory> | ||
``` | ||
|
||
### chunkExtractor | ||
|
||
This program extracts only a single chunk with the given chunk coordinates into an nbt file. | ||
|
||
```Bash | ||
chunkExtractor <path to region directory> <x> <z> | ||
``` | ||
|
||
## 3D model generation | ||
|
||
Multiple tools that can take in Minecraft related files as input and create 3D representations of your worlds | ||
|
||
### modelGenerator | ||
|
||
An open customizable chunk to 3d model converter. | ||
Takes 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. | ||
Ideally the nbt file will be extracted using one of the tools above. | ||
|
||
```Bash | ||
modelGenerator <path to nbt file> ... | ||
``` | ||
|
||
The program accepts the following additional arguments: | ||
|
||
- -l $y+ $y- :limits the result model to the given vertical range | ||
- -f :disables face culling | ||
- -h :displays help | ||
- -s $s :changes the block side in the result side to the given s argument | ||
- -m $filename :sets the given filename as the source mtl file | ||
- -o $filename :sets the given filename as the source special objects file | ||
- -out $filename :sets the given filename as the output filename | ||
|
||
#### Mtl format | ||
|
||
The 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. | ||
|
||
#### Obj format | ||
|
||
So in order to handle non cube blocks the generator needs an obj file defining models for those "special" blocks. | ||
If that file isn't provided the generator will simply assume everything is a cube. | ||
In 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. | ||
|
||
### radiusGenerator | ||
|
||
A version of modelGenerator using multiprocessing that can generate models same as modelGenerator, but with multiple chunks at the same time. | ||
This is the program you are going to want to use to generate your model. | ||
You 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. | ||
The argument interface is very similar to modelGenerator and all rules about assets and limitations from modelGenerator apply here. | ||
That being said here is how you use radiusGenerator: | ||
|
||
```Bash | ||
radiusGenerator <path to region directory> <x> <z> <radius> ... | ||
``` | ||
|
||
#### Cygwin | ||
|
||
You may want to compile the Linux version of radiusGenerator and use it under Windows for speed. | ||
You may accomplish that by installing [Cygwin](https://www.cygwin.com/) and compiling radiusGenerator in their environment. | ||
However due to POSIX shared memory management differing too greatly from Windows the cygserver needs to be running. | ||
In order to do that install the correct package, then run: | ||
|
||
```Bash | ||
cygserver-config | ||
net start cygserver | ||
``` | ||
|
||
## Asset extractors | ||
|
||
Minecraft stores it's assets in it's own unique way. | ||
Due to this, and a need to provide assets for 3D model generators scripts were created. | ||
Naturally those assets aren't provided here since I want these programs to be Minecraft version independent (and I don't want to be sued). | ||
|
||
### mtlGen | ||
|
||
A script for generating complete and valid mtl files for modelGenerator | ||
|
||
```Bash | ||
mtlGen.py <path to /assets/minecraft/textures/block directory of a resource pack> ... | ||
``` | ||
|
||
The script accepts the following additional arguments: | ||
|
||
- -s :Generates a simplified mtl file that doesn't use textures, but solid colors generated by averaging out RGBA values of all pixels | ||
- -t :Causes all textures with _top in name to be generated without it | ||
- -c :Enables green color correction to correct for the fact most vegetation textures are stored in greyscale | ||
|
||
Distribute the result at your own risk. | ||
|
||
### objGen | ||
|
||
A script for generating a complete obj file containing special object definition for modelGenerator | ||
|
||
```Bash | ||
objGen.py <path to /assets/minecraft directory of a resource pack> | ||
``` | ||
|
||
Distribute the result at your own risk. | ||
|
||
### quickGen | ||
|
||
Batch script combining objGen.py and mtlGen.py in case you don't want to figure out how to use the two scripts | ||
|
||
```Bash | ||
./quickGen.sh <path to /assets/minecraft directory of a resource pack> | ||
``` |