mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Magic Hunter stats now check for treasure hunter
This commit is contained in:
parent
b2b623505d
commit
7e34e87bc0
@ -74,7 +74,7 @@ public class FishingCommand extends SkillCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(totalEnchantChance > 0)
|
if(totalEnchantChance >= 1)
|
||||||
magicChance = percent.format(totalEnchantChance / 100.0);
|
magicChance = percent.format(totalEnchantChance / 100.0);
|
||||||
else
|
else
|
||||||
magicChance = percent.format(0);
|
magicChance = percent.format(0);
|
||||||
@ -116,7 +116,7 @@ public class FishingCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canTreasureHunt = canUseSubskill(player, SubSkillType.FISHING_TREASURE_HUNTER);
|
canTreasureHunt = canUseSubskill(player, SubSkillType.FISHING_TREASURE_HUNTER);
|
||||||
canMagicHunt = canUseSubskill(player, SubSkillType.FISHING_MAGIC_HUNTER);
|
canMagicHunt = canUseSubskill(player, SubSkillType.FISHING_MAGIC_HUNTER) && canUseSubskill(player, SubSkillType.FISHING_TREASURE_HUNTER);
|
||||||
canShake = canUseSubskill(player, SubSkillType.FISHING_SHAKE);
|
canShake = canUseSubskill(player, SubSkillType.FISHING_SHAKE);
|
||||||
canFishermansDiet = canUseSubskill(player, SubSkillType.FISHING_FISHERMANS_DIET);
|
canFishermansDiet = canUseSubskill(player, SubSkillType.FISHING_FISHERMANS_DIET);
|
||||||
canMasterAngler = canUseSubskill(player, SubSkillType.FISHING_MASTER_ANGLER);
|
canMasterAngler = canUseSubskill(player, SubSkillType.FISHING_MASTER_ANGLER);
|
||||||
|
@ -38,7 +38,6 @@ import java.util.*;
|
|||||||
public class FishingManager extends SkillManager {
|
public class FishingManager extends SkillManager {
|
||||||
private final long FISHING_COOLDOWN_SECONDS = 1000L;
|
private final long FISHING_COOLDOWN_SECONDS = 1000L;
|
||||||
|
|
||||||
private int fishingTries = 0;
|
|
||||||
private long fishingTimestamp = 0L;
|
private long fishingTimestamp = 0L;
|
||||||
private Location fishingTarget;
|
private Location fishingTarget;
|
||||||
private Item fishingCatch;
|
private Item fishingCatch;
|
||||||
@ -73,6 +72,9 @@ public class FishingManager extends SkillManager {
|
|||||||
Location targetLocation = targetBlock.getLocation();
|
Location targetLocation = targetBlock.getLocation();
|
||||||
boolean sameTarget = (fishingTarget != null && fishingTarget.equals(targetLocation));
|
boolean sameTarget = (fishingTarget != null && fishingTarget.equals(targetLocation));
|
||||||
|
|
||||||
|
if(!sameTarget)
|
||||||
|
fishingTarget = targetLocation;
|
||||||
|
|
||||||
return hasFished || sameTarget;
|
return hasFished || sameTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,8 +260,6 @@ public class FishingManager extends SkillManager {
|
|||||||
* @param target The {@link LivingEntity} affected by the ability
|
* @param target The {@link LivingEntity} affected by the ability
|
||||||
*/
|
*/
|
||||||
public void shakeCheck(LivingEntity target) {
|
public void shakeCheck(LivingEntity target) {
|
||||||
fishingTries--; // Because autoclicking to shake is OK.
|
|
||||||
|
|
||||||
if (RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.FISHING_SHAKE, true)) {
|
if (RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.FISHING_SHAKE, true)) {
|
||||||
List<ShakeTreasure> possibleDrops = Fishing.findPossibleDrops(target);
|
List<ShakeTreasure> possibleDrops = Fishing.findPossibleDrops(target);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user