Просмотр исходного кода

Added config option for Acrobatics teleport cooldown,

also updated the changelog.
TfT_02 12 лет назад
Родитель
Сommit
f5c58f3679

+ 1 - 0
Changelog.txt

@@ -11,6 +11,7 @@ Version 1.4.07-dev
  + Added snow to excavation
  + Added new experience curve option. Cumulative curve, calculates experience needed for next level using power level.
  + Added extra settings to config.yml for Call of the Wild (Taming)
+ + Added a 5 cooldown after teleporting before Acrobatics XP can be earned. + Config option to disable
  = Fixed bug with Skull Splitter not finding the locale string
  = Fixed issue where locale strings could cause the scoreboard header to be longer than 16 characters.
  = Fixed a bug with Beast Lore when the entity had no owner but was tamed.

+ 1 - 0
src/main/java/com/gmail/nossr50/config/Config.java

@@ -216,6 +216,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); }
 
     /* Fishing */
     public int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }

+ 2 - 1
src/main/java/com/gmail/nossr50/listeners/EntityListener.java

@@ -34,6 +34,7 @@ import org.bukkit.metadata.FixedMetadataValue;
 
 import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.config.AdvancedConfig;
+import com.gmail.nossr50.config.Config;
 import com.gmail.nossr50.datatypes.player.McMMOPlayer;
 import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
 import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
@@ -222,7 +223,7 @@ public class EntityListener implements Listener {
 
             switch (cause) {
                 case FALL:
-                    if (SkillUtils.calculateTimeLeft((long) mcMMOPlayer.getTeleportATS() * Misc.TIME_CONVERSION_FACTOR, 5, player) > 0) {
+                    if (!Config.getInstance().getPreventXPAfterTeleport() || SkillUtils.calculateTimeLeft((long) mcMMOPlayer.getTeleportATS() * Misc.TIME_CONVERSION_FACTOR, 5, player) > 0) {
                         return;
                     }
 

+ 1 - 1
src/main/java/com/gmail/nossr50/listeners/PlayerListener.java

@@ -79,7 +79,7 @@ public class PlayerListener implements Listener {
     public void onPlayerTeleport(PlayerTeleportEvent event) {
         Player player = event.getPlayer();
 
-        if (Misc.isNPCEntity(player)) {
+        if (Misc.isNPCEntity(player) || !Config.getInstance().getPreventXPAfterTeleport()) {
             return;
         }
 

+ 1 - 0
src/main/resources/config.yml

@@ -179,6 +179,7 @@ Skills:
         Enabled_For_PVE: true
         Prevent_AFK_Leveling: true
         Prevent_Dodge_Lightning: false
+        Prevent_XP_After_Teleport: true
         Level_Cap: 0
     Archery:
         Enabled_For_PVP: true