瀏覽代碼

2.1.61 - Some fixes + Exploit prevention

nossr50 6 年之前
父節點
當前提交
1c130aad42

+ 2 - 0
Changelog.txt

@@ -3,8 +3,10 @@ Version 2.1.61
     Updated the Japanese locale (thanks snake0053)
     Added toggle to turn off event message broadcasts (XP rate) to config.yml - 'General.EventBroadcasts'
     Added toggle to not inform players of events when they join (XP rate, etc) to config.yml 'General.EventInfoOnPlayerJoin'
+    Added anti-exploit protection for cobble/stone farms which can be automated, to turn this off you can toggle the new config options 'ExploitFix.LavaStoneAndCobbleFarming' in experience.yml
 
     NOTE: The toggle for event message broadcasts is separate from the titles being shown, that's another config option (titles are the BIG TEXT in the middle of the screen)
+    NOTE: The new anti-stone/cobble automation will not prevent XP gains from obsidian, since Obsidian requires some effort to farm
 
 Version 2.1.60
     Fixed a NPE error if a LivingEntity's target was set to null

+ 1 - 1
pom.xml

@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.gmail.nossr50.mcMMO</groupId>
     <artifactId>mcMMO</artifactId>
-    <version>2.1.60</version>
+    <version>2.1.61</version>
     <name>mcMMO</name>
     <url>https://github.com/mcMMO-Dev/mcMMO</url>
     <scm>

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

@@ -332,4 +332,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
     {
         return config.getInt("Experience_Values.Taming.Animal_Taming." + StringUtils.getPrettyEntityTypeString(type));
     }
+
+    public boolean preventStoneLavaFarming() { return config.getBoolean("ExploitFix.LavaStoneAndCobbleFarming", true);}
 }

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

@@ -180,6 +180,22 @@ public class BlockListener implements Listener {
         }
     }
 
+    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
+    public void onBlockFormEvent(BlockFormEvent event)
+    {
+        /* WORLD BLACKLIST CHECK */
+        if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
+            return;
+
+        if(ExperienceConfig.getInstance().preventStoneLavaFarming())
+        {
+            if(event.getNewState().getType() != Material.OBSIDIAN && BlockUtils.shouldBeWatched(event.getNewState()))
+            {
+                mcMMO.getPlaceStore().setTrue(event.getNewState());
+            }
+        }
+    }
+
     /**
      * Monitor BlockPlace events.
      *

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

@@ -31,6 +31,7 @@ ExploitFix:
     Fishing: true
     EndermanEndermiteFarms: true
     Acrobatics: true
+    LavaStoneAndCobbleFarming: true
 Experience_Bars:
     # Turn this to false if you wanna disable XP bars
     Enable: true