Merge pull request #484 from Simplicitee/master

Fix sand speed passive
This commit is contained in:
OmniCypher 2016-04-18 17:16:42 -07:00
commit 9d3d3ab692
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);