mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-10-31 23:59:36 +01:00
Use hook location in Master Angler
This commit is contained in:
parent
9f33c6cef1
commit
c2e100b1e3
@ -1,5 +1,6 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
@ -83,7 +84,9 @@ public class FishingCommand extends SkillCommand {
|
||||
// MASTER ANGLER
|
||||
if (canMasterAngler) {
|
||||
double rawBiteChance = 1.0 / (isStorming ? 300 : 500);
|
||||
Biome biome = player.getLocation().getBlock().getBiome();
|
||||
Location location = (mcMMOPlayer.getHookLocation() != null) ? mcMMOPlayer.getHookLocation() : player.getLocation();
|
||||
|
||||
Biome biome = location.getBlock().getBiome();
|
||||
|
||||
if (biome == Biome.RIVER || biome == Biome.OCEAN) {
|
||||
rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBiomeModifier();
|
||||
|
@ -86,6 +86,8 @@ public class McMMOPlayer {
|
||||
private int lastSalvageClick;
|
||||
private boolean godMode;
|
||||
|
||||
private Location hookLocation;
|
||||
|
||||
private final Map<AbilityType, Boolean> abilityMode = new HashMap<AbilityType, Boolean>();
|
||||
private final Map<AbilityType, Boolean> abilityInformed = new HashMap<AbilityType, Boolean>();
|
||||
|
||||
@ -499,6 +501,18 @@ public class McMMOPlayer {
|
||||
godMode = !godMode;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fishing: Master Angler
|
||||
*/
|
||||
|
||||
public Location getHookLocation() {
|
||||
return hookLocation;
|
||||
}
|
||||
|
||||
public void setHookLocation(Location hookLocation) {
|
||||
this.hookLocation = hookLocation;
|
||||
}
|
||||
|
||||
/*
|
||||
* Skill notifications
|
||||
*/
|
||||
|
@ -277,7 +277,8 @@ public class FishingManager extends SkillManager {
|
||||
|
||||
public void masterAngler(Fish hook) {
|
||||
Player player = getPlayer();
|
||||
Biome biome = player.getLocation().getBlock().getBiome();
|
||||
mcMMOPlayer.setHookLocation(hook.getLocation());
|
||||
Biome biome = hook.getLocation().getBlock().getBiome();
|
||||
double biteChance = hook.getBiteChance();
|
||||
|
||||
if (biome == Biome.RIVER || biome == Biome.OCEAN) {
|
||||
|
Loading…
Reference in New Issue
Block a user