Skip to main content

Module media

Module media 

Source
Expand description

A mod’s media as the tools see them: its .yres pictures (bytes and all), its .ytextures, and the files the build makes of them — so the IDE previews and edits what the build will make, converting nothing itself. Reading is cached until a file changes.

Structs§

Picture
One picture of a .yres set.
Texture
One of the mod’s textures.

Functions§

built_asset
The file the build makes at assets/<ns>/<path> from the mod at root — a texture’s PNG or .png.mcmeta (a .ytexture’s picture and animation, else a .yres picture of that path) — None when the build makes none there.
is_own_texture
Whether texture id is the mod’s own (it can be painted in place, or added).
mod_id
The id of the mod at root (its manifest’s).
picture
Picture @<set>.<name> of the mod at root.
pictures
Every picture of the mod at root.
save_picture
Writes bytes as picture @<set>.<name> of the mod at root (the set’s file made when there’s none); the file written.
save_texture_animation
Sets texture id’s animation (None: still); the .ytexture written.
save_texture_picture
Writes png as texture id’s picture: into the .yres picture its .ytexture names, or — a new texture — into the set its folder’s pictures go in, with a .ytexture naming it. The .yres written.
texture
Texture id of the mod at root, when it has a .ytexture.
textures
Every texture of the mod at root.