mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Increased auto-fishing detection.
This commit is contained in:
parent
1ae9b0f4d2
commit
10e369f9c5
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user