Make Acrobatics XP prevention cool down, after teleporting configurable

Adds #1906
This commit is contained in:
TfT_02 2014-03-09 15:24:24 +01:00
parent 862d38b587
commit e1a8f02bce
5 changed files with 6 additions and 4 deletions

View File

@ -53,6 +53,7 @@ Version 1.4.08-dev
! Changed config validation for UnlockLevels, they can now also be 0
! Changed config validation for Rank_Levels, successive Ranks can now be less than or equal to each other
! Changed default amount of XP gained from mining Quartz Ore. From 250 to 100 XP.
! Changed Acrobatics config setting, Skills.Acrobatics.Prevent_XP_After_Teleport is now Skills.Acrobatics.XP_After_Teleport_Cooldown
- Removed /stats alias for /mcstats
Version 1.4.07

View File

@ -422,7 +422,7 @@ public class Config extends AutoUpdateConfigLoader {
/* Acrobatics */
public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
public boolean getPreventXPAfterTeleport() { return config.getBoolean("Skills.Acrobatics.Prevent_XP_After_Teleport", true); }
public int getXPAfterTeleportCooldown() { return config.getInt("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); }
/* Alchemy */
public boolean getEnabledForHoppers() { return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); }

View File

@ -255,7 +255,7 @@ public class EntityListener implements Listener {
switch (cause) {
case FALL:
if (Config.getInstance().getPreventXPAfterTeleport() && SkillUtils.calculateTimeLeft((long) mcMMOPlayer.getTeleportATS() * Misc.TIME_CONVERSION_FACTOR, 5, player) > 0) {
if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) {
return;
}

View File

@ -81,7 +81,7 @@ public class PlayerListener implements Listener {
public void onPlayerTeleport(PlayerTeleportEvent event) {
Player player = event.getPlayer();
if (!UserManager.hasPlayerDataKey(player) || !Config.getInstance().getPreventXPAfterTeleport() || event.getFrom().equals(event.getTo())) {
if (!UserManager.hasPlayerDataKey(player) || Config.getInstance().getXPAfterTeleportCooldown() <= 0 || event.getFrom().equals(event.getTo())) {
return;
}

View File

@ -267,7 +267,8 @@ Skills:
Prevent_AFK_Leveling: true
Max_Tries_At_Same_Location: 3
Prevent_Dodge_Lightning: false
Prevent_XP_After_Teleport: true
# Prevent earning Acrobatics XP a few seconds after teleporting
XP_After_Teleport_Cooldown: 5
Level_Cap: 0
Alchemy:
# Allow Hoppers to transfer ingredients and brew Rank 1 Alchemy potions