Building Versions - PixelMineStudio/PixelMiner GitHub Wiki
Version_Mappings/version_mappings.json
The verion mappings folder is where all the pack definitions live. This JSON file is what the build process looks at to determine what to build. It starts at the top and works it's way down the list. Technically, you could add more platforms/games at the top level.
{
"Java": {
"1.16.5": { "pack_format": 6 },
"1.17.1": { "pack_format": 7 },
"1.18.2": { "pack_format": 8 },
"1.19.2": { "pack_format": 9 },
"1.19.3": { "pack_format": 12 },
"1.19.4": { "pack_format": 13 },
"1.20.1": { "pack_format": 15 },
"1.20.2": { "pack_format": 18 },
"1.20.4": { "pack_format": 22 },
"1.8.9": { "pack_format": 1 },
"1.12.2": { "pack_format": 3 },
"1.10.2": { "pack_format": 2 },
"1.14.4": { "pack_format": 4 },
"1.16.1": { "pack_format": 5 }
},
"Bedrock": {
"1.20.50": { "pack_format": 2, "zip_extension": ".mcpack" }
}
}
The first 2 levels of this JSON map directly to the expected folder structure.
Java/1.20.4
The pack folders contain any number of json files. It could be 1 it could be 100. Whatever is easiest for you to manage.
Each json item needs a "source" which is a UID and a "destination" which is the relative path location within the final pack.
{
"source": "TEXTURE_PACK",
"destination": "pack.png"
}
More complex definitions are possible using the "type" key and can be "grid", "stamp" or "tga" values.
GRID Atlas
The Grid type is the most simple atlas type. You give it a list of UIDs and a grid size and it places the textures into the grid. Just be careful that the number of textures does not exceed the total grid size. Shit explodes.
{
"type": "grid",
"source": [
"TEXTURE_EXPERIENCE_ORB_01",
"TEXTURE_EXPERIENCE_ORB_02",
"TEXTURE_EXPERIENCE_ORB_03",
"TEXTURE_EXPERIENCE_ORB_04",
"TEXTURE_EXPERIENCE_ORB_05",
"TEXTURE_EXPERIENCE_ORB_06",
"TEXTURE_EXPERIENCE_ORB_07",
"TEXTURE_EXPERIENCE_ORB_08",
"TEXTURE_EXPERIENCE_ORB_09",
"TEXTURE_EXPERIENCE_ORB_10",
"TEXTURE_EXPERIENCE_ORB_11",
"TEXTURE_EXPERIENCE_ORB_12",
"TEXTURE_EXPERIENCE_ORB_13",
"TEXTURE_EXPERIENCE_ORB_14",
"TEXTURE_EXPERIENCE_ORB_15",
"TEXTURE_EXPERIENCE_ORB_16"
],
"destination": "assets/minecraft/textures/entity/experience_orb.png",
"grid_size": [
4,
4
]
}
STAMP Atlas
The "stamp" type of atlas is one where the individual images are placed onto the atlas like stickers.
The old particles sheet is a good example of how a stamp atlas would look like, also the old paintings.png
{
"type": "stamp",
"source": [
{ "uid": "TEXTURE_GENERIC_0" , "position": [ 0, 0] },
{ "uid": "TEXTURE_GENERIC_1" , "position": [ 8, 0] },
{ "uid": "TEXTURE_GENERIC_2" , "position": [ 16, 0] },
{ "uid": "TEXTURE_GENERIC_3" , "position": [ 24, 0] },
{ "uid": "TEXTURE_GENERIC_4" , "position": [ 32, 0] },
{ "uid": "TEXTURE_GENERIC_5" , "position": [ 40, 0] },
{ "uid": "TEXTURE_GENERIC_6" , "position": [ 48, 0] },
{ "uid": "TEXTURE_GENERIC_7" , "position": [ 56, 0] },
{ "uid": "TEXTURE_SPLASH_0" , "position": [ 16, 8] },
{ "uid": "TEXTURE_SPLASH_1" , "position": [ 24, 8] },
{ "uid": "TEXTURE_SPLASH_2" , "position": [ 32, 8] },
{ "uid": "TEXTURE_BUBBLE" , "position": [ 0, 16] },
{ "uid": "TEXTURE_FISHING_HOOK", "position": [ 8, 16] },
{ "uid": "TEXTURE_FLASH" , "position": [ 32, 16] },
{ "uid": "TEXTURE_FLAME" , "position": [ 0, 24] },
{ "uid": "TEXTURE_LAVA" , "position": [ 8, 24] },
{ "uid": "TEXTURE_NOTE" , "position": [ 0, 32] },
{ "uid": "TEXTURE_CRITICAL_HIT", "position": [ 8, 32] },
{ "uid": "TEXTURE_LAVA" , "position": [ 16, 32] },
{ "uid": "TEXTURE_DAMAGE" , "position": [ 24, 32] },
{ "uid": "TEXTURE_HEART" , "position": [ 0, 40] },
{ "uid": "TEXTURE_ANGRY" , "position": [ 8, 40] },
{ "uid": "TEXTURE_GLINT" , "position": [ 16, 40] },
{ "uid": "TEXTURE_LAVA" , "position": [ 24, 40] },
{ "uid": "TEXTURE_LAVA" , "position": [ 0, 48] },
{ "uid": "TEXTURE_LAVA" , "position": [ 8, 48] },
{ "uid": "TEXTURE_DRIP_HANG" , "position": [ 0, 56] },
{ "uid": "TEXTURE_DRIP_FALL" , "position": [ 8, 56] },
{ "uid": "TEXTURE_DRIP_LAND" , "position": [ 16, 56] },
{ "uid": "TEXTURE_EFFECT_0" , "position": [ 0, 64] },
{ "uid": "TEXTURE_EFFECT_1" , "position": [ 8, 64] },
{ "uid": "TEXTURE_EFFECT_2" , "position": [ 16, 64] },
{ "uid": "TEXTURE_EFFECT_3" , "position": [ 24, 64] },
{ "uid": "TEXTURE_EFFECT_4" , "position": [ 32, 64] },
{ "uid": "TEXTURE_EFFECT_5" , "position": [ 40, 64] },
{ "uid": "TEXTURE_EFFECT_6" , "position": [ 48, 64] },
{ "uid": "TEXTURE_EFFECT_7" , "position": [ 56, 64] },
{ "uid": "TEXTURE_SPELL_0" , "position": [ 0, 72] },
{ "uid": "TEXTURE_SPELL_1" , "position": [ 8, 72] },
{ "uid": "TEXTURE_SPELL_2" , "position": [ 16, 72] },
{ "uid": "TEXTURE_SPELL_3" , "position": [ 24, 72] },
{ "uid": "TEXTURE_SPELL_4" , "position": [ 32, 72] },
{ "uid": "TEXTURE_SPELL_5" , "position": [ 40, 72] },
{ "uid": "TEXTURE_SPELL_6" , "position": [ 48, 72] },
{ "uid": "TEXTURE_SPELL_7" , "position": [ 56, 72] },
{ "uid": "TEXTURE_SPARK_0" , "position": [ 0, 80] },
{ "uid": "TEXTURE_SPARK_1" , "position": [ 8, 80] },
{ "uid": "TEXTURE_SPARK_2" , "position": [ 16, 80] },
{ "uid": "TEXTURE_SPARK_3" , "position": [ 24, 80] },
{ "uid": "TEXTURE_SPARK_4" , "position": [ 32, 80] },
{ "uid": "TEXTURE_SPARK_5" , "position": [ 40, 80] },
{ "uid": "TEXTURE_SPARK_6" , "position": [ 48, 80] },
{ "uid": "TEXTURE_SPARK_7" , "position": [ 56, 80] },
{ "uid": "TEXTURE_GLITTER_0" , "position": [ 0, 88] },
{ "uid": "TEXTURE_GLITTER_1" , "position": [ 8, 88] },
{ "uid": "TEXTURE_GLITTER_2" , "position": [ 16, 88] },
{ "uid": "TEXTURE_GLITTER_3" , "position": [ 24, 88] },
{ "uid": "TEXTURE_GLITTER_4" , "position": [ 32, 88] },
{ "uid": "TEXTURE_GLITTER_5" , "position": [ 40, 88] },
{ "uid": "TEXTURE_GLITTER_6" , "position": [ 48, 88] },
{ "uid": "TEXTURE_GLITTER_7" , "position": [ 56, 88] },
{ "uid": "TEXTURE_SGA_A" , "position": [ 8, 112] },
{ "uid": "TEXTURE_SGA_B" , "position": [ 16, 112] },
{ "uid": "TEXTURE_SGA_C" , "position": [ 24, 112] },
{ "uid": "TEXTURE_SGA_D" , "position": [ 32, 112] },
{ "uid": "TEXTURE_SGA_E" , "position": [ 40, 112] },
{ "uid": "TEXTURE_SGA_F" , "position": [ 48, 112] },
{ "uid": "TEXTURE_SGA_G" , "position": [ 56, 112] },
{ "uid": "TEXTURE_SGA_H" , "position": [ 64, 112] },
{ "uid": "TEXTURE_SGA_I" , "position": [ 72, 112] },
{ "uid": "TEXTURE_SGA_J" , "position": [ 80, 112] },
{ "uid": "TEXTURE_SGA_K" , "position": [ 88, 112] },
{ "uid": "TEXTURE_SGA_L" , "position": [ 96, 112] },
{ "uid": "TEXTURE_SGA_M" , "position": [104, 112] },
{ "uid": "TEXTURE_SGA_N" , "position": [112, 112] },
{ "uid": "TEXTURE_SGA_O" , "position": [120, 112] },
{ "uid": "TEXTURE_SGA_P" , "position": [ 0, 120] },
{ "uid": "TEXTURE_SGA_Q" , "position": [ 8, 120] },
{ "uid": "TEXTURE_SGA_R" , "position": [ 16, 120] },
{ "uid": "TEXTURE_SGA_S" , "position": [ 24, 120] },
{ "uid": "TEXTURE_SGA_T" , "position": [ 32, 120] },
{ "uid": "TEXTURE_SGA_U" , "position": [ 40, 120] },
{ "uid": "TEXTURE_SGA_V" , "position": [ 48, 120] },
{ "uid": "TEXTURE_SGA_W" , "position": [ 56, 120] },
{ "uid": "TEXTURE_SGA_X" , "position": [ 56, 120] },
{ "uid": "TEXTURE_SGA_Y" , "position": [ 56, 120] },
{ "uid": "TEXTURE_SGA_Z" , "position": [ 56, 120] }
],
"destination": "assets/minecraft/textures/particle/particles.png",
"canvas_size": [128, 128]
}
If you are feeling fancy you can also use the "stamp" atlas to cut parts out of images and compile them. This is sueful for textures where the UV layout has changed but the model has not, so the sizes of the parts is consistent.
"copy" is the part of the image you want to use. "rotate" let's you do clock-wise rotations, ideally in increments of 90. "position" is as above. You can also "flip" the image "Horizonal" or "Vertical" (case sensitive) if you need to. The default "stamp" just assumed a "copy" of the entire image in the code.
Parts are stamped from the top down in the json list and the alpha values will "accumulate" so you can paste alpha images on top of alpha images.
Note: The positions are relative to the original images sizes as defined in the UID_mapping.json. So even if your images are 1024x1024 the mapping might be at a 64x64 scale, like in the example below for the bed.
{
"type": "stamp",
"source": [
{ "uid": "TEXTURE_BED_RED", "copy": [6, 0, 22, 6], "rotate": 180, "position": [0, 7] },
{ "uid": "TEXTURE_BED_RED", "copy": [53, 21, 56, 24], "position": [0, 13] },
{ "uid": "TEXTURE_BED_RED", "copy": [50, 9, 53, 12], "position": [13, 13] }
],
"destination": "assets/minecraft/textures/blocks/bed_head_end.png",
"canvas_size": [16, 16]
},
TGA Atlas
Technically "tga" are the "stamp" type atlas but the RGB is filled 100% white first. I will probably remove this in the future and just make a way to generate a solid colour image as a layer in the atlas. Anyway, so all of this you can technically use as part of the "stamp" atlas type if you wanted to.
"use_for_alpha" uses the alpha of the texture only and replaces the alpha channel that exists if there is one.
"alpha_add" layers the texture alpha values on top of the existing alpha values additively by the specified amount.
So the example below is how we generate the Bedrock leggings item texture from the java images. Also of note is that if you don't specify a position for the "stamp" it assumes the top corner.
Any "stamp" or "tga" type atlas will be saved as a TGA file if the desination path ends in .tga.
{
"type": "tga",
"source": [
{ "uid": "TEXTURE_LEATHER_LEGGINGS" },
{ "uid": "TEXTURE_LEATHER_LEGGINGS_OVERLAY" },
{ "uid": "TEXTURE_LEATHER_LEGGINGS", "use_for_alpha": "True" },
{ "uid": "TEXTURE_LEATHER_LEGGINGS_OVERLAY", "alpha_add": 0.1 }
],
"destination": "textures/items/leather_leggings.tga",
"canvas_size": [16, 16]
}