Skip to content

IDye interface

gamrguy edited this page Apr 22, 2018 · 6 revisions

IDye

The IDye interface, available within the ShaderLib.Dyes namespace, allows for easy creation of dye items that do not rely on a shader bound to their item ID. While ShaderLib will normally look for a bound shader when applying dyes, any modded dyes that implement IDye's DyeID property will use DyeID as the shader ID instead.

Using IDye is very simple to implement; here's an example:

public class MyDye : ModItem,IDye
{
    public override DyeID => ShaderLoader.GetModShader<MyShader>(mod).ID;
}

Please note that after implementing IDye you will still have to set item.dye to be greater than 0 or the game won't let you equip it.

Clone this wiki locally