From 72d8863862e3982382c34af2bae9698965bac2c5 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sat, 8 Dec 2018 17:49:23 -0800 Subject: [PATCH] fix openness check to work for mulitple bots --- src/main/java/baritone/behavior/InventoryBehavior.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/baritone/behavior/InventoryBehavior.java b/src/main/java/baritone/behavior/InventoryBehavior.java index 9b191204..ad5eae10 100644 --- a/src/main/java/baritone/behavior/InventoryBehavior.java +++ b/src/main/java/baritone/behavior/InventoryBehavior.java @@ -21,8 +21,6 @@ import baritone.Baritone; import baritone.api.event.events.TickEvent; import baritone.utils.ToolSet; import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.init.Blocks; import net.minecraft.inventory.ClickType; import net.minecraft.item.ItemPickaxe; @@ -43,8 +41,8 @@ public class InventoryBehavior extends Behavior { if (event.getType() == TickEvent.Type.OUT) { return; } - if (Minecraft.getMinecraft().currentScreen != null && !(Minecraft.getMinecraft().currentScreen instanceof GuiInventory)) { - // we have chat or a chest or something open + if (ctx.player().openContainer == ctx.player().inventoryContainer) { + // 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