diff --git a/Changelog.txt b/Changelog.txt index f64a0f576..81c961ba4 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,9 @@ +Version 2.1.232 + Added new setting to experience.yml 'ExploitFix.PreventArmorStandInteraction' can be turned to false to enable mcMMO abilities on armor stands again + + NOTES: + The new setting simply prevents mcMMO abilities from activating when attacking an armor stand, this prevents some exploits + Version 2.1.231 Fixed a bug preventing parties from being made without passwords (Thanks Momshroom) Updated korean locale (thanks mangchi57) diff --git a/pom.xml b/pom.xml index 61f6317bb..b941e9132 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.231 + 2.1.232-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 929fdcefe..9a2eba487 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -177,6 +177,10 @@ public class ExperienceConfig extends BukkitConfig { return config.getBoolean("ExploitFix.PreventPluginNPCInteraction", true); } + public boolean isArmorStandInteractionPrevented() { + return config.getBoolean("ExploitFix.PreventArmorStandInteraction", true); + } + public boolean isFishingExploitingPrevented() { return config.getBoolean("ExploitFix.Fishing", true); } diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 1d5eea33f..ed3cae460 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -300,6 +300,10 @@ public final class CombatUtils { Entity painSource = event.getDamager(); EntityType entityType = painSource.getType(); + if (target instanceof ArmorStand) { + return; + } + if (target instanceof Player player) { if(ExperienceConfig.getInstance().isNPCInteractionPrevented()) { if (Misc.isNPCEntityExcludingVillagers(target)) { diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 00e72f01d..5b12d1f9a 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -39,6 +39,7 @@ ExploitFix: TreeFellerReducedXP: true PistonCheating: true SnowGolemExcavation: true + PreventArmorStandInteraction: true # This include NPCs from stuff like Citizens, this is not a setting for Vanilla Minecraft Villagers (Which can be considered NPCs) # mcMMO normally doesn't process attacks against an Entity if it is an NPC from another plugin # Of course, mcMMO doesn't know for sure whether something is an NPC, it checks a few known things, see our source code to see how