Importing Resource Packs - PixelMineStudio/PixelMiner GitHub Wiki
The pack importer looks up the pack_format and reverses the build process for that version, pushing the files into a specified source directory. You can do this with your existing resource_pack or any of the minecraft defaults.
Note: the version mappings are far from perfect and will take some work to become complete. So you might notice some missing images in the imported source that are present in the pack before importing. To correct this you can add the image to the version mapping files, create a UID for it and add it to the source_mapping.json and specify where you want the file to live. If you re-import your pack the file will be present.
Note: the atlas currently does not run on the importer. So if you are importing older pack_formats the imported images might be incorrect.
[Pack].json
This file lives in the root beside the exe and contains the paths for all things related to the imported pack. You can of course edit these and move the files if needed. By default all packs use the same version_mappings_file, but you could duplicate this directory and create a unique set of mappings for different needs.
#Resource Pack Build Config
#Directories
source_dir: "SmoothOperator"
mappings_dir: 'Version_Mappings'
output_dir: "Pack_Builds"
log_output_dir: "Pack_Builds/_logs"
tempfile_dir: "Pack_Builds/_temp"
#Files
pack_config_file: 'SmoothOperator/pack.config'
version_mappings_file: 'Version_Mappings/version_mappings.json'
source_mapping_file: 'SmoothOperator/source_mapping.json'
[Pack]/Pack.json
Inside the source_dir for the pack is the pack.json. This is sort of editable from within the GUI, but you can also edit it here.
You can add additional variables and they shoudl show up in the GUI. These variables can be injected into files (see below)
name: Smooth Operator
description: \u00A75PixelMine.com\u00A76
pack_version_number:
- 0
- 9
- 45
resolutions:
0: 256x
1: 128x
2: 64x
3: 32x
pack_uuid: 2ede356d-10de-49b7-90ca-486dc57c9e62
module_uuid: 649119bf-6fd5-4ee6-9c06-9c213e0b00f7
Source_Mapping.json
The source mapping file creates UIDs for every file in your resource pack, that is later used to match to a build UID mapping file for each version you want to build. This is a HUGE file with every texture and file that can be build for any version. Right now this is not connected to the editor, except that the editor looks at this file and loads all the file in it, if the file is missing it displays a placeholder image.
"META_PACK_JAVA": {
"path" : "pack/pack.mcmeta",
"inject": "TRUE"
},
"META_PACK_BEDROCK": {
"path" : "pack/manifest.json",
"inject": "TRUE"
},
"TEXTURE_PACK": {
"path": "pack/pack.png",
"resolution": [128, 128]
}
Source File Organization
Since the source files are connected through the build process by the UIDs, it is possible to reloacte any of the images to other folders in any way that you want. Just be careful to update the source_mapping.json when you do. Disconnected images won't display in the editor, so they will be hard to find.
You can have as many subdirectories as you want, although I would advise against it. All files are displayed in the editor by their root directory. So Mobs are all in their own subdirectories, but in the editor they all appear under the MOB folder.
Resolution and Version Overrides
It is possible to create version overrides as well as
Version Overrides
Here is an example of a version override in the [Pack]/source_mapping.json file for water. Version overrides are retroactive, meaning they apply to any earlier version as well.
"TEXTURE_WATER_STILL": {
"path": "vfx/water_still.png",
"resolution": [16, 512],
"versions": {
"1.12.2": { "path": "vfx/water_still_legacy.png", "resolution": [16, 512] }
}
}
Resolution Overrides
Adding "_XXpx" to the end of any image file will force the build process to use this image for that exact resolution output of the image. This is not inclusive of higehr or lower resolutions, so it will only work at that specific reoslution.
sword_diamond.png <-- 256x256 resolution
sword_diamond_64px.png <-- 64x64 resolution
sword_diamond_32px.png <-- 32x32 resolution
In this example the original version is 256x256 pixels, to the 128px version would be a downsample of the original, the 64px and the 32px verisons would be used without rescale and the 16px version would be a downsample of the original.
Placeholder previews
You can edit missing file placeholders that are in the "assets" folder.
Fallback Files
The source mapping file for each resource pack can include fallback files for any files that will be applied during the build process. This is primarily used for converting Java to Bedrock, since when you import a Bedrock pack it will not include a pack.mcmeta file by default.
"META_PACK_JAVA": {
"path": "pack/pack.mcmeta",
"fallback": "assets/template_pack.mcmeta",
"inject": "TRUE"
}
Variable Injections
Add "inject": "TRUE" to any source file definition will cause the build process to open the file (assuming it is a text file) and attempt to replace any %placeholder% variables with the same name as any of the variables defined in the pack.config. This is how the build process is able to handle pack.mcmeta, version.mcmeta and manifest.json file difference in various platforms and formats.
"META_PACK_JAVA": {
"path" : "pack/pack.mcmeta",
"inject": "TRUE"
}