mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Check the target fishing location
This commit is contained in:
parent
9aae4825cc
commit
6592562c56
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user