package dev.crucifixbeta.api.events.impl;

import dev.crucifixbeta.api.events.Event;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.util.Hand;

@Environment(EnvType.CLIENT)
public class InteractBlockEvent extends Event {
   private static final InteractBlockEvent INSTANCE = new InteractBlockEvent();
   public Hand hand;

   private InteractBlockEvent() {
   }

   public static InteractBlockEvent getPre(Hand hand) {
      INSTANCE.hand = hand;
      INSTANCE.stage = Event.Stage.Pre;
      INSTANCE.setCancelled(false);
      return INSTANCE;
   }

   public static InteractBlockEvent getPost(Hand hand) {
      INSTANCE.hand = hand;
      INSTANCE.stage = Event.Stage.Post;
      return INSTANCE;
   }
}
