don't fall back onto the first slot if it has a low durability item in the slot.
Signed-off-by: Sam Corbett <sam@corbettchocolates.com>
This commit is contained in:
parent
4aa52d2f2e
commit
9922382581
@ -114,7 +114,7 @@ public final class InventoryBehavior extends Behavior {
|
|||||||
}
|
}
|
||||||
if (cla$$.isInstance(stack.getItem())) {
|
if (cla$$.isInstance(stack.getItem())) {
|
||||||
double speed = ToolSet.calculateSpeedVsBlock(stack, against.getDefaultState()); // takes into account enchants
|
double speed = ToolSet.calculateSpeedVsBlock(stack, against.getDefaultState()); // takes into account enchants
|
||||||
if (speed > bestSpeed) {
|
if (speed > bestSpeed && !(stack.getItemDamage() >= stack.getMaxDamage() && Baritone.settings().itemSaver.value && stack.getMaxDamage() > 1)) {
|
||||||
bestSpeed = speed;
|
bestSpeed = speed;
|
||||||
bestInd = i;
|
bestInd = i;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
package baritone.utils;
|
package baritone.utils;
|
||||||
|
|
||||||
import baritone.Baritone;
|
import baritone.Baritone;
|
||||||
import baritone.api.utils.Helper;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
@ -125,7 +124,7 @@ public class ToolSet {
|
|||||||
IBlockState blockState = b.getDefaultState();
|
IBlockState blockState = b.getDefaultState();
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
ItemStack itemStack = player.inventory.getStackInSlot(i);
|
ItemStack itemStack = player.inventory.getStackInSlot(i);
|
||||||
if (itemStack.getItemDamage() >= itemStack.getMaxDamage() - 1 && Baritone.settings().itemSaver.value) {
|
if (itemStack.getItemDamage() >= itemStack.getMaxDamage() && Baritone.settings().itemSaver.value && itemStack.getMaxDamage() > 1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
double speed = calculateSpeedVsBlock(itemStack, blockState);
|
double speed = calculateSpeedVsBlock(itemStack, blockState);
|
||||||
|
Loading…
Reference in New Issue
Block a user