mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Fix another potential issue with recentlyHurt & /ptp.
This commit is contained in:
parent
31fff0623d
commit
12c6bfc2e8
@ -57,8 +57,9 @@ public class PtpCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ptpCooldown = Config.getInstance().getPTPCommandCooldown();
|
int ptpCooldown = Config.getInstance().getPTPCommandCooldown();
|
||||||
|
long recentlyHurt = playerProfile.getRecentlyHurt() * Misc.TIME_CONVERSION_FACTOR;
|
||||||
|
|
||||||
if (playerProfile.getRecentlyHurt() + (ptpCooldown * Misc.TIME_CONVERSION_FACTOR) > System.currentTimeMillis()) {
|
if (System.currentTimeMillis() - recentlyHurt >= (ptpCooldown * Misc.TIME_CONVERSION_FACTOR)) {
|
||||||
player.sendMessage(LocaleLoader.getString("Party.Teleport.Hurt", ptpCooldown));
|
player.sendMessage(LocaleLoader.getString("Party.Teleport.Hurt", ptpCooldown));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public final class ChimaeraWing {
|
|||||||
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
|
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
|
||||||
Block block = player.getLocation().getBlock();
|
Block block = player.getLocation().getBlock();
|
||||||
int amount = inHand.getAmount();
|
int amount = inHand.getAmount();
|
||||||
long recentlyHurt = profile.getRecentlyHurt();
|
long recentlyHurt = profile.getRecentlyHurt() * Misc.TIME_CONVERSION_FACTOR;
|
||||||
|
|
||||||
if (Permissions.chimaeraWing(player) && inHand.getTypeId() == Config.getInstance().getChimaeraItemId()) {
|
if (Permissions.chimaeraWing(player) && inHand.getTypeId() == Config.getInstance().getChimaeraItemId()) {
|
||||||
if (SkillUtils.cooldownOver(recentlyHurt, 60, player) && amount >= Config.getInstance().getChimaeraCost()) {
|
if (SkillUtils.cooldownOver(recentlyHurt, 60, player) && amount >= Config.getInstance().getChimaeraCost()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user