2
0
nossr50 6 жил өмнө
parent
commit
8991c2bf2c

+ 5 - 0
Changelog.txt

@@ -151,6 +151,11 @@ Version 2.2.0
     Added API method to check if player parties are size capped
     Added API method to grab the level cap of a skill by its PrimarySkillType ENUM definition
     Added API method to check if a skill was being level capped
+Version 2.1.33
+    Renamed "Skills.Acrobatics.Prevent_AFK_Leveling" to "ExploitFix.Acrobatics"
+    ExploitFix.Acrobatics when set to false allows gaining XP in Acrobatics freely with no anti-grind measures
+    NOTE: The anti-grinding/exploit stuff is fully configurable in update 2.2 coming soon, this hotfix is to hold you over until that update comes out.
+
 Version 2.1.32
     Completely removed Fireworks from mcMMO because they lag
     Added 'General.AprilFoolsEvent' setting to config.yml to turn off April Fools

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

@@ -424,7 +424,6 @@ public abstract class Config implements VersionedConfig, Unload {
     {
         return userRootNode.getNode(path).getInt();
     }
-
     /**
      * Grabs a double from the specified node
      * @param path

+ 3 - 0
src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java

@@ -226,6 +226,9 @@ public class ExperienceConfig extends ConfigValidated {
         return getBooleanValue(EXPLOIT_FIX, ENDERMAN_ENDERMITE_FARMS);
     }
 
+/*    public boolean isFishingExploitingPrevented() { return config.getBoolean("ExploitFix.Fishing", true); }
+    public boolean isAcrobaticsExploitingPrevented() { return config.getBoolean("ExploitFix.Acrobatics", true); }*/
+
     /* Curve settings */
     public FormulaType getFormulaType() {
         return FormulaType.getFormulaType(getStringValue(EXPERIENCE_FORMULA, CURVE));

+ 4 - 0
src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java

@@ -276,6 +276,10 @@ public class Roll extends AcrobaticsSubSkill {
      * @return true if exploits are detected, false otherwise
      */
     private boolean isExploiting(Player player) {
+        if (!mcMMO.getConfigManager().getConfigExploitPrevention().getConfigSectionExploitAcrobatics().isPreventAcrobaticsAbuse()) {
+            return false;
+        }
+
         if (player.getInventory().getItemInMainHand().getType() == Material.ENDER_PEARL || player.isInsideVehicle()) {
             return true;
         }

+ 38 - 0
src/main/java/com/gmail/nossr50/listeners/BlockListener.java

@@ -121,6 +121,44 @@ public class BlockListener implements Listener {
         }
     }
 
+    /*@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
+    public void onBlockDropItemEvent(BlockDropItemEvent event)
+    {
+        for(Item item : event.getItems())
+        {
+            ItemStack is = new ItemStack(item.getItemStack());
+
+            if(event.getBlock().getMetadata(mcMMO.doubleDrops).size() > 0)
+            {
+                List<MetadataValue> metadataValue = event.getBlock().getMetadata(mcMMO.doubleDrops);
+
+                BonusDrops bonusDrops = (BonusDrops) metadataValue.get(0);
+                Collection<ItemStack> potentialDrops = (Collection<ItemStack>) bonusDrops.value();
+
+                if(potentialDrops.contains(is))
+                {
+                    event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
+                }
+
+                event.getBlock().removeMetadata(mcMMO.doubleDrops, plugin);
+            } else {
+                if(event.getBlock().getMetadata(mcMMO.tripleDrops).size() > 0) {
+                    List<MetadataValue> metadataValue = event.getBlock().getMetadata(mcMMO.tripleDrops);
+
+                    BonusDrops bonusDrops = (BonusDrops) metadataValue.get(0);
+                    Collection<ItemStack> potentialDrops = (Collection<ItemStack>) bonusDrops.value();
+
+                    if (potentialDrops.contains(is)) {
+                        event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
+                        event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
+                    }
+
+                    event.getBlock().removeMetadata(mcMMO.tripleDrops, plugin);
+                }
+            }
+        }
+    }*/
+
     /**
      * Monitor BlockPistonExtend events.
      *

+ 0 - 2
src/main/java/com/gmail/nossr50/mcMMO.java

@@ -103,8 +103,6 @@ public class mcMMO extends JavaPlugin {
     public final static String disarmedItemKey     = "mcMMO: Disarmed Item";
     public final static String playerDataKey       = "mcMMO: Player Data";
     public final static String greenThumbDataKey   = "mcMMO: Green Thumb";
-    public final static String doubleDropKey       = "mcMMO: Double Drop";
-    public final static String tripleDropKey       = "mcMMO: Triple Drop";
     public final static String databaseCommandKey  = "mcMMO: Processing Database Command";
     public final static String bredMetadataKey     = "mcMMO: Bred Animal";
 

+ 4 - 0
src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java

@@ -1,5 +1,6 @@
 package com.gmail.nossr50.skills.acrobatics;
 
+import com.gmail.nossr50.config.experience.ExperienceConfig;
 import com.gmail.nossr50.datatypes.experience.XPGainReason;
 import com.gmail.nossr50.datatypes.interactions.NotificationType;
 import com.gmail.nossr50.datatypes.player.McMMOPlayer;
@@ -32,6 +33,9 @@ public class AcrobaticsManager extends SkillManager {
 
     public boolean canGainRollXP()
     {
+        if(!ExperienceConfig.getInstance().isAcrobaticsExploitingPrevented())
+            return true;
+
         if(System.currentTimeMillis() >= rollXPCooldown)
         {
             rollXPCooldown = System.currentTimeMillis() + rollXPInterval;

+ 3 - 3
src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java

@@ -67,7 +67,7 @@ public class Herbalism {
             dropAmount++;
 
             if(herbalismManager.checkDoubleDrop(target.getState()))
-                BlockUtils.markBlocksForBonusDrops(target.getState(), triple);
+                BlockUtils.markDropsAsBonus(target.getState(), triple);
         }
 
         for (BlockFace blockFace : new BlockFace[] { BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST ,BlockFace.WEST})
@@ -110,7 +110,7 @@ public class Herbalism {
                     dropAmount++;
 
                     if(herbalismManager.checkDoubleDrop(relativeBlock.getState()))
-                        BlockUtils.markBlocksForBonusDrops(relativeBlock.getState(), triple);
+                        BlockUtils.markDropsAsBonus(relativeBlock.getState(), triple);
                 }
             }
         }
@@ -142,7 +142,7 @@ public class Herbalism {
             amount += 1;
 
             if(herbalismManager.checkDoubleDrop(relativeUpBlock.getState()))
-                BlockUtils.markBlocksForBonusDrops(relativeUpBlock.getState(), triple);
+                BlockUtils.markDropsAsBonus(relativeUpBlock.getState(), triple);
 
         }
 

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java

@@ -163,7 +163,7 @@ public class HerbalismManager extends SkillManager {
             } else {
                 /* MARK SINGLE BLOCK CROP FOR DOUBLE DROP */
                 if(checkDoubleDrop(blockState))
-                    BlockUtils.markBlocksForBonusDrops(blockState, greenTerra);
+                    BlockUtils.markDropsAsBonus(blockState, greenTerra);
             }
 
             if (Permissions.greenThumbPlant(player, material)) {

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java

@@ -92,7 +92,7 @@ public class MiningManager extends SkillManager {
 
         //TODO: Make this readable
         if (RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS, true)) {
-            BlockUtils.markBlocksForBonusDrops(blockState, mcMMOPlayer.getAbilityMode(skill.getAbility()));
+            BlockUtils.markDropsAsBonus(blockState, mcMMOPlayer.getAbilityMode(skill.getAbility()));
         }
     }
 

+ 3 - 3
src/main/java/com/gmail/nossr50/util/BlockUtils.java

@@ -23,12 +23,12 @@ public final class BlockUtils {
      * @param blockState target blockstate
      * @param triple marks the block to give triple drops
      */
-    public static void markBlocksForBonusDrops(BlockState blockState, boolean triple)
+    public static void markDropsAsBonus(BlockState blockState, boolean triple)
     {
         if(triple)
-            blockState.setMetadata(mcMMO.tripleDropKey, mcMMO.metadataValue);
+            blockState.setMetadata(mcMMO.tripleDrops, mcMMO.metadataValue);
         else
-            blockState.setMetadata(mcMMO.doubleDropKey, mcMMO.metadataValue);
+            blockState.setMetadata(mcMMO.doubleDrops, mcMMO.metadataValue);
     }
 
     /**

+ 1 - 1
src/main/java/com/gmail/nossr50/util/HolidayManager.java

@@ -380,4 +380,4 @@
 //        PluginCommand command = mcMMO.p.getCommand("mcfools");
 //        command.setExecutor(new AprilCommand());
 //    }
-//}
+//}

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

@@ -311,8 +311,6 @@ Skills:
     Acrobatics:
         Enabled_For_PVP: true
         Enabled_For_PVE: true
-        Prevent_AFK_Leveling: true
-        Max_Tries_At_Same_Location: 3
         Prevent_Dodge_Lightning: false
         # Prevent earning Acrobatics XP a few seconds after teleporting
         XP_After_Teleport_Cooldown: 5

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

@@ -25,6 +25,7 @@ ExploitFix:
     # Prevent many exploits related to fishing
     Fishing: true
     EndermanEndermiteFarms: true
+    Acrobatics: true
 Experience_Bars:
     # Turn this to false if you wanna disable XP bars
     Enable: true

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 466 - 456
src/main/resources/locale/locale_de.properties


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно