Increased auto-fishing detection.

This commit is contained in:
GJ 2013-05-28 12:42:39 -04:00
parent 1ae9b0f4d2
commit 10e369f9c5

View File

@ -57,6 +57,7 @@ public class FishingManager extends SkillManager {
private int fishingTries = 0;
private long fishingTimestamp = 0L;
private Location fishingTarget;
public FishingManager(McMMOPlayer mcMMOPlayer) {
super(mcMMOPlayer, SkillType.FISHING);
@ -143,7 +144,13 @@ public class FishingManager extends SkillManager {
}
public boolean exploitPrevention() {
if (!AdvancedConfig.getInstance().getKrakenEnabled() || !getPlayer().getTargetBlock(null, 100).isLiquid()) {
if (!AdvancedConfig.getInstance().getKrakenEnabled()) {
return false;
}
Block targetBlock = getPlayer().getTargetBlock(null, 100);
if (!targetBlock.isLiquid()) {
return false;
}
@ -152,6 +159,13 @@ public class FishingManager extends SkillManager {
fishingTries = hasFished ? fishingTries + 1 : Math.max(fishingTries - 1, 0);
fishingTimestamp = currentTime;
Location targetLocation = targetBlock.getLocation();
boolean sameTarget = (fishingTarget != null && fishingTarget.equals(targetLocation));
fishingTries = sameTarget ? fishingTries + 1 : Math.max(fishingTries - 1, 0);
fishingTarget = targetLocation;
return unleashTheKraken(false);
}