@cauldria.dev/minecraft-common
v0.1.0
Published
Common Minecraft-related functions and helpers useful across most @cauldria.dev Minecraft packages (image IO, map color re-exports).
Readme
@cauldria.dev/minecraft-common
Common functions and helpers useful across the @cauldria.dev Minecraft
packages.
const common = require("@cauldria.dev/minecraft-common");
// Image IO: read .png (pngjs) or uncompressed .bmp (8/24/32-bit) into an
// RGBA buffer, write RGBA back out as .png.
common.readImage(file); // -> { width, height, data: Uint8Array }
common.writePNG(file, w, h, rgba); // RGBA -> .png
// Everything from @cauldria.dev/minecraft-map is re-exported:
common.nearestMapColor(r, g, b);
common.getMapColor(id, shade);
common.parseMapColor("GRASS/1");
common.imageToMapColors(img);
common.mapColorsToRGBA(colors);
common.scaleToMapSize(img);