Closed Juknum closed 3 months ago
Textures can be divided following their basic attributes:
sprite
atlas
Which can be described like so:
Should we split animated textures into their own category? or keep them in-between atlas/sprite?
Textures can be divided following their basic attributes:
sprite
: basic representation of a texture.atlas
: a composition of multiple sprites.Which can be described like so:
Types definition
```ts export interface Tags { name: string; } export type FileExtension = 'png' | 'tga' export type TextureName = string; export type MinecraftVersion = string; export type MinecraftEdition = 'java' | 'bedrock' | 'dungeons' export type TextureType = 'atlas' | 'sprite' | 'tiled' export type PackVariant = 'texture_pack' | 'resource_pack' export interface TexturePath { /** Paths that leads to the texture */ path: string, /** Minecraft versions where this path exist */ versions?: MinecraftVersion[] /** File extension */ extension: FileExtension; } export interface TextureUseExample JSON for a Sprite
```jsonc { "id": "grass_top", "alias": null, "type": "sprite", "tags": [ { "name": "block" }, { "name": "tinted" } ], "packs": ["faithful"], "configuration": { "tint": true, "mcmeta": null, "uses": [ { "edition": "java", "type": "texture_pack", "atlas": [ { "id": "terrain", "versions": [ "b1.7.3", "1.0", "1.1", "1.2.5", "1.3.2", "1.4.6" ] } ], "paths": [ { "path": "textures/blocks/grass_top", "extension": "png", "versions": [ "1.5.2" ] } ] }, { "edition": "java", "type": "resource_pack", "assets": "minecraft", "paths": [ { "path": "blocks/grass_top", "extension": "png", "versions": [ "1.6.4", "1.7.10", "1.8.9", "1.9.4", "1.10.2", "1.11.2", "1.12.2" ] }, { "path": "block/grass_top", "extension": "png", "versions": [ "1.13.2", "1.14.4", "1.15.2", "1.16.5", "1.17.1", "1.18.2", "1.19.2", "1.20" ] } ] }, { "edition": "bedrock", "paths": [ { "path": "textures/blocks/grass_top", "extension": "png" } ] } ] } } ```Example JSON for an Atlas
```jsonc { "id": "terrain", "alias": [], "type": "atlas", "description": "Atlas used for Minecraft version b1.7.3 until 1.5.2", "tags": [ { "name": "atlas" }, { "name": "block" }, { "name": "item" } ], "packs": ["faithful"], "configuration": { "size": { "c": 16, "r": 16 }, "uses": [ { "edition": "java", "type": "texture_pack", "paths": [ { "path": "terrain", "extension": "png", "versions": [ "b1.7.3", "1.0", "1.1", "1.2.5", "1.3.2", "1.4.6" ] } ] } ], "map": { "grass_top": { "pos": { "c": 0, "r": 0 }}, "emerald_block": { "pos": { "c": 9, "r": 1 }, "versions": ["1.3.2", "1.4.6"]}, "single_chest_bottom": { "pos": { "c": 9, "r": 1 }, "versions": ["b1.7.3", "...", "1.2.5"] }, "double_chest_front": { "pos": { "c": 9, "r": 2 }, "versions": ["b1.7.3", "...", "1.2.5"], "size": { "c": 2, "r": 1 }} } } } ```