package info.u_team.u_team_core.intern.init;

import info.u_team.u_team_core.api.dye.DyeableItemsRegistry;
import info.u_team.u_team_core.api.dye.DyeableItem;
import net.minecraft.world.item.Item;
import net.minecraftforge.client.event.ColorHandlerEvent;
import net.minecraftforge.eventbus.api.IEventBus;

public class UCoreColors {
	
	private static void colorItem(ColorHandlerEvent.Item event) {
		event.getItemColors().register((stack, index) -> {
			final var item = stack.getItem();
			if (item instanceof DyeableItem) {
				return ((DyeableItem) item).getColor(stack);
			}
			return 0;
		}, DyeableItemsRegistry.getDyeableItems().stream().toArray(Item[]::new));
	}
	
	public static void registerMod(IEventBus bus) {
		bus.addListener(UCoreColors::colorItem);
	}
}

@@ -89,25 +89,16 @@
 ableItem
-sRegistry
 ;%0Aimport
@@ -133,32 +133,41 @@
 .dye.DyeableItem
+sRegistry
 ;%0Aimport net.min
@@ -451,25 +451,12 @@
 %0A%09%09%09
-final var item = 
+if (
 stac
@@ -470,21 +470,8 @@
 em()
-;%0A%09%09%09if (item
  ins
@@ -489,16 +489,24 @@
 ableItem
+ dyeable
 ) %7B%0A%09%09%09%09
@@ -516,28 +516,15 @@
 urn 
-((D
+d
 yeable
-Item) item)
 .get

Use nice instanceof