package net.fabricmc.fabric.api.event.lifecycle.v1;

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.class_1297;
import net.minecraft.class_1304;
import net.minecraft.class_1309;
import net.minecraft.class_1799;
import net.minecraft.class_3218;

public final class ServerEntityEvents {
   public static final Event<Load> ENTITY_LOAD = EventFactory.createArrayBacked(Load.class, (callbacks) -> (entity, world) -> {
         for(Load callback : callbacks) {
            callback.onLoad(entity, world);
         }

      });
   public static final Event<Unload> ENTITY_UNLOAD = EventFactory.createArrayBacked(Unload.class, (callbacks) -> (entity, world) -> {
         for(Unload callback : callbacks) {
            callback.onUnload(entity, world);
         }

      });
   public static final Event<EquipmentChange> EQUIPMENT_CHANGE = EventFactory.createArrayBacked(EquipmentChange.class, (callbacks) -> (livingEntity, equipmentSlot, previous, next) -> {
         for(EquipmentChange callback : callbacks) {
            callback.onChange(livingEntity, equipmentSlot, previous, next);
         }

      });

   private ServerEntityEvents() {
   }

   @FunctionalInterface
   public interface EquipmentChange {
      void onChange(class_1309 var1, class_1304 var2, class_1799 var3, class_1799 var4);
   }

   @FunctionalInterface
   public interface Load {
      void onLoad(class_1297 var1, class_3218 var2);
   }

   @FunctionalInterface
   public interface Unload {
      void onUnload(class_1297 var1, class_3218 var2);
   }
}
