Components Library

Description

Component Lib 🔗

This library intends on providing an API to dynamically create a set of components based off of a given material.

Docs 🔗

Creating a material 🔗

Materials are simply stored as a table of materials. As of right now, they have a name, description, and color as shown below

local example_materials = {
    -- A material contains 3 things
    --- A name, used for the registration
    --- A description, used for the display name of the item
    --- A color, used when colorizing the image
    cobalt_mat = {
        name = "cobalt",
        description = "Cobalt",
        color = "#06b5c9",
    },
}

Creating a component 🔗

Components are stored in a similar way as materials, but each needs a name, description, and an image to use when generating the items

local example_components = {
    -- Components are similar, you just need 3 things
    -- A name, used for registration (%s will be replaces with the material's name)
    -- A description, used for registration (%s will be replaces with the material's description)
    -- An image, which works the same way as normal luanti textures
    widget = {
        name = "%s_widget",
        description = "%s Widget",
        image = "component_lib_widget.png^[colorize:%s:100",
    }
}

TODO 🔗

  • [ ] Add node creation
  • [ ] Change mod name when being used as a library
  • [ ] Allow for the rest of craftitem things to be added
  • [ ] Better examples?

Reviews

Review

Do you recommend this mod?

Releases

v0.0.5

Download

2026-04-15 04:58 UTC

v0.0.5 Pre-Alpha: Materials know things 🔗

Materials now know what components were generated, and they can also decide what compents are allowed to be generated for them.

v0.0.4

Download

2026-04-12 19:09 UTC

v0.0.4 Pre-Alpha: Better Coloring 🔗

Materials now have more control over the texture used to create components based off of them. This is most useful when you want a different base texture color for different colors of materials. Materials also now hold the exact texture modifications used for applying a material to a component, allowing for more granular control.

v0.0.3

Download

2026-03-26 16:09 UTC

v0.0.3 Pre-Alpha: Nodes 🔗

Addition of node creation

v0.0.1

Download

2026-02-18 06:56 UTC

v0.0.1 Pre-Alpha 🔗

Pre-alpha release of this library

All releases

Information

Provides

component_lib

Dependencies

Required
No required dependencies
Optional
default

Information

Type
Mod
Technical Name
component_lib
Languages
English
License
LGPL-2.1-only for code,
CC-BY-SA-4.0 for media.
Maintenance State
Work in Progress
Added
2026-02-18 06:53 UTC
Maintainers
Mindcool25