Class AutoMineHelper

java.lang.Object
dev.boze.api.client.module.helper.AutoMineHelper

public class AutoMineHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    addActiveTask(net.minecraft.core.BlockPos pos)
    Starts mining a block in one of AutoMine's active slots.
    static boolean
    addActiveTask(net.minecraft.core.BlockPos pos, boolean rayCast)
    Starts mining a block in one of AutoMine's active slots, with a custom rayCast setting.
    static boolean
    addActiveTask(net.minecraft.core.BlockPos pos, boolean rayCast, double range)
    Starts mining a block in one of AutoMine's active slots, with custom rayCast and range settings.
    static boolean
    addActiveTask(net.minecraft.core.BlockPos pos, double range)
    Starts mining a block in one of AutoMine's active slots, with a custom range.
    static boolean
    addTask(net.minecraft.core.BlockPos pos)
    Adds a mining task to AutoMine using default settings.
    static boolean
    addTask(net.minecraft.core.BlockPos pos, boolean rayCast)
    Adds a mining task to AutoMine with custom rayCast setting.
    static boolean
    addTask(net.minecraft.core.BlockPos pos, boolean rayCast, double range)
    Adds a mining task to AutoMine with custom rayCast and range settings.
    static boolean
    addTask(net.minecraft.core.BlockPos pos, double range)
    Adds a mining task to AutoMine with custom range setting.
    static boolean
    addToQueue(net.minecraft.core.BlockPos pos)
    Adds a block to AutoMine's mining queue, to be mined after the current blocks.
    static boolean
    addToQueue(net.minecraft.core.BlockPos pos, boolean rayCast)
    Adds a block to AutoMine's mining queue with a custom rayCast setting.
    static boolean
    addToQueue(net.minecraft.core.BlockPos pos, boolean rayCast, double range)
    Adds a block to AutoMine's mining queue with custom rayCast and range settings.
    static boolean
    addToQueue(net.minecraft.core.BlockPos pos, double range)
    Adds a block to AutoMine's mining queue with a custom range.
    static boolean
    Checks whether addActiveTask(BlockPos) would currently accept another block, i.e.
    static int
     
    static int
     
    static void
    Removes any custom canBreak predicate, restoring AutoMine's default breakability behavior.
    static void
    setCanBreak(BiPredicate<net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState> predicate)
    Sets a custom predicate that decides whether AutoMine may break a block.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AutoMineHelper

      public AutoMineHelper()
  • Method Details

    • setCanBreak

      public static void setCanBreak(BiPredicate<net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState> predicate)
      Sets a custom predicate that decides whether AutoMine may break a block.
      The predicate is consulted in addition to AutoMine's normal breakability check: a block is mineable if it is normally breakable OR the predicate returns true for it. This lets an addon allow AutoMine to mine blocks it would otherwise skip (e.g. bedrock). Range and filter checks still apply. Only one predicate may be set at a time; setting a new one replaces the previous.
      Parameters:
      predicate - Tests a block position and its state; return true to additionally allow it
    • resetCanBreak

      public static void resetCanBreak()
      Removes any custom canBreak predicate, restoring AutoMine's default breakability behavior.
    • addTask

      public static boolean addTask(net.minecraft.core.BlockPos pos)
      Adds a mining task to AutoMine using default settings. Uses rayCast=false and player's block interaction range.
      Parameters:
      pos - The block position to mine
      Returns:
      true if the task was successfully added
    • addTask

      public static boolean addTask(net.minecraft.core.BlockPos pos, boolean rayCast)
      Adds a mining task to AutoMine with custom rayCast setting. Uses player's block interaction range.
      Parameters:
      pos - The block position to mine
      rayCast - Whether to raycast through walls
      Returns:
      true if the task was successfully added
    • addTask

      public static boolean addTask(net.minecraft.core.BlockPos pos, double range)
      Adds a mining task to AutoMine with custom range setting. Uses rayCast=false by default.
      Parameters:
      pos - The block position to mine
      range - The maximum mining range
      Returns:
      true if the task was successfully added
    • addTask

      public static boolean addTask(net.minecraft.core.BlockPos pos, boolean rayCast, double range)
      Adds a mining task to AutoMine with custom rayCast and range settings.
      Parameters:
      pos - The block position to mine
      rayCast - Whether to raycast through walls
      range - The maximum mining range
      Returns:
      true if the task was successfully added
    • addActiveTask

      public static boolean addActiveTask(net.minecraft.core.BlockPos pos)
      Starts mining a block in one of AutoMine's active slots.
      If nothing is being mined this becomes the first (and only) block; with the DoubleMine setting enabled and one block already mining, it becomes a second simultaneous block. Unlike addTask(BlockPos), this works whether or not AutoMine is already mining. Use canAddTask() to check capacity first, or addToQueue(BlockPos) for overflow. Uses rayCast=false and the player's block interaction range.
      Parameters:
      pos - The block position to mine
      Returns:
      true if the block started mining, false if it couldn't be (unbreakable, already queued/mining, or no slot is free right now)
    • addActiveTask

      public static boolean addActiveTask(net.minecraft.core.BlockPos pos, boolean rayCast)
      Starts mining a block in one of AutoMine's active slots, with a custom rayCast setting. Uses the player's block interaction range. See addActiveTask(BlockPos).
      Parameters:
      pos - The block position to mine
      rayCast - Whether to raycast through walls
      Returns:
      true if the block started mining
    • addActiveTask

      public static boolean addActiveTask(net.minecraft.core.BlockPos pos, double range)
      Starts mining a block in one of AutoMine's active slots, with a custom range. Uses rayCast=false. See addActiveTask(BlockPos).
      Parameters:
      pos - The block position to mine
      range - The maximum mining range
      Returns:
      true if the block started mining
    • addActiveTask

      public static boolean addActiveTask(net.minecraft.core.BlockPos pos, boolean rayCast, double range)
      Starts mining a block in one of AutoMine's active slots, with custom rayCast and range settings. See addActiveTask(BlockPos).
      Parameters:
      pos - The block position to mine
      rayCast - Whether to raycast through walls
      range - The maximum mining range
      Returns:
      true if the block started mining
    • addToQueue

      public static boolean addToQueue(net.minecraft.core.BlockPos pos)
      Adds a block to AutoMine's mining queue, to be mined after the current blocks.
      Uses rayCast=false and the player's block interaction range.
      Parameters:
      pos - The block position to queue
      Returns:
      true if the block was queued, false if it couldn't be (unbreakable, already queued/mining, or the queue is full)
    • addToQueue

      public static boolean addToQueue(net.minecraft.core.BlockPos pos, boolean rayCast)
      Adds a block to AutoMine's mining queue with a custom rayCast setting. Uses the player's block interaction range.
      Parameters:
      pos - The block position to queue
      rayCast - Whether to raycast through walls
      Returns:
      true if the block was queued
    • addToQueue

      public static boolean addToQueue(net.minecraft.core.BlockPos pos, double range)
      Adds a block to AutoMine's mining queue with a custom range. Uses rayCast=false.
      Parameters:
      pos - The block position to queue
      range - The maximum mining range
      Returns:
      true if the block was queued
    • addToQueue

      public static boolean addToQueue(net.minecraft.core.BlockPos pos, boolean rayCast, double range)
      Adds a block to AutoMine's mining queue with custom rayCast and range settings.
      Parameters:
      pos - The block position to queue
      rayCast - Whether to raycast through walls
      range - The maximum mining range
      Returns:
      true if the block was queued
    • canAddTask

      public static boolean canAddTask()
      Checks whether addActiveTask(BlockPos) would currently accept another block, i.e. AutoMine is enabled and a mining slot is free (accounting for the DoubleMine setting and mining progress).
      Returns:
      true if a block can be started right now
    • getActiveTaskCount

      public static int getActiveTaskCount()
      Returns:
      the number of blocks AutoMine is actively mining right now (0, or up to 2 with DoubleMine)
    • getQueueSize

      public static int getQueueSize()
      Returns:
      the number of blocks currently waiting in AutoMine's mining queue