Client
TConJSEvents.materialColorSprite(handler: (event: MaterialColorSpriteEventJS) => void)
TConJSEvents.materialColorSprite((event) => {
event.addMaterialColorSprite(
"tconstruct",
"cobalt",
(sprite) => {
sprite
.color("FF2376DD")
.fallback("metal")
.suuportStats(
"tconstruct:head",
"tconstruct:handle",
"tconstruct:binding",
"tconstruct:repair_kit",
"tconstruct:limb",
"tconstruct:grip",
"tconstruct:armor_plating",
"tconstruct:plating_helmet",
"tconstruct:plating_chestplate",
"tconstruct:plating_leggings",
"tconstruct:plating_boots",
"tconstruct:plating_shield",
"tconstruct:maille",
"tconstruct:armor_maille",
"tconstruct:shell"
)
.transformerType("tconstruct:recolor_sprite")
.colorMapping("tconstruct:grey_to_color")
.addPalette(0, "FF000000")
.addPalette(63, "FF001944")
.addPalette(102, "FF00296D")
.addPalette(140, "FF0043A5")
.addPalette(178, "FF186ACE")
.addPalette(216, "FF338FEA")
.addPalette(255, "FF59A6EF");
}
);
});
| Method | Description |
addMaterialSprite(
namespace: string,
material: string,
builder: (builder: MaterialColorBuilder) => void
): void
| Add a material color sprite |
addMaterialSprite(
material: string,
builder: (builder: MaterialColorBuilder) => void
): void
| Add a material color sprite (namespace is kubejs) |
addMaterialSprite(
namespace: string,
material: string,
builder: (builder: MaterialColorBuilder) => void
): void
addMaterialSprite(
material: string,
builder: (builder: MaterialColorBuilder) => void
): void
namespace: string - Material namespace (default namespace is kubejs)material: string - Material namebuilder: (builder: MaterialColorBuilder) => void - Material color builder
MaterialColorBuilder
| Method | Description |
color(color: string): MaterialColorBuilder
| Set the material color |
fallback(fallback: string): MaterialColorBuilder
| Set the fallback sprite for the material color sprite |
fallbacks(...fallbacks: string[]): MaterialColorBuilder
| Set fallback sprites for the material color sprite (multiple) |
supportStat(stats: string): MaterialColorBuilder
| Set a supported material stat for the material color sprite |
supportStats(...stats: string[]): MaterialColorBuilder
| Set supported material stats for the material color sprite (multiple) |
addPalette(gray: int, hexColor: string): MaterialColorBuilder
| Add a palette entry for the material color sprite |
addPaletteFromArray(...palettes: String[]): MaterialColorBuilder
| Add palette entries for the material color sprite (multiple) |
transformerType(type: string): MaterialColorBuilder
| Set the transformer type for the material color sprite |
colorMappingType(type: string): MaterialColorBuilder
| Set the color mapping type for the material color sprite |
extraTransformer(key: string, value: object)
| Set extra transformers for the material color sprite |