package dev.crucifixbeta.api.utils.path;

import dev.crucifixbeta.api.utils.Wrapper;
import dev.crucifixbeta.mod.modules.impl.client.BaritoneModule;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block;
import net.minecraft.util.math.BlockPos;

@Environment(EnvType.CLIENT)
public class BaritoneUtil implements Wrapper {
   public static boolean loaded;

   public static void gotoPos(BlockPos pos) {
      if (loaded) {
         BaritoneModule.gotoPos(pos);
      }
   }

   public static void forward() {
      if (loaded) {
         BaritoneModule.forward();
      }
   }

   public static void mine(Block block) {
      if (loaded) {
         BaritoneModule.mine(block);
      }
   }

   public static boolean isPathing() {
      return loaded ? BaritoneModule.isPathing() : false;
   }

   public static void cancelEverything() {
      if (loaded) {
         BaritoneModule.cancelEverything();
      }
   }

   public static boolean isActive() {
      return loaded ? BaritoneModule.isActive() : false;
   }

   static {

      for (Package var4 : Package.getPackages()) {
         if (var4.getName().contains("baritone.api")) {
            loaded = true;
            break;
         }
      }
   }
}
