Only check for kraken if you're actually fishing.

This commit is contained in:
GJ 2013-05-21 09:14:34 -04:00
parent 12e70490d8
commit 87df536a1f
2 changed files with 5 additions and 5 deletions

View File

@ -180,11 +180,11 @@ public class PlayerListener implements Listener {
case FISHING:
if (!Permissions.krakenBypass(player)) {
event.setCancelled(fishingManager.exploitPrevention());
}
if (event.isCancelled()) {
return;
}
}
if (fishingManager.canMasterAngler()) {
fishingManager.masterAngler(event.getHook());

View File

@ -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;