diff --git a/Changelog.txt b/Changelog.txt index d5c35c54e..aca86de46 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -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 diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index 8ccf1bb8e..0745a5f73 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -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); } diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 262d5844a..f6278bc83 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -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; } diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 4f784340b..154354c0d 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -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; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 40caf3198..6dab58094 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -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