From 87df536a1f09da85c98252e3d22938ac2e15f6ca Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 21 May 2013 09:14:34 -0400 Subject: [PATCH] Only check for kraken if you're actually fishing. --- .../java/com/gmail/nossr50/listeners/PlayerListener.java | 6 +++--- .../com/gmail/nossr50/skills/fishing/FishingManager.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 39f140b16..0bb510f1c 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -180,10 +180,10 @@ public class PlayerListener implements Listener { case FISHING: if (!Permissions.krakenBypass(player)) { event.setCancelled(fishingManager.exploitPrevention()); - } - if (event.isCancelled()) { - return; + if (event.isCancelled()) { + return; + } } if (fishingManager.canMasterAngler()) { diff --git a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java index 5279adb4e..197fb9363 100644 --- a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java @@ -143,12 +143,12 @@ public class FishingManager extends SkillManager { } public boolean exploitPrevention() { - if (!AdvancedConfig.getInstance().getKrakenEnabled()) { + if (!AdvancedConfig.getInstance().getKrakenEnabled() || !getPlayer().getTargetBlock(null, 100).isLiquid()) { return false; } long currentTime = System.currentTimeMillis(); - boolean hasFished = currentTime < fishingTimestamp + FISHING_COOLDOWN_SECONDS; + boolean hasFished = (currentTime < fishingTimestamp + FISHING_COOLDOWN_SECONDS); fishingTries = hasFished ? fishingTries + 1 : Math.max(fishingTries - 1, 0); fishingTimestamp = currentTime;