mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Cleanup ChimaeraWing
This commit is contained in:
parent
0cd3e4ed84
commit
0292d3eefb
@ -45,14 +45,23 @@ public final class ChimaeraWing {
|
||||
return;
|
||||
}
|
||||
|
||||
if (SkillUtils.cooldownOver(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, 60, player) && amount >= Config.getInstance().getChimaeraUseCost()) {
|
||||
if (!SkillUtils.cooldownOver(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, 60, player)) {
|
||||
player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, 60, player)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (amount <= Config.getInstance().getChimaeraUseCost()) {
|
||||
player.sendMessage(LocaleLoader.getString("Skills.NeedMore", "Chimaera Wings")); //TODO Locale!
|
||||
return;
|
||||
}
|
||||
|
||||
player.setItemInHand(new ItemStack(getChimaeraWing(amount - Config.getInstance().getChimaeraUseCost())));
|
||||
|
||||
if (Config.getInstance().getChimaeraPreventUseUnderground()) {
|
||||
|
||||
if (location.getY() < player.getWorld().getHighestBlockYAt(location)) {
|
||||
player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Fail"));
|
||||
player.setVelocity(new Vector(0, 1, 0));
|
||||
player.setVelocity(new Vector(0, 0.5D, 0));
|
||||
UserManager.getPlayer(player).actualizeLastChimaeraTeleport();
|
||||
return;
|
||||
}
|
||||
@ -75,13 +84,6 @@ public final class ChimaeraWing {
|
||||
MetricsManager.chimeraWingUsed();
|
||||
player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Pass"));
|
||||
}
|
||||
else if (!SkillUtils.cooldownOver(recentlyHurt, 60 * Misc.TIME_CONVERSION_FACTOR, player) && amount >= Config.getInstance().getChimaeraUseCost()) {
|
||||
player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", SkillUtils.calculateTimeLeft(recentlyHurt, 60, player)));
|
||||
}
|
||||
else if (amount <= Config.getInstance().getChimaeraUseCost()) {
|
||||
player.sendMessage(LocaleLoader.getString("Skills.NeedMore", "Chimaera Wings")); //TODO Locale!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack getChimaeraWing(int amount) {
|
||||
|
Loading…
Reference in New Issue
Block a user