Fix sand speed passive

- Fixed the FOV change that happens when jumping as a sandbender on sand
This commit is contained in:
Benford 2016-04-18 19:03:20 -04:00
parent 1581fb7763
commit 5a0ffc988d
2 changed files with 6 additions and 3 deletions

View file

@ -788,6 +788,7 @@ public class ConfigManager {
config.addDefault("Abilities.Earth.Passive.Duration", 2500);
config.addDefault("Abilities.Earth.Passive.SandRunSpeed", 2);
config.addDefault("Abilities.Earth.Passive.SandRunHeight", 3);
config.addDefault("Abilities.Earth.Catapult.Enabled", true);
config.addDefault("Abilities.Earth.Catapult.Length", 6);

View file

@ -23,6 +23,8 @@ import java.util.concurrent.ConcurrentHashMap;
public class PassiveHandler {
private static final ConcurrentHashMap<Player, Float> FOOD = new ConcurrentHashMap<>();
private static int sandRunHeight = ConfigManager.defaultConfig.get().getInt("Abilities.Earth.Passive.SandRunHeight");
public static float getExhaustion(Player player, float level, double factor) {
if (!FOOD.keySet().contains(player)) {
@ -106,9 +108,9 @@ public class PassiveHandler {
int max = 0;
if (sandbender && (player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.SAND
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.SANDSTONE
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.RED_SANDSTONE)) {
if (sandbender && (player.getLocation().getBlock().getRelative(BlockFace.DOWN, sandRunHeight).getType() == Material.SAND
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN, sandRunHeight).getType() == Material.SANDSTONE
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN, sandRunHeight).getType() == Material.RED_SANDSTONE)) {
if (CoreAbility.hasAbility(player, AcrobatStance.class)) {
AcrobatStance abil = CoreAbility.getAbility(player, AcrobatStance.class);
max = Math.max(air, chi);