From 33f4ac14b531938296ee8190313ef4c7cc0d1a45 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 24 Jan 2020 18:28:41 -0800 Subject: [PATCH] Add toggle for snow golem exploit to experience.yml - SnowGolemExcavation --- pom.xml | 2 +- .../com/gmail/nossr50/config/experience/ExperienceConfig.java | 1 + .../com/gmail/nossr50/datatypes/skills/SuperAbilityType.java | 1 - src/main/java/com/gmail/nossr50/listeners/BlockListener.java | 2 +- src/main/resources/experience.yml | 1 + 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 3a227f4e4..28aec646e 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.113 + 2.1.114-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java index 13c88d329..8454ec908 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -144,6 +144,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { */ /* EXPLOIT TOGGLES */ + public boolean isSnowExploitPrevented() { return config.getBoolean("SnowGolemExcavation", true); } public boolean isEndermanEndermiteFarmingPrevented() { return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); } public boolean isPistonCheatingPrevented() { return config.getBoolean("ExploitFix.PistonCheating", true); } public boolean isPistonExploitPrevented() { return config.getBoolean("ExploitFix.Pistons", false); } diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java index 30581df01..4aa3df817 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java @@ -3,7 +3,6 @@ package com.gmail.nossr50.datatypes.skills; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; -import com.gmail.nossr50.util.MaterialMapStore; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index af9916cdc..9023caa3d 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -178,7 +178,7 @@ public class BlockListener implements Listener { BlockState blockState = event.getNewState(); - if(BlockUtils.shouldBeWatched(blockState)) + if(ExperienceConfig.getInstance().isSnowExploitPrevented() && BlockUtils.shouldBeWatched(blockState)) { mcMMO.getPlaceStore().setTrue(blockState.getBlock()); } diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 24496392a..37e5921c8 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -34,6 +34,7 @@ ExploitFix: LavaStoneAndCobbleFarming: true TreeFellerReducedXP: true PistonCheating: true + SnowGolemExcavation: true Experience_Bars: # Turn this to false if you wanna disable XP bars Enable: true