Modding - Craluminum-Mods/Banners GitHub Wiki

Modding

Adding new pattern

There are two ways of adding new pattern, either by creating new item that will hold new patterns or patching existing "pattern holder" (look into assets/flags/itemtypes/bannerpattern.json).

Step 1: Draw texture

For example, assets/flags/blocktypes/banner.json needs two 32x32 grayscale textures.

Other banners might require more, less or different sizes of textures.

In this tutorial we add examplepattern pattern.

Step 2 (Variant 1): JSON patching

First we need to add those grayscale textures to temporary folder

somemod/textures/block/banner/grayscales/pattern/examplepattern/grayscale-top.png
somemod/textures/block/banner/grayscales/pattern/examplepattern/grayscale-bot.png

Then we add two textures for banner itself

[
    {
        "op": "addmerge",
        "path": "/attributes/textures/topsymbol-examplepattern",
        "file": "flags:blocktypes/banner.json",
        "value": { "base": "somemod:block/banner/grayscales/pattern/examplepattern/{color}-top" }
    },
    {
        "op": "addmerge",
        "path": "/attributes/textures/botsymbol-examplepattern",
        "file": "flags:blocktypes/banner.json",
        "value": { "base": "somemod:block/banner/grayscales/pattern/examplepattern/{color}-bot" }
    }
]

TODO

Step 2 (Variant 2): New item

TODO

Step 3: Run command

TODO