Voxelis/mods/ITEMS/vox_coloring
2024-12-12 12:35:15 -08:00
..
init.lua Last night's work 2024-12-12 12:35:15 -08:00
mod.conf Last night's work 2024-12-12 12:35:15 -08:00
README.md Last night's work 2024-12-12 12:35:15 -08:00

Vox Coloring Mod

The vox_coloring mod is a dynamic and robust system for adding colorable items, blocks, and decorations to your Minetest game. It enables automatic registration of dyeable variants, recipes for applying and removing dyes, and integration with other mods.


Features

  • Dynamic Dye Registration:

    • Automatically generates colorable variants of nodes and items.
    • Uses a neutral "template" texture for consistent colorization.
  • Custom Recipes:

    • Recipes for dyeing nodes and items.
    • Recipes for reverting dyed objects to their original state.
  • Spraygun Tool:

    • Dye objects directly in the world with a spraygun.
  • Cleaning Station:

    • Revert dyed objects in bulk using the cleaning station.
  • Mod Integration:

    • Other mods can easily register their own dyeable items.

How to Use

Registering Dyeable Items/Blocks

To register a dyeable item or block, call the register_dyeable function in your mod:

-- List of dyeable things
local dyeable_blocks = {"sand", "terracotta", "marble", "cobblestone", "sandstone"}

Parameters:

modname: The name of your mod (e.g., vox_worldblocks).
base_item: The name of the base item/block to make dyeable.

Example:

vox_coloring.register_dyeable("vox_worldblocks", "sand")

Objects Added

Cleaning Solvent

Soap | Bucket of Water | Salt
 Ash 

Cleaning Station

Iron Ingot | Bucket of Water | Iron Ingot
   Stone   |       Soap      |   Stone
   Stone   |      Empty      |   Stone

Our recipe expects these to exist, but you can edit things to suit your game.

-- Ash
minetest.register_craftitem("vox_mats:ash", {
    description = "Ash",
    inventory_image = "ash.png",
    groups = {crumbly = 3},
})

-- Salt
minetest.register_craftitem("vox_mats:salt", {
    description = "Salt",
    inventory_image = "salt.png",
})

-- Lye
minetest.register_craftitem("vox_mats:lye", {
    description = "Lye",
    inventory_image = "lye.png",
})
minetest.register_craft({
    output = "vox_mats:lye",
    recipe = {
        {"vox_mats:ash", "bucket:water_bucket"},
    },
    replacements = {{"bucket:water_bucket", "bucket:bucket"}},
})

-- Soap
minetest.register_craftitem("vox_mats:soap", {
    description = "Soap",
    inventory_image = "soap.png",
})
minetest.register_craft({
    output = "vox_mats:soap",
    recipe = {
        {"vox_mobdrops:fat", "vox_mats:lye", "vox_mats:salt"},
    },
})

We also expect colors to be registered somewhere. Our personal example: Not full file, but vox_colors contains this part vox_coloring needs...

vox_colors = {
    WHITE       = "#FFFFFF",
    LIGHTGREY   = "#D3D3D3",
    SILVER      = "#C0C0C0",
    GREY        = "#808080",
    BLACK       = "#000000",
    RED         = "#FF0000",
    DARK_RED    = "#8B0000",
    YELLOW      = "#FFFF00",
    GOLD        = "#FFD700",
    ORANGE      = "#FFA500",
    PUMPKIN     = "#FF7518",
    CREAM       = "#FFFDD0",
    TAN         = "#D2B48C",
    BROWN       = "#A52A2A",
    DARK_BROWN  = "#8B4513",
    LIME        = "#00FF00",
    MINT        = "#98FF98",
    EMERALD     = "#50C878",
    DARK_GREEN  = "#006400",
    TURQUOISE   = "#40E0D0",
    TEAL        = "#008080",
    CYAN        = "#00FFFF",
    BLUE        = "#0000FF",
    NAVY        = "#000080",
    MAGENTA     = "#FF00FF",
    VIOLET      = "#EE82EE",
    PURPLE      = "#800080",
    INDIGO      = "#4B0082",
    PINK        = "#FF69B4",
    FLAMINGO    = "#FC8EAC",
}