Skip to content
Diamond edited this page Jul 28, 2023 · 5 revisions

Simple Trims

This wiki contains (in some cases will contain) a tutorial on how to use this mod, including Simple Trim Materials/Patterns, Definitions, Encoded Palettes, & File Structure.

Simple Trim Materials

Simple Trim Materials are what Simple Trims uses to generate everything needed for a trim material. The process of creating a Trim Material using Simple Trims requires at most two files: A palette, and a "defintion".

Definition

Definition files give a Simple Trim Material information to appear in game.

Defintion files are created at data/<namespace>/simple_trim_material/. They are written in JSON (.json) Format, and are structured similarly to that of a vanilla trim_material defintion.

Internal Representation: net.diamonddev.simpletrims.data.SimpleTrimsDataLoader$MaterialBean

Fields

Field Name Type Default Value Notes
encoded_palette boolean true Determines whether to look for a palette texture in a resource pack, or in the datapack. true searches in the datapack.
asset_name string null [Optional] Provides the internal resource name used to locate the palette, and to generate identifiers. If left blank, defaults to the file name.
description Description [Required] Provides a text component for the trim tooltip.
properties Properties [Optional] Provides special properties for the material type, such as being emissive.
ingredient string [Required] An identifier pointing to the in-game item that will be used to craft this trim material.

Example:

{
    "encoded_palette": true,
    "asset_name": "dirt",
    "description": {
        "color": "#633200",
        "translate": "material.example.dirt"
    },
    "ingredient": "minecraft:dirt"
}

Encoded Palettes

Encoded Palettes are an alternative to using a palette in a resource pack. Encoded Palettes are textures located in the data pack, which are loaded on the server, turned into an array of bytes and sent to connecting clients, which recompile those bytes into an image.

Encoded Palettes take a PNG (.png) format, and are placed at data/<namespace>/encodable_palettes/.

To use an encoded palette, a Defintion file must have "encoded_palette" set to true. Alternatively, when "encoded_palette" is false, SimpleTrims will obtain a palette from the same place as the vanilla trim system, at assets/<namespace>/textures/trims/color_palettes/.

Internal Representation: net.diamonddev.simpletrims.data.PaletteEncoderDecoder$EncodedPalette(Encoded), net.minecraft.client.texture.NativeImage (Decoded)

Object Types

Description Type

Used by Simple Trim Materials to supply a description and text color for the material.

Internal Representation: net.diamonddev.simpletrims.data.SimpleTrimsDataLoader$MaterialBean$DescriptionBean

Fields

Field Name Type Default Value Notes
color string [Required] A string representing a case-insensitive Hexcode. Should be formatted with the hash (#) prefixed to the hexadecimal number. (For example, the color white would be represented as "#FFFFFF")
translate string [Half-Required] See note below. Points to a translation key in assets/<namespace>/lang/<lang>.json.
translations Array of Translations [Half-Required] Only one of translate or translations is required. translate takes priority.

Translations Type

Used by Descriptions to supply translations without the need for a <lang>.json file in a resource pack.

Internal Representation: net.diamonddev.simpletrims.data.SimpleTrimsDataLoader$MaterialBean$LangBean

Fields

Field Name Type Default Value Notes
lang string [Required] A Locale code. (Example: "en_us", "fr_fr", etc.)
string string [Required] The text, translated into the language represented by lang. If a language is not included, translations will fallback to en_us. If en_us is not included, text will fallback to a generated translation code.

Properties Type

Used by Trim Materials to supply special properties for the material.

Internal Representation: net.diamonddev.simpletrims.data.SimpleTrimsDataLoader$MaterialBean$PropsBean

Fields

Field Name Type Default Value Notes
emissive boolean false If true, trims using this material will appear to glow in the dark. A vanilla example of an emissive texture is the Glow Squid texture. Please note that no actual light is given off, and this does not work with shaders.