diff --git a/src/main/java/com/gamesense/client/module/modules/combat/AutoTrap.java b/src/main/java/com/gamesense/client/module/modules/combat/AutoTrap.java index 01de87032..98d54c026 100644 --- a/src/main/java/com/gamesense/client/module/modules/combat/AutoTrap.java +++ b/src/main/java/com/gamesense/client/module/modules/combat/AutoTrap.java @@ -137,6 +137,7 @@ public void onUpdate(){ firstRun = false; if (findObsidianSlot() == -1){ noObby = true; + disable(); } } else { @@ -251,7 +252,7 @@ private boolean placeBlock(BlockPos pos, int range){ int obsidianSlot = findObsidianSlot(); - if (mc.player.inventory.currentItem != obsidianSlot){ + if (mc.player.inventory.currentItem != obsidianSlot && obsidianSlot != -1){ mc.player.inventory.currentItem = obsidianSlot; } diff --git a/src/main/java/com/gamesense/client/module/modules/combat/AutoWeb.java b/src/main/java/com/gamesense/client/module/modules/combat/AutoWeb.java index e2503621d..ff79fddae 100644 --- a/src/main/java/com/gamesense/client/module/modules/combat/AutoWeb.java +++ b/src/main/java/com/gamesense/client/module/modules/combat/AutoWeb.java @@ -231,7 +231,7 @@ private boolean placeBlock(BlockPos pos, int range){ int webbSlot = findWebSlot(); - if (mc.player.inventory.currentItem != webbSlot){ + if (mc.player.inventory.currentItem != webbSlot && webbSlot != -1){ mc.player.inventory.currentItem = webbSlot; } diff --git a/src/main/java/com/gamesense/client/module/modules/combat/HoleFill.java b/src/main/java/com/gamesense/client/module/modules/combat/HoleFill.java index 4817ef895..ac6879624 100644 --- a/src/main/java/com/gamesense/client/module/modules/combat/HoleFill.java +++ b/src/main/java/com/gamesense/client/module/modules/combat/HoleFill.java @@ -97,7 +97,14 @@ public void onUpdate(){ if (autoSwitch.getValue()) { int oldHand = mc.player.inventory.currentItem; - mc.player.inventory.currentItem = findRightBlock(oldHand); + int newHand = findRightBlock(oldHand); + + if (newHand != -1) { + mc.player.inventory.currentItem = findRightBlock(oldHand); + } + else { + return; + } } BlockPos placePos = holePos.stream().sorted(Comparator.comparing(blockPos -> blockPos.getDistance((int) mc.player.posX, (int) mc.player.posY, (int) mc.player.posZ))).findFirst().orElse(null); diff --git a/src/main/java/com/gamesense/client/module/modules/combat/SelfTrap.java b/src/main/java/com/gamesense/client/module/modules/combat/SelfTrap.java index 8794890f9..a0afd92b8 100644 --- a/src/main/java/com/gamesense/client/module/modules/combat/SelfTrap.java +++ b/src/main/java/com/gamesense/client/module/modules/combat/SelfTrap.java @@ -147,6 +147,7 @@ public void onUpdate(){ firstRun = false; if (findObsidianSlot() == -1){ noObby = true; + disable(); } } else { @@ -297,7 +298,7 @@ private boolean placeBlock(BlockPos pos){ int obsidianSlot = findObsidianSlot(); - if (mc.player.inventory.currentItem != obsidianSlot){ + if (mc.player.inventory.currentItem != obsidianSlot && obsidianSlot != -1){ mc.player.inventory.currentItem = obsidianSlot; } diff --git a/src/main/java/com/gamesense/client/module/modules/combat/SelfWeb.java b/src/main/java/com/gamesense/client/module/modules/combat/SelfWeb.java index 654439b02..ae7e025bd 100644 --- a/src/main/java/com/gamesense/client/module/modules/combat/SelfWeb.java +++ b/src/main/java/com/gamesense/client/module/modules/combat/SelfWeb.java @@ -134,6 +134,7 @@ public void onUpdate(){ firstRun = false; if (findWebSlot() == -1){ noWeb = true; + disable(); } } else { @@ -236,7 +237,7 @@ private boolean placeBlock(BlockPos pos){ int webSlot = findWebSlot(); - if (mc.player.inventory.currentItem != webSlot){ + if (mc.player.inventory.currentItem != webSlot && webSlot != -1){ mc.player.inventory.currentItem = webSlot; } diff --git a/src/main/java/com/gamesense/client/module/modules/combat/Surround.java b/src/main/java/com/gamesense/client/module/modules/combat/Surround.java index 5ab24acfc..8d1bb0d7f 100644 --- a/src/main/java/com/gamesense/client/module/modules/combat/Surround.java +++ b/src/main/java/com/gamesense/client/module/modules/combat/Surround.java @@ -145,6 +145,7 @@ public void onUpdate(){ firstRun = false; if (findObsidianSlot() == -1){ noObby = true; + disable(); } } else { @@ -293,7 +294,7 @@ private boolean placeBlock(BlockPos pos){ int obsidianSlot = findObsidianSlot(); - if (mc.player.inventory.currentItem != obsidianSlot){ + if (mc.player.inventory.currentItem != obsidianSlot && obsidianSlot != -1){ mc.player.inventory.currentItem = obsidianSlot; }