Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TacoTechnica committed Oct 16, 2021
1 parent c3ad016 commit 4088739
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main/java/baritone/behavior/InventoryBehavior.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import baritone.Baritone;
import baritone.api.event.events.TickEvent;
import baritone.api.utils.input.Input;
import baritone.utils.ToolSet;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.core.Direction;
Expand Down Expand Up @@ -60,12 +61,15 @@ public void onTick(TickEvent event) {
// we have a crafting table or a chest or something open
return;
}
if (firstValidThrowaway() >= 9) { // aka there are none on the hotbar, but there are some in main inventory
swapWithHotBar(firstValidThrowaway(), 8);
}
int pick = bestToolAgainst(Blocks.STONE, PickaxeItem.class);
if (pick >= 9) {
swapWithHotBar(pick, 0);
// Only perform the inventory swap if we're pathing/mining. Otherwise, this will run every frame.
if (baritone.getPathingBehavior().isPathing() || baritone.getInputOverrideHandler().isInputForcedDown(Input.CLICK_LEFT)) {
if (firstValidThrowaway() >= 9) { // aka there are none on the hotbar, but there are some in main inventory
swapWithHotBar(firstValidThrowaway(), 8);
}
int pick = bestToolAgainst(Blocks.STONE, PickaxeItem.class);
if (pick >= 9) {
swapWithHotBar(pick, 0);
}
}
}

Expand Down

0 comments on commit 4088739

Please sign in to comment.