package info.u_team.u_team_core.intern.init;

import info.u_team.u_team_core.api.dye.*;
import info.u_team.u_team_core.item.USpawnEggItem;
import net.minecraft.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((itemstack, index) -> {
			final Item item = itemstack.getItem();
			if (item instanceof IDyeableItem) {
				return ((IDyeableItem) item).getColor(itemstack);
			}
			return 0;
		}, DyeableItemsRegistry.getDyeableItems().stream().toArray(Item[]::new));
		
		USpawnEggItem.LAZY_EGGS.forEach(pair -> {
			final USpawnEggItem item = pair.getValue();
			
			event.getItemColors().register((stack, color) -> {
				return item.getColor(color);
			}, item);
		});
	}
	
	public static void registerMod(IEventBus bus) {
		bus.addListener(UCoreColors::colorItem);
	}
}

@@ -399,20 +399,16 @@
 gister((
-item
 stack, i
@@ -439,20 +439,16 @@
  item = 
-item
 stack.ge
@@ -537,20 +537,16 @@
 etColor(
-item
 stack);%0A

Rename variable