Bug Closed · Resolved

bone tint replaces the item's custom model data colors list

#10153 opened by Marzion 5 days ago

Marzionreported this bug

Hi, my bone items use the custom model data colors list as data for a core shader (per-pixel colors + an alpha code). the bone tint replaces the whole colors list with a single color, so the item renders with the wrong colors.

It happens with the default white tint on the first tick, not just the red hurt flash, so setCanHurt(false) doesn't fix it.

Reproduction:

ItemStack item = new ItemStack(Material.PAPER);
item.editMeta(meta -> {
    var data = meta.getCustomModelDataComponent();
    data.setColors(List.of(Color.RED, Color.LIME, Color.BLUE, Color.YELLOW));
    meta.setCustomModelDataComponent(data);
});
bone.setRenderer(true);
bone.setModel(item);

Then read the colors back from bone.getModels() each tick:

canHurt true canHurt false
Seated [FF0000, 00FF00, 0000FF, FFFF00] same
Next tick [FFFFFF] [ FFFFFF ]
Entity Damaged [FF6666], then back to [FFFFFF] no change

Any of these would fix it for me: - A per-bone or per-model flag to skip tinting completely, default tint included. - Tinting leaves the colors list alone if the item already has one. - A per-bone item hook, where we give the bone a function that builds its item and Model Engine calls it when it updates the item, instead of editing ours.

Thanks!

PLUGIN CONFIG IS DEFAULT

Sign in to join the discussion.