Fixed Chimera Wing displaying warmup message if warmup was set to 0

This commit is contained in:
GJ 2013-04-04 09:59:10 -04:00
parent 0f77cf8066
commit 630c3e81e6
3 changed files with 12 additions and 5 deletions

View File

@ -22,6 +22,7 @@ Version 1.4.05-dev
= Fixed huge mushroom blocks not being properly tracked
= Fixed potion buff option not using the appropriate # of ticks
= Fixed Chimera Wing spamming console if Metrics was disabled
= Fixed Chimera Wing displaying warmup message if warmup was set to 0
Version 1.4.04
+ Added functions to ExperienceAPI for use with offline players

View File

@ -41,7 +41,7 @@ public class ChimaeraWingWarmup extends BukkitRunnable {
}
if (!ItemUtils.isChimaeraWing(inHand) || inHand.getAmount() < Config.getInstance().getChimaeraUseCost()) {
player.sendMessage(ChatColor.DARK_RED + "Not holding enough " + ChatColor.GRAY + "ChimaeraWings"); //TODO Locale!
player.sendMessage(LocaleLoader.getString("Skills.NeedMore", "Chimaera Wings")); //TODO Locale!
return;
}

View File

@ -53,7 +53,7 @@ public final class ChimaeraWing {
return;
}
if (!SkillUtils.cooldownOver(lastChimaeraWing * Misc.TIME_CONVERSION_FACTOR, Config.getInstance().getChimaeraCooldown(), player)) {
if (Config.getInstance().getChimaeraCooldown() > 0 && !SkillUtils.cooldownOver(lastChimaeraWing * Misc.TIME_CONVERSION_FACTOR, Config.getInstance().getChimaeraCooldown(), player)) {
player.sendMessage(ChatColor.RED + "You need to wait before you can use this again! " + ChatColor.YELLOW + "(" + SkillUtils.calculateTimeLeft(lastChimaeraWing * Misc.TIME_CONVERSION_FACTOR, Config.getInstance().getChimaeraCooldown(), player) + ")"); //TODO Locale!
return;
}
@ -69,7 +69,6 @@ public final class ChimaeraWing {
}
if (Config.getInstance().getChimaeraPreventUseUnderground()) {
if (location.getY() < player.getWorld().getHighestBlockYAt(location)) {
player.setItemInHand(new ItemStack(getChimaeraWing(amount - Config.getInstance().getChimaeraUseCost())));
player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Fail"));
@ -79,12 +78,19 @@ public final class ChimaeraWing {
return;
}
}
mcMMOPlayer.actualizeChimaeraCommenceLocation(player);
long warmup = Config.getInstance().getChimaeraWarmup();
if (warmup > 0) {
player.sendMessage(ChatColor.GRAY + "Commencing teleport in " + ChatColor.GOLD + "(" + warmup + ")" + ChatColor.GRAY + " seconds, please stand still..."); //TODO Locale!
new ChimaeraWingWarmup(mcMMOPlayer).runTaskLater(mcMMO.p, 20 * warmup);
}
else {
chimaeraExecuteTeleport();
}
}
}
public static void chimaeraExecuteTeleport() {