rearrange for consistency

This commit is contained in:
Leijurv 2021-02-06 13:36:24 -08:00
parent b32c9f1724
commit 711037b619
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 5 additions and 2 deletions

View File

@ -112,9 +112,12 @@ public final class InventoryBehavior extends Behavior {
if (stack.isEmpty()) {
continue;
}
if (Baritone.settings().itemSaver.value && stack.getItemDamage() >= stack.getMaxDamage() && stack.getMaxDamage() > 1) {
continue;
}
if (cla$$.isInstance(stack.getItem())) {
double speed = ToolSet.calculateSpeedVsBlock(stack, against.getDefaultState()); // takes into account enchants
if (speed > bestSpeed && !(stack.getItemDamage() >= stack.getMaxDamage() && Baritone.settings().itemSaver.value && stack.getMaxDamage() > 1)) {
if (speed > bestSpeed) {
bestSpeed = speed;
bestInd = i;
}

View File

@ -124,7 +124,7 @@ public class ToolSet {
IBlockState blockState = b.getDefaultState();
for (int i = 0; i < 9; i++) {
ItemStack itemStack = player.inventory.getStackInSlot(i);
if (itemStack.getItemDamage() >= itemStack.getMaxDamage() && Baritone.settings().itemSaver.value && itemStack.getMaxDamage() > 1) {
if (Baritone.settings().itemSaver.value && itemStack.getItemDamage() >= itemStack.getMaxDamage() && itemStack.getMaxDamage() > 1) {
continue;
}
double speed = calculateSpeedVsBlock(itemStack, blockState);