MrCrayfish's Gun Mod

MrCrayfish's Gun Mod

25M Downloads

Non-dyeable guns/attachments can't have a reticle color

Autovw opened this issue ยท 0 comments

commented

In most add-ons the dye behaviour is made toggleable per weapon. CGM offers this for attachments by default. There are multiple use-cases for this, but most of the time it's because the default texture of the weapon/attachment is simply preferred.

However, the reticle color can only apply to guns and attachments if they are "dyeable". This means that you are stuck with the default texture color (even if you were to use the reticleColor field in cgmmeta) of the reticle, unless you turn the dyeable behaviour back on.

It would be great if this can be seperated to still allow for reticle colors, even if the dye behaviour is disabled.

See ClientHandler#registerColors() for reference:

ItemColor color = (stack, index) ->
{
if(!IColored.isDyeable(stack))
{
return -1;
}
if(index == 0 && stack.hasTag() && stack.getTag().contains("Color", Tag.TAG_INT))
{
return stack.getTag().getInt("Color");
}
if(index == 0 && stack.getItem() instanceof IAttachment)
{
ItemStack renderingWeapon = GunRenderingHandler.get().getRenderingWeapon();
if(renderingWeapon != null)
{
return Minecraft.getInstance().getItemColors().getColor(renderingWeapon, index);
}
}
if(index == 2) // Reticle colour
{
return PropertyHelper.getReticleColor(stack);
}
return -1;
};