diff options
author | nea <romangraef@gmail.com> | 2022-12-21 23:53:51 +0100 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-12-21 23:53:51 +0100 |
commit | 5dea8e6f7af0f9d97a010d412b3cacbdd3777023 (patch) | |
tree | 3b2c1c835fddfe0a1b5ad3d74381b9cfbe2c78c1 | |
parent | 6c631fbb4304acfd6d450ce462063e8a58a1b088 (diff) | |
download | neuhax-5dea8e6f7af0f9d97a010d412b3cacbdd3777023.tar.gz neuhax-5dea8e6f7af0f9d97a010d412b3cacbdd3777023.tar.bz2 neuhax-5dea8e6f7af0f9d97a010d412b3cacbdd3777023.zip |
AutoFishing: Block in GUIs and prevent double hooking
-rw-r--r-- | src/main/kotlin/moe/nea/sky/features/world/AutoFishing.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/sky/features/world/AutoFishing.kt b/src/main/kotlin/moe/nea/sky/features/world/AutoFishing.kt index 8e0a0be..487f64d 100644 --- a/src/main/kotlin/moe/nea/sky/features/world/AutoFishing.kt +++ b/src/main/kotlin/moe/nea/sky/features/world/AutoFishing.kt @@ -53,6 +53,7 @@ object AutoFishing { @SubscribeEvent fun onTick(ev: TickEvent.ClientTickEvent) { + if (mc.currentScreen != null) return if (ev.phase != TickEvent.Phase.END) return val p = mc.thePlayer ?: return if (shouldReengage) { @@ -69,7 +70,7 @@ object AutoFishing { return } if (FishingHelper.getInstance().warningState != FishingHelper.PlayerWarningState.FISH_HOOKED) return - if (lastFishingHook != p.fishEntity && shouldAutoFish()) { + if (lastFishingHook != p.fishEntity && p.fishEntity != null && shouldAutoFish()) { mc.playerController.sendUseItem(p, p.worldObj, p.heldItem) lastFishingHook = p.fishEntity if (config.neuHaxReengageFishingRod) { |