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.math.BlockPos;
import net.minecraft.util.math.Direction;

@Environment(EnvType.CLIENT)
public class ClickBlockEvent extends Event {
   private BlockPos pos;
   private Direction direction;
   private static final ClickBlockEvent INSTANCE = new ClickBlockEvent();

   private ClickBlockEvent() {
   }

   public Direction getDirection() {
      return this.direction;
   }

   public BlockPos getPos() {
      return this.pos;
   }

   public static ClickBlockEvent get(BlockPos pos, Direction direction) {
      INSTANCE.pos = pos;
      INSTANCE.direction = direction;
      INSTANCE.setCancelled(false);
      return INSTANCE;
   }
}
