@@ -0,0 +1,1984 @@
+package info.u_team.u_team_core.intern.init;%0A%0Aimport info.u_team.u_team_core.item.USpawnEggItem;%0Aimport net.minecraft.block.DispenserBlock;%0Aimport net.minecraft.entity.*;%0Aimport net.minecraft.entity.player.PlayerEntity;%0Aimport net.minecraft.util.Direction;%0Aimport net.minecraftforge.client.event.ColorHandlerEvent;%0Aimport net.minecraftforge.eventbus.api.IEventBus;%0Aimport net.minecraftforge.fml.event.lifecycle.*;%0A%0Apublic class UCoreLazySpawnEggs %7B%0A%09%0A%09private static void setup(FMLCommonSetupEvent event) %7B%0A%09%09event.enqueueWork(() -%3E %7B%0A%09%09%09USpawnEggItem.LAZY_EGGS.forEach(pair -%3E %7B%0A%09%09%09%09final EntityType%3C?%3E type = pair.getKey().getValue();%0A%09%09%09%09final USpawnEggItem item = pair.getValue();%0A%09%09%09%09%0A%09%09%09%09item.typeIn = type;%0A%09%09%09%09%0A%09%09%09%09DispenserBlock.registerDispenseBehavior(item, (source, stack) -%3E %7B%0A%09%09%09%09%09final Direction direction = source.getBlockState().get(DispenserBlock.FACING);%0A%09%09%09%09%09final EntityType%3C?%3E entityType = ((USpawnEggItem) stack.getItem()).getType(stack.getTag());%0A%09%09%09%09%09entityType.spawn(source.getWorld(), stack, (PlayerEntity) null, source.getBlockPos().offset(direction), SpawnReason.DISPENSER, direction != Direction.UP, false);%0A%09%09%09%09%09stack.shrink(1);%0A%09%09%09%09%09return stack;%0A%09%09%09%09%7D);%0A%09%09%09%7D);%0A%09%09%7D);%0A%09%7D%0A%09%0A%09private static void colorItem(ColorHandlerEvent.Item event) %7B%0A%09%09USpawnEggItem.LAZY_EGGS.forEach(pair -%3E %7B%0A%09%09%09final USpawnEggItem item = pair.getValue();%0A%09%09%09%0A%09%09%09event.getItemColors().register((stack, color) -%3E %7B%0A%09%09%09%09return item.getColor(color);%0A%09%09%09%7D, item);%0A%09%09%7D);%0A%09%7D%0A%09%0A%09private static void loadComplete(FMLLoadCompleteEvent event) %7B%0A%09%09event.enqueueWork(() -%3E %7B%0A%09%09%09USpawnEggItem.LAZY_EGGS.forEach(pair -%3E %7B%0A%09%09%09%09final EntityType%3C?%3E type = pair.getKey().getValue();%0A%09%09%09%09final USpawnEggItem item = pair.getValue();%0A%09%09%09%09%0A%09%09%09%09USpawnEggItem.EGGS.put(type, item);%0A%09%09%09%7D);%0A%09%09%7D);%0A%09%7D%0A%09%0A%09public static void registerMod(IEventBus bus) %7B%0A%09%09bus.addListener(UCoreLazySpawnEggs::setup);%0A%09%09bus.addListener(UCoreLazySpawnEggs::colorItem);%0A%09%09bus.addListener(UCoreLazySpawnEggs::loadComplete);%0A%09%7D%0A%09%0A%7D%0A

Add core lazy spawn eggs handler