mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Only check for kraken if you're actually fishing.
This commit is contained in:
parent
12e70490d8
commit
87df536a1f
@ -180,11 +180,11 @@ public class PlayerListener implements Listener {
|
|||||||
case FISHING:
|
case FISHING:
|
||||||
if (!Permissions.krakenBypass(player)) {
|
if (!Permissions.krakenBypass(player)) {
|
||||||
event.setCancelled(fishingManager.exploitPrevention());
|
event.setCancelled(fishingManager.exploitPrevention());
|
||||||
}
|
|
||||||
|
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (fishingManager.canMasterAngler()) {
|
if (fishingManager.canMasterAngler()) {
|
||||||
fishingManager.masterAngler(event.getHook());
|
fishingManager.masterAngler(event.getHook());
|
||||||
|
@ -143,12 +143,12 @@ public class FishingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean exploitPrevention() {
|
public boolean exploitPrevention() {
|
||||||
if (!AdvancedConfig.getInstance().getKrakenEnabled()) {
|
if (!AdvancedConfig.getInstance().getKrakenEnabled() || !getPlayer().getTargetBlock(null, 100).isLiquid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
long currentTime = System.currentTimeMillis();
|
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);
|
fishingTries = hasFished ? fishingTries + 1 : Math.max(fishingTries - 1, 0);
|
||||||
fishingTimestamp = currentTime;
|
fishingTimestamp = currentTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user