From 307d483323f00384ca86327fb2a57e4ced5c216e Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Fri, 27 Oct 2017 20:30:45 -0400 Subject: [PATCH] Dont do diminishing returns on command caused xp gains Fixes #3312 --- src/main/java/com/gmail/nossr50/listeners/SelfListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index 39d995789..c9ab378e9 100644 --- a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.listeners; +import com.gmail.nossr50.datatypes.skills.XPGainReason; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -44,9 +45,10 @@ public class SelfListener implements Listener { @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onPlayerXpGain(McMMOPlayerXpGainEvent event) { + if (event.getXpGainReason() == XPGainReason.COMMAND) + return; SkillType skillType = event.getSkill(); int threshold = ExperienceConfig.getInstance().getDiminishedReturnsThreshold(skillType); - if (threshold <= 0 || !ExperienceConfig.getInstance().getDiminishedReturnsEnabled()) { // Diminished returns is turned off return;