Class AutoMineHelper
java.lang.Object
dev.boze.api.client.module.helper.AutoMineHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddActiveTask(net.minecraft.core.BlockPos pos) Starts mining a block in one of AutoMine's active slots.static booleanaddActiveTask(net.minecraft.core.BlockPos pos, boolean rayCast) Starts mining a block in one of AutoMine's active slots, with a custom rayCast setting.static booleanaddActiveTask(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 booleanaddActiveTask(net.minecraft.core.BlockPos pos, double range) Starts mining a block in one of AutoMine's active slots, with a custom range.static booleanaddTask(net.minecraft.core.BlockPos pos) Adds a mining task to AutoMine using default settings.static booleanaddTask(net.minecraft.core.BlockPos pos, boolean rayCast) Adds a mining task to AutoMine with custom rayCast setting.static booleanaddTask(net.minecraft.core.BlockPos pos, boolean rayCast, double range) Adds a mining task to AutoMine with custom rayCast and range settings.static booleanaddTask(net.minecraft.core.BlockPos pos, double range) Adds a mining task to AutoMine with custom range setting.static booleanaddToQueue(net.minecraft.core.BlockPos pos) Adds a block to AutoMine's mining queue, to be mined after the current blocks.static booleanaddToQueue(net.minecraft.core.BlockPos pos, boolean rayCast) Adds a block to AutoMine's mining queue with a custom rayCast setting.static booleanaddToQueue(net.minecraft.core.BlockPos pos, boolean rayCast, double range) Adds a block to AutoMine's mining queue with custom rayCast and range settings.static booleanaddToQueue(net.minecraft.core.BlockPos pos, double range) Adds a block to AutoMine's mining queue with a custom range.static booleanChecks whetheraddActiveTask(BlockPos)would currently accept another block, i.e.static intstatic intstatic voidRemoves any custom canBreak predicate, restoring AutoMine's default breakability behavior.static voidsetCanBreak(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.
-
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 minerayCast- 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 minerange- 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 minerayCast- Whether to raycast through wallsrange- 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. UnlikeaddTask(BlockPos), this works whether or not AutoMine is already mining. UsecanAddTask()to check capacity first, oraddToQueue(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. SeeaddActiveTask(BlockPos).- Parameters:
pos- The block position to minerayCast- 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. SeeaddActiveTask(BlockPos).- Parameters:
pos- The block position to minerange- 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. SeeaddActiveTask(BlockPos).- Parameters:
pos- The block position to minerayCast- Whether to raycast through wallsrange- 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 queuerayCast- 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 queuerange- 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 queuerayCast- Whether to raycast through wallsrange- The maximum mining range- Returns:
- true if the block was queued
-
canAddTask
public static boolean canAddTask()Checks whetheraddActiveTask(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
-