Check the target fishing location

This commit is contained in:
nossr50 2019-01-26 14:41:17 -08:00
parent 9aae4825cc
commit 6592562c56
2 changed files with 8 additions and 1 deletions

View File

@ -324,16 +324,19 @@ public class PlayerListener implements Listener {
case FISHING:
if (fishingManager.canMasterAngler()) {
fishingManager.masterAngler(event.getHook());
fishingManager.setFishingTarget();
}
return;
case CAUGHT_FISH:
fishingManager.handleFishing((Item) caught);
fishingManager.setFishingTarget();
return;
case CAUGHT_ENTITY:
if (fishingManager.canShake(caught)) {
fishingManager.shakeCheck((LivingEntity) caught);
fishingManager.setFishingTarget();
}
return;

View File

@ -66,7 +66,7 @@ public class FishingManager extends SkillManager {
}
long currentTime = System.currentTimeMillis();
boolean hasFished = (currentTime < fishingTimestamp + FISHING_COOLDOWN_SECONDS);
boolean hasFished = (currentTime < fishingTimestamp + (FISHING_COOLDOWN_SECONDS * 10));
if(hasFished == true)
fishingTimestamp = currentTime;
@ -77,6 +77,10 @@ public class FishingManager extends SkillManager {
return hasFished || sameTarget;
}
public void setFishingTarget() {
getPlayer().getTargetBlock(BlockUtils.getTransparentBlocks(), 100);
}
public boolean canIceFish(Block block) {
if (getSkillLevel() < RankUtils.getUnlockLevel(SubSkillType.FISHING_ICE_FISHING)) {
return false;