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: case FISHING:
if (fishingManager.canMasterAngler()) { if (fishingManager.canMasterAngler()) {
fishingManager.masterAngler(event.getHook()); fishingManager.masterAngler(event.getHook());
fishingManager.setFishingTarget();
} }
return; return;
case CAUGHT_FISH: case CAUGHT_FISH:
fishingManager.handleFishing((Item) caught); fishingManager.handleFishing((Item) caught);
fishingManager.setFishingTarget();
return; return;
case CAUGHT_ENTITY: case CAUGHT_ENTITY:
if (fishingManager.canShake(caught)) { if (fishingManager.canShake(caught)) {
fishingManager.shakeCheck((LivingEntity) caught); fishingManager.shakeCheck((LivingEntity) caught);
fishingManager.setFishingTarget();
} }
return; return;

View File

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